Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Backported bugfixes from 1.0 branch.
git-svn-id: https://opentk.svn.sourceforge.net/svnroot/opentk/trunk@2588 ebc5dd9b-fb1d-0410-b6f8-d24c324e9604
  • Loading branch information
the_fiddler committed Feb 3, 2010
1 parent 70df16b commit 17218fb
Show file tree
Hide file tree
Showing 39 changed files with 512 additions and 549 deletions.
4 changes: 4 additions & 0 deletions Source/Bind/Specifications/GL2/enumext.spec
Expand Up @@ -7582,6 +7582,10 @@ ActiveUniformBlockParameter enum:
use ARB_uniform_buffer_object UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES
use ARB_uniform_buffer_object UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER
use ARB_uniform_buffer_object UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER

# Used in primitive restart
EnableCap enum:
PRIMITIVE_RESTART = 0x8F9D # 3.1 (different from NV_primitive_restart)


# Non-core
Expand Down
3 changes: 1 addition & 2 deletions Source/Examples/OpenGL/1.1/VertexArrays.cs
Expand Up @@ -116,8 +116,7 @@ protected override void OnUpdateFrame(FrameEventArgs e)
return;
}

// Alt+Enter toggles fullscreen mode.
if ((Keyboard[Key.AltLeft] || Keyboard[Key.AltRight]) && Keyboard[Key.Enter])
if (Keyboard[Key.F11])
if (WindowState != WindowState.Fullscreen)
WindowState = WindowState.Fullscreen;
else
Expand Down
3 changes: 1 addition & 2 deletions Source/Examples/OpenGL/1.1/VertexLighting.cs
Expand Up @@ -108,8 +108,7 @@ protected override void OnUpdateFrame(FrameEventArgs e)
return;
}

if ((Keyboard[OpenTK.Input.Key.AltLeft] || Keyboard[OpenTK.Input.Key.AltRight]) &&
Keyboard[OpenTK.Input.Key.Enter])
if (Keyboard[OpenTK.Input.Key.F11])
if (WindowState != WindowState.Fullscreen)
WindowState = WindowState.Fullscreen;
else
Expand Down
3 changes: 1 addition & 2 deletions Source/Examples/OpenGL/GLSL/SimpleGLSL.cs
Expand Up @@ -221,8 +221,7 @@ protected override void OnUpdateFrame(FrameEventArgs e)
if (Keyboard[OpenTK.Input.Key.Escape])
this.Exit();

if ((Keyboard[OpenTK.Input.Key.AltLeft] || Keyboard[OpenTK.Input.Key.AltRight]) &&
Keyboard[OpenTK.Input.Key.Enter])
if (Keyboard[OpenTK.Input.Key.F11])
if (WindowState != WindowState.Fullscreen)
WindowState = WindowState.Fullscreen;
else
Expand Down
12 changes: 6 additions & 6 deletions Source/Examples/OpenGLES/1.1/SimpleWindow.cs
Expand Up @@ -66,14 +66,14 @@ protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);

Color color = Color.MidnightBlue;
Color4 color = Color4.MidnightBlue;
GL.ClearColor(color.R, color.G, color.B, color.A);
GL.Enable((All)EnableCap.DepthTest);
}

#endregion

#region OnResize
#region OnResize

/// <summary>
/// Called when the user resizes the window.
Expand All @@ -95,7 +95,7 @@ protected override void OnResize(EventArgs e)

#endregion

#region OnUpdateFrame
#region OnUpdateFrame

/// <summary>
/// Prepares the next frame for rendering.
Expand All @@ -115,7 +115,7 @@ protected override void OnUpdateFrame(FrameEventArgs e)

#endregion

#region OnRenderFrame
#region OnRenderFrame

/// <summary>
/// Place your rendering code here.
Expand All @@ -138,7 +138,7 @@ protected override void OnRenderFrame(FrameEventArgs e)

#endregion

#region private void DrawCube()
#region private void DrawCube()

private void DrawCube()
{
Expand Down Expand Up @@ -188,7 +188,7 @@ private void DrawCube()

#endregion

#region public static void Main()
#region public static void Main()

/// <summary>
/// Entry point of this example.
Expand Down
46 changes: 2 additions & 44 deletions Source/Examples/OpenGLES/2.0/SimpleWindow20.cs
Expand Up @@ -41,7 +41,7 @@

namespace Examples.Tutorial
{
[Example("Immediate mode", ExampleCategory.OpenGLES, "2.0", Documentation = "SimpleES20Window")]
[Example("Simple ES 2.0", ExampleCategory.OpenGLES, "2.0", Documentation = "SimpleES20Window")]
public class SimpleES20Window : GameWindow
{
#region Constructor
Expand All @@ -58,7 +58,7 @@ protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);

Color color = Color.MidnightBlue;
Color4 color = Color4.MidnightBlue;
GL.ClearColor(color.R, color.G, color.B, color.A);
GL.Enable(EnableCap.DepthTest);
}
Expand Down Expand Up @@ -119,48 +119,6 @@ protected override void OnRenderFrame(FrameEventArgs e)

private void DrawCube()
{
#if false
GL.Begin(BeginMode.Quads);

GL.Color3(Color.Silver);
GL.Vertex3(-1.0f, -1.0f, -1.0f);
GL.Vertex3(-1.0f, 1.0f, -1.0f);
GL.Vertex3(1.0f, 1.0f, -1.0f);
GL.Vertex3(1.0f, -1.0f, -1.0f);

GL.Color3(Color.Honeydew);
GL.Vertex3(-1.0f, -1.0f, -1.0f);
GL.Vertex3(1.0f, -1.0f, -1.0f);
GL.Vertex3(1.0f, -1.0f, 1.0f);
GL.Vertex3(-1.0f, -1.0f, 1.0f);

GL.Color3(Color.Moccasin);

GL.Vertex3(-1.0f, -1.0f, -1.0f);
GL.Vertex3(-1.0f, -1.0f, 1.0f);
GL.Vertex3(-1.0f, 1.0f, 1.0f);
GL.Vertex3(-1.0f, 1.0f, -1.0f);

GL.Color3(Color.IndianRed);
GL.Vertex3(-1.0f, -1.0f, 1.0f);
GL.Vertex3(1.0f, -1.0f, 1.0f);
GL.Vertex3(1.0f, 1.0f, 1.0f);
GL.Vertex3(-1.0f, 1.0f, 1.0f);

GL.Color3(Color.PaleVioletRed);
GL.Vertex3(-1.0f, 1.0f, -1.0f);
GL.Vertex3(-1.0f, 1.0f, 1.0f);
GL.Vertex3(1.0f, 1.0f, 1.0f);
GL.Vertex3(1.0f, 1.0f, -1.0f);

GL.Color3(Color.ForestGreen);
GL.Vertex3(1.0f, -1.0f, -1.0f);
GL.Vertex3(1.0f, 1.0f, -1.0f);
GL.Vertex3(1.0f, 1.0f, 1.0f);
GL.Vertex3(1.0f, -1.0f, 1.0f);

GL.End();
#endif
}

#endregion
Expand Down
18 changes: 4 additions & 14 deletions Source/Examples/OpenTK/GameWindow/FullscreenAntialias.cs
Expand Up @@ -43,17 +43,7 @@ public class FullscreenAntialias : GameWindow
public FullscreenAntialias()
: base(800, 600, new GraphicsMode(32, 0, 0, 4))
{
Keyboard.KeyDown += delegate(object sender, KeyboardKeyEventArgs e)
{
if (e.Key == Key.Escape)
this.Exit();

if ((e.Key == Key.AltLeft || e.Key == Key.AltRight) && (e.Key == Key.Enter || e.Key == Key.KeypadEnter))
if (this.WindowState == WindowState.Fullscreen)
this.WindowState = WindowState.Normal;
else
this.WindowState = WindowState.Fullscreen;
};
Keyboard.KeyDown += Keyboard_KeyDown;
}

#region Keyboard_KeyDown
Expand All @@ -63,12 +53,12 @@ public FullscreenAntialias()
/// </summary>
/// <param name="sender">The KeyboardDevice which generated this event.</param>
/// <param name="key">The key that was pressed.</param>
void Keyboard_KeyDown(KeyboardDevice sender, Key key)
void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)
{
if (sender[Key.Escape])
if (e.Key == Key.Escape)
this.Exit();

if ((sender[Key.AltLeft] || sender[Key.AltRight]) && (sender[Key.Enter] || sender[Key.KeypadEnter]))
if (e.Key == Key.F11)
if (this.WindowState == WindowState.Fullscreen)
this.WindowState = WindowState.Normal;
else
Expand Down
2 changes: 1 addition & 1 deletion Source/Examples/OpenTK/GameWindow/SimpleWindow.cs
Expand Up @@ -39,7 +39,7 @@ void Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)
if (e.Key == Key.Escape)
this.Exit();

if ((e.Key == Key.AltLeft || e.Key == Key.AltRight) && (e.Key == Key.Enter || e.Key == Key.KeypadEnter))
if (e.Key == Key.F11)
if (this.WindowState == WindowState.Fullscreen)
this.WindowState = WindowState.Normal;
else
Expand Down
2 changes: 1 addition & 1 deletion Source/Examples/OpenTK/Test/Multithreading.cs
Expand Up @@ -64,7 +64,7 @@ static void RunGame()
Utilities.SetWindowTitle(game);
game.Keyboard.KeyUp += delegate(object sender, OpenTK.Input.KeyboardKeyEventArgs e)
{
if (e.Key == OpenTK.Input.Key.Space)
if (e.Key == OpenTK.Input.Key.F11)
{
if (game.WindowState == OpenTK.WindowState.Fullscreen)
game.WindowState = OpenTK.WindowState.Normal;
Expand Down
8 changes: 8 additions & 0 deletions Source/Examples/Utilities.cs
Expand Up @@ -29,13 +29,21 @@ public static int ColorToRgba32(Color c)
return (int)((c.A << 24) | (c.B << 16) | (c.G << 8) | c.R);
}

/// <summary>
/// Sets the window title to the name of the sample.
/// </summary>
/// <param name="window"></param>
public static void SetWindowTitle(GameWindow window)
{
ExampleAttribute info = GetExampleAttribute(window.GetType());
window.Title = String.Format("OpenTK | {0} {1}: {2}", info.Category, info.Difficulty, info.Title);
window.Icon = OpenTK.Examples.Properties.Resources.App;
}

/// <summary>
/// Sets the window title to the name of the sample.
/// </summary>
/// <param name="window"></param>
public static void SetWindowTitle(System.Windows.Forms.Form window)
{
ExampleAttribute info = GetExampleAttribute(window.GetType());
Expand Down
7 changes: 3 additions & 4 deletions Source/OpenTK/Audio/AudioContext.cs
Expand Up @@ -59,8 +59,7 @@ public sealed class AudioContext : IDisposable

#region static AudioContext()

/// <private />
/// <static />
/// \internal
/// <summary>
/// Runs before the actual class constructor, to load available devices.
/// </summary>
Expand Down Expand Up @@ -224,7 +223,7 @@ public enum MaxAuxiliarySends:int
Four = 4,
}

/// <private />
/// \internal
/// <summary>Creates the audio context using the specified device.</summary>
/// <param name="device">The device descriptor obtained through AudioContext.AvailableDevices, or null for the default device.</param>
/// <param name="freq">Frequency for mixing output buffer, in units of Hz. Pass 0 for driver default.</param>
Expand Down Expand Up @@ -358,7 +357,7 @@ void CreateContext(string device, int freq, int refresh, bool sync, bool enableE

#region static void MakeCurrent(AudioContext context)

/// <private />
/// \internal
/// <summary>Makes the specified AudioContext current in the calling thread.</summary>
/// <param name="context">The OpenTK.Audio.AudioContext to make current, or null.</param>
/// <exception cref="ObjectDisposedException">
Expand Down
6 changes: 3 additions & 3 deletions Source/OpenTK/Audio/OpenAL/AL/AL.cs
Expand Up @@ -294,9 +294,9 @@ public static void Listener(ALListenerfv param, ref Vector3 at, ref Vector3 up)

/// <summary>This function retrieves a set of three floating-point values from a property of the listener.</summary>
/// <param name="param">The name of the attribute to be retrieved: ALListener3f.Position, ALListener3f.Velocity</param>
/// <param name="value1">Pointers to the three floating-point being retrieved.</param>
/// <param name="value2">Pointers to the three floating-point being retrieved.</param>
/// <param name="value3">Pointers to the three floating-point being retrieved.</param>
/// <param name="value1">The first floating-point value being retrieved.</param>
/// <param name="value2">The second floating-point value being retrieved.</param>
/// <param name="value3">The third floating-point value being retrieved.</param>
[DllImport(AL.Lib, EntryPoint = "alGetListener3f", ExactSpelling = true, CallingConvention = AL.Style), SuppressUnmanagedCodeSecurity()]
public static extern void GetListener(ALListener3f param, [Out] out float value1, [Out] out float value2, [Out] out float value3);
// AL_API void AL_APIENTRY alGetListener3f( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
Expand Down

0 comments on commit 17218fb

Please sign in to comment.