mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 18:45:36 +00:00
Merge remote-tracking branch 'frassle/warnings' into develop
This commit is contained in:
commit
3f8a62eaf7
|
@ -70,7 +70,9 @@ namespace CHeaderToXML
|
||||||
else
|
else
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
#pragma warning disable 0162 //CS0162: Unreachable code detected
|
||||||
/* gmcs bug 336258 */ return "";
|
/* gmcs bug 336258 */ return "";
|
||||||
|
#pragma warning restore 0162
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
|
|
||||||
Func<string[], string> get_name = tokens =>
|
Func<string[], string> get_name = tokens =>
|
||||||
|
|
|
@ -43,7 +43,6 @@ namespace CHeaderToXML
|
||||||
ParserModes CurrentMode;
|
ParserModes CurrentMode;
|
||||||
|
|
||||||
enum EntryModes { Core, Compatibility };
|
enum EntryModes { Core, Compatibility };
|
||||||
EntryModes CurrentEntryMode;
|
|
||||||
|
|
||||||
public override IEnumerable<XElement> Parse(string[] lines)
|
public override IEnumerable<XElement> Parse(string[] lines)
|
||||||
{
|
{
|
||||||
|
@ -67,7 +66,6 @@ namespace CHeaderToXML
|
||||||
new XAttribute("name", words[0]));
|
new XAttribute("name", words[0]));
|
||||||
|
|
||||||
CurrentMode = ParserModes.Enum;
|
CurrentMode = ParserModes.Enum;
|
||||||
CurrentEntryMode = EntryModes.Core;
|
|
||||||
}
|
}
|
||||||
else if (line.StartsWith(words[0] + "("))
|
else if (line.StartsWith(words[0] + "("))
|
||||||
{
|
{
|
||||||
|
@ -94,21 +92,15 @@ namespace CHeaderToXML
|
||||||
current.Add(new XElement("use",
|
current.Add(new XElement("use",
|
||||||
new XAttribute("enum", words[1]),
|
new XAttribute("enum", words[1]),
|
||||||
new XAttribute("token", words[2])));
|
new XAttribute("token", words[2])));
|
||||||
//new XAttribute("profile", CurrentEntryMode == EntryModes.Compatibility ?
|
|
||||||
// "compatibility" : "core")));
|
|
||||||
}
|
}
|
||||||
else if (words[1] == "=")
|
else if (words[1] == "=")
|
||||||
{
|
{
|
||||||
current.Add(new XElement("token",
|
current.Add(new XElement("token",
|
||||||
new XAttribute("name", words[0]),
|
new XAttribute("name", words[0]),
|
||||||
new XAttribute("value", words[2])));
|
new XAttribute("value", words[2])));
|
||||||
//new XAttribute("profile", CurrentEntryMode == EntryModes.Compatibility ?
|
|
||||||
// "compatibility" : "core")));
|
|
||||||
}
|
}
|
||||||
else if (words[0] == "profile:")
|
else if (words[0] == "profile:")
|
||||||
{
|
{
|
||||||
//CurrentEntryMode = words[1] == "compatibility" ?
|
|
||||||
// EntryModes.Compatibility : EntryModes.Core;
|
|
||||||
}
|
}
|
||||||
else if (words[0].Contains("future_use"))
|
else if (words[0].Contains("future_use"))
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace Examples.Tutorial
|
||||||
GL.Rotate(c * 360.0f, 0.0, 0.0, 1.0);
|
GL.Rotate(c * 360.0f, 0.0, 0.0, 1.0);
|
||||||
GL.Translate(5.0, 0.0, 0.0);
|
GL.Translate(5.0, 0.0, 0.0);
|
||||||
|
|
||||||
GL.Begin(BeginMode.Quads);
|
GL.Begin(PrimitiveType.Quads);
|
||||||
|
|
||||||
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);
|
||||||
|
|
|
@ -39,7 +39,6 @@ namespace Examples.Tutorial
|
||||||
{
|
{
|
||||||
throw new NotSupportedException(
|
throw new NotSupportedException(
|
||||||
"GL_EXT_framebuffer_object extension is required. Please update your drivers.");
|
"GL_EXT_framebuffer_object extension is required. Please update your drivers.");
|
||||||
Exit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Object = new Shapes.TorusKnot(256, 16, 0.2, 7,8, 1, true);
|
Object = new Shapes.TorusKnot(256, 16, 0.2, 7,8, 1, true);
|
||||||
|
@ -234,7 +233,7 @@ namespace Examples.Tutorial
|
||||||
// Draw the Color Texture
|
// Draw the Color Texture
|
||||||
GL.Translate(-1.1f, 0f, 0f);
|
GL.Translate(-1.1f, 0f, 0f);
|
||||||
GL.BindTexture(TextureTarget.Texture2D, ColorTexture);
|
GL.BindTexture(TextureTarget.Texture2D, ColorTexture);
|
||||||
GL.Begin(BeginMode.Quads);
|
GL.Begin(PrimitiveType.Quads);
|
||||||
{
|
{
|
||||||
GL.TexCoord2(0f, 1f);
|
GL.TexCoord2(0f, 1f);
|
||||||
GL.Vertex2(-1.0f, 1.0f);
|
GL.Vertex2(-1.0f, 1.0f);
|
||||||
|
@ -250,7 +249,7 @@ namespace Examples.Tutorial
|
||||||
// Draw the Depth Texture
|
// Draw the Depth Texture
|
||||||
GL.Translate(+2.2f, 0f, 0f);
|
GL.Translate(+2.2f, 0f, 0f);
|
||||||
GL.BindTexture(TextureTarget.Texture2D, DepthTexture);
|
GL.BindTexture(TextureTarget.Texture2D, DepthTexture);
|
||||||
GL.Begin(BeginMode.Quads);
|
GL.Begin(PrimitiveType.Quads);
|
||||||
{
|
{
|
||||||
GL.TexCoord2(0f, 1f);
|
GL.TexCoord2(0f, 1f);
|
||||||
GL.Vertex2(-1.0f, 1.0f);
|
GL.Vertex2(-1.0f, 1.0f);
|
||||||
|
|
|
@ -127,7 +127,7 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
private void DrawCube()
|
private void DrawCube()
|
||||||
{
|
{
|
||||||
GL.Begin(BeginMode.Quads);
|
GL.Begin(PrimitiveType.Quads);
|
||||||
|
|
||||||
GL.Color3(Color.Silver);
|
GL.Color3(Color.Silver);
|
||||||
GL.Vertex3(-1.0f, -1.0f, -1.0f);
|
GL.Vertex3(-1.0f, -1.0f, -1.0f);
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
const TextureTarget Target = TextureTarget.TextureRectangleArb;
|
const TextureTarget Target = TextureTarget.TextureRectangleArb;
|
||||||
float angle;
|
float angle;
|
||||||
BeginMode VBO_PrimMode;
|
PrimitiveType VBO_PrimMode;
|
||||||
Vertex[] VBO_Array;
|
Vertex[] VBO_Array;
|
||||||
uint VBO_Handle;
|
uint VBO_Handle;
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ namespace Examples.Tutorial
|
||||||
protected override void OnRenderFrame(FrameEventArgs e)
|
protected override void OnRenderFrame(FrameEventArgs e)
|
||||||
{
|
{
|
||||||
GL.Color3(Color.White);
|
GL.Color3(Color.White);
|
||||||
GL.EnableClientState(EnableCap.ColorArray);
|
GL.EnableClientState(ArrayCap.ColorArray);
|
||||||
|
|
||||||
#region Pass 1: Draw Object and pick Triangle
|
#region Pass 1: Draw Object and pick Triangle
|
||||||
GL.ClearColor(1f, 1f, 1f, 1f); // clears to uint.MaxValue
|
GL.ClearColor(1f, 1f, 1f, 1f); // clears to uint.MaxValue
|
||||||
|
@ -261,7 +261,7 @@ namespace Examples.Tutorial
|
||||||
#endregion Pass 1: Draw Object and pick Triangle
|
#endregion Pass 1: Draw Object and pick Triangle
|
||||||
|
|
||||||
GL.Color3(Color.White);
|
GL.Color3(Color.White);
|
||||||
GL.DisableClientState(EnableCap.ColorArray);
|
GL.DisableClientState(ArrayCap.ColorArray);
|
||||||
|
|
||||||
#region Pass 2: Draw Shape
|
#region Pass 2: Draw Shape
|
||||||
if (SelectedTriangle == uint.MaxValue)
|
if (SelectedTriangle == uint.MaxValue)
|
||||||
|
|
|
@ -145,7 +145,7 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
#region Invert Operand B's Normals
|
#region Invert Operand B's Normals
|
||||||
// only the inside of the operand is ever drawn to color buffers and lighting requires this.
|
// only the inside of the operand is ever drawn to color buffers and lighting requires this.
|
||||||
BeginMode tempPrimMode;
|
PrimitiveType tempPrimMode;
|
||||||
VertexT2dN3dV3d[] tempVertices;
|
VertexT2dN3dV3d[] tempVertices;
|
||||||
uint[] tempIndices;
|
uint[] tempIndices;
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,7 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
GL.Enable(EnableCap.Texture2D);
|
GL.Enable(EnableCap.Texture2D);
|
||||||
GL.BindTexture(TextureTarget.Texture2D, renderer.Texture);
|
GL.BindTexture(TextureTarget.Texture2D, renderer.Texture);
|
||||||
GL.Begin(BeginMode.Quads);
|
GL.Begin(PrimitiveType.Quads);
|
||||||
|
|
||||||
GL.TexCoord2(0.0f, 1.0f); GL.Vertex2(-1f, -1f);
|
GL.TexCoord2(0.0f, 1.0f); GL.Vertex2(-1f, -1f);
|
||||||
GL.TexCoord2(1.0f, 1.0f); GL.Vertex2(1f, -1f);
|
GL.TexCoord2(1.0f, 1.0f); GL.Vertex2(1f, -1f);
|
||||||
|
|
|
@ -45,7 +45,7 @@ namespace Examples.Tutorial
|
||||||
const int slices = 32;
|
const int slices = 32;
|
||||||
const float distance = 0.25f;
|
const float distance = 0.25f;
|
||||||
|
|
||||||
GL.Begin(BeginMode.Quads);
|
GL.Begin(PrimitiveType.Quads);
|
||||||
|
|
||||||
for (float scale = 0.26f; scale < 5f; scale += distance)
|
for (float scale = 0.26f; scale < 5f; scale += distance)
|
||||||
for (int i = 0; i < slices; i++)
|
for (int i = 0; i < slices; i++)
|
||||||
|
|
|
@ -114,7 +114,7 @@ namespace Examples.Tutorial
|
||||||
GL.LoadIdentity();
|
GL.LoadIdentity();
|
||||||
GL.BindTexture(TextureTarget.Texture2D, texture);
|
GL.BindTexture(TextureTarget.Texture2D, texture);
|
||||||
|
|
||||||
GL.Begin(BeginMode.Quads);
|
GL.Begin(PrimitiveType.Quads);
|
||||||
|
|
||||||
GL.TexCoord2(0.0f, 1.0f); GL.Vertex2(-0.6f, -0.4f);
|
GL.TexCoord2(0.0f, 1.0f); GL.Vertex2(-0.6f, -0.4f);
|
||||||
GL.TexCoord2(1.0f, 1.0f); GL.Vertex2(0.6f, -0.4f);
|
GL.TexCoord2(1.0f, 1.0f); GL.Vertex2(0.6f, -0.4f);
|
||||||
|
|
|
@ -185,7 +185,7 @@ namespace Examples.Tutorial
|
||||||
// Fill newly allocated buffer
|
// Fill newly allocated buffer
|
||||||
GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(VertexC4ubV3f.SizeInBytes * MaxParticleCount), VBO, BufferUsageHint.StreamDraw);
|
GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(VertexC4ubV3f.SizeInBytes * MaxParticleCount), VBO, BufferUsageHint.StreamDraw);
|
||||||
// Only draw particles that are alive
|
// Only draw particles that are alive
|
||||||
GL.DrawArrays(BeginMode.Points, MaxParticleCount - VisibleParticleCount, VisibleParticleCount);
|
GL.DrawArrays(PrimitiveType.Points, MaxParticleCount - VisibleParticleCount, VisibleParticleCount);
|
||||||
|
|
||||||
GL.PopMatrix();
|
GL.PopMatrix();
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ namespace Examples.Tutorial
|
||||||
GL.VertexPointer(3, VertexPointerType.Float, BlittableValueType.StrideOf(CubeVertices), new IntPtr(0));
|
GL.VertexPointer(3, VertexPointerType.Float, BlittableValueType.StrideOf(CubeVertices), new IntPtr(0));
|
||||||
GL.ColorPointer(4, ColorPointerType.UnsignedByte, BlittableValueType.StrideOf(CubeVertices), new IntPtr(12));
|
GL.ColorPointer(4, ColorPointerType.UnsignedByte, BlittableValueType.StrideOf(CubeVertices), new IntPtr(12));
|
||||||
|
|
||||||
GL.DrawElements(BeginMode.Triangles, handle.NumElements, DrawElementsType.UnsignedShort, IntPtr.Zero);
|
GL.DrawElements(PrimitiveType.Triangles, handle.NumElements, DrawElementsType.UnsignedShort, IntPtr.Zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -153,7 +153,7 @@ namespace Examples.Tutorial
|
||||||
angle -= 360.0f;
|
angle -= 360.0f;
|
||||||
GL.Rotate(angle, 0.0f, 1.0f, 0.0f);
|
GL.Rotate(angle, 0.0f, 1.0f, 0.0f);
|
||||||
|
|
||||||
GL.DrawElements(BeginMode.Triangles, shape.Indices.Length,
|
GL.DrawElements(PrimitiveType.Triangles, shape.Indices.Length,
|
||||||
DrawElementsType.UnsignedInt, shape.Indices);
|
DrawElementsType.UnsignedInt, shape.Indices);
|
||||||
|
|
||||||
//GL.Begin(GL.Enums.BeginMode.TRIANGLES);
|
//GL.Begin(GL.Enums.BeginMode.TRIANGLES);
|
||||||
|
|
|
@ -143,7 +143,7 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
GL.Rotate(x_angle, 0.0f, 1.0f, 0.0f);
|
GL.Rotate(x_angle, 0.0f, 1.0f, 0.0f);
|
||||||
|
|
||||||
GL.Begin(BeginMode.Triangles);
|
GL.Begin(PrimitiveType.Triangles);
|
||||||
foreach (int index in shape.Indices)
|
foreach (int index in shape.Indices)
|
||||||
{
|
{
|
||||||
GL.Normal3(shape.Normals[index]);
|
GL.Normal3(shape.Normals[index]);
|
||||||
|
|
|
@ -130,7 +130,7 @@ namespace Examples.Tutorial
|
||||||
GL.DeleteShader( FragmentShaderObject );
|
GL.DeleteShader( FragmentShaderObject );
|
||||||
|
|
||||||
int[] temp = new int[1];
|
int[] temp = new int[1];
|
||||||
GL.GetProgram( ProgramObject, ProgramParameter.LinkStatus, out temp[0] );
|
GL.GetProgram(ProgramObject, GetProgramParameterName.LinkStatus, out temp[0]);
|
||||||
Trace.WriteLine( "Linking Program (" + ProgramObject + ") " + ( ( temp[0] == 1 ) ? "succeeded." : "FAILED!" ) );
|
Trace.WriteLine( "Linking Program (" + ProgramObject + ") " + ( ( temp[0] == 1 ) ? "succeeded." : "FAILED!" ) );
|
||||||
if ( temp[0] != 1 )
|
if ( temp[0] != 1 )
|
||||||
{
|
{
|
||||||
|
@ -138,7 +138,7 @@ namespace Examples.Tutorial
|
||||||
Trace.WriteLine( "Program Log:\n" + LogInfo );
|
Trace.WriteLine( "Program Log:\n" + LogInfo );
|
||||||
}
|
}
|
||||||
|
|
||||||
GL.GetProgram( ProgramObject, ProgramParameter.ActiveAttributes, out temp[0] );
|
GL.GetProgram(ProgramObject, GetProgramParameterName.ActiveAttributes, out temp[0]);
|
||||||
Trace.WriteLine( "Program registered " + temp[0] + " Attributes. (Should be 4: Pos, UV, Normal, Tangent)" );
|
Trace.WriteLine( "Program registered " + temp[0] + " Attributes. (Should be 4: Pos, UV, Normal, Tangent)" );
|
||||||
|
|
||||||
Trace.WriteLine( "Tangent attribute bind location: " + GL.GetAttribLocation( ProgramObject, "AttributeTangent" ) );
|
Trace.WriteLine( "Tangent attribute bind location: " + GL.GetAttribLocation( ProgramObject, "AttributeTangent" ) );
|
||||||
|
|
|
@ -107,15 +107,15 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
// Set the input type of the primitives we are going to feed the geometry shader, this should be the same as
|
// Set the input type of the primitives we are going to feed the geometry shader, this should be the same as
|
||||||
// the primitive type given to GL.Begin. If the types do not match a GL error will occur (todo: verify GL_INVALID_ENUM, on glBegin)
|
// the primitive type given to GL.Begin. If the types do not match a GL error will occur (todo: verify GL_INVALID_ENUM, on glBegin)
|
||||||
GL.Ext.ProgramParameter(shaderProgram, ExtGeometryShader4.GeometryInputTypeExt, (int)BeginMode.Lines);
|
GL.Ext.ProgramParameter(shaderProgram, AssemblyProgramParameterArb.GeometryInputType, (int)BeginMode.Lines);
|
||||||
// Set the output type of the geometry shader. Becasue we input Lines we will output LineStrip(s).
|
// Set the output type of the geometry shader. Becasue we input Lines we will output LineStrip(s).
|
||||||
GL.Ext.ProgramParameter(shaderProgram, ExtGeometryShader4.GeometryOutputTypeExt, (int)BeginMode.LineStrip);
|
GL.Ext.ProgramParameter(shaderProgram, AssemblyProgramParameterArb.GeometryOutputType, (int)BeginMode.LineStrip);
|
||||||
|
|
||||||
// We must tell the shader program how much vertices the geometry shader will output (at most).
|
// We must tell the shader program how much vertices the geometry shader will output (at most).
|
||||||
// One simple way is to query the maximum and use that.
|
// One simple way is to query the maximum and use that.
|
||||||
// NOTE: Make sure that the number of vertices * sum(components of active varyings) does not
|
// NOTE: Make sure that the number of vertices * sum(components of active varyings) does not
|
||||||
// exceed MaxGeometryTotalOutputComponents.
|
// exceed MaxGeometryTotalOutputComponents.
|
||||||
GL.Ext.ProgramParameter(shaderProgram, ExtGeometryShader4.GeometryVerticesOutExt, 50);
|
GL.Ext.ProgramParameter(shaderProgram, AssemblyProgramParameterArb.GeometryVerticesOut, 50);
|
||||||
|
|
||||||
// NOTE: calls to ProgramParameter do not take effect until you call LinkProgram.
|
// NOTE: calls to ProgramParameter do not take effect until you call LinkProgram.
|
||||||
GL.LinkProgram(shaderProgram);
|
GL.LinkProgram(shaderProgram);
|
||||||
|
@ -211,7 +211,7 @@ namespace Examples.Tutorial
|
||||||
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
||||||
|
|
||||||
// draw two vertical lines
|
// draw two vertical lines
|
||||||
GL.Begin(BeginMode.Lines);
|
GL.Begin(PrimitiveType.Lines);
|
||||||
{
|
{
|
||||||
// line one
|
// line one
|
||||||
GL.Vertex2(-0.5f, -0.5f);
|
GL.Vertex2(-0.5f, -0.5f);
|
||||||
|
|
|
@ -352,10 +352,10 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
int tmp;
|
int tmp;
|
||||||
GL.GetInteger((GetPName)ExtGeometryShader4.MaxGeometryOutputVerticesExt, out tmp);
|
GL.GetInteger((GetPName)ExtGeometryShader4.MaxGeometryOutputVerticesExt, out tmp);
|
||||||
GL.Ext.ProgramParameter(shaderProgramCubemap, ExtGeometryShader4.GeometryVerticesOutExt, 18);
|
GL.Ext.ProgramParameter(shaderProgramCubemap, AssemblyProgramParameterArb.GeometryVerticesOut, 18);
|
||||||
|
|
||||||
GL.Ext.ProgramParameter(shaderProgramCubemap, ExtGeometryShader4.GeometryInputTypeExt, (int)All.Triangles);
|
GL.Ext.ProgramParameter(shaderProgramCubemap, AssemblyProgramParameterArb.GeometryInputType, (int)All.Triangles);
|
||||||
GL.Ext.ProgramParameter(shaderProgramCubemap, ExtGeometryShader4.GeometryOutputTypeExt, (int)All.TriangleStrip);
|
GL.Ext.ProgramParameter(shaderProgramCubemap, AssemblyProgramParameterArb.GeometryOutputType, (int)All.TriangleStrip);
|
||||||
|
|
||||||
// attach shaders and link the program.
|
// attach shaders and link the program.
|
||||||
GL.AttachShader(shaderProgramCubemap, frag);
|
GL.AttachShader(shaderProgramCubemap, frag);
|
||||||
|
@ -623,7 +623,7 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
GL.PushMatrix();
|
GL.PushMatrix();
|
||||||
GL.LoadIdentity();
|
GL.LoadIdentity();
|
||||||
GL.Begin(BeginMode.Quads);
|
GL.Begin(PrimitiveType.Quads);
|
||||||
|
|
||||||
// 0 -x
|
// 0 -x
|
||||||
GL.TexCoord3(-1.0f, +1.0f, -1.0f);
|
GL.TexCoord3(-1.0f, +1.0f, -1.0f);
|
||||||
|
@ -705,7 +705,7 @@ namespace Examples.Tutorial
|
||||||
GL.TexCoordPointer(2, TexCoordPointerType.Float, vboCubeStride, new IntPtr(Vector3.SizeInBytes + Vector3.SizeInBytes));
|
GL.TexCoordPointer(2, TexCoordPointerType.Float, vboCubeStride, new IntPtr(Vector3.SizeInBytes + Vector3.SizeInBytes));
|
||||||
|
|
||||||
//GL.Arb.DrawArraysInstanced(BeginMode.Triangles, 0, cubeData.Length/8, 1);
|
//GL.Arb.DrawArraysInstanced(BeginMode.Triangles, 0, cubeData.Length/8, 1);
|
||||||
GL.DrawArrays(BeginMode.Triangles, 0, cubeData.Length / (vboCubeStride / sizeof(float)));
|
GL.DrawArrays(PrimitiveType.Triangles, 0, cubeData.Length / (vboCubeStride / sizeof(float)));
|
||||||
|
|
||||||
GL.DisableClientState(ArrayCap.VertexArray);
|
GL.DisableClientState(ArrayCap.VertexArray);
|
||||||
GL.DisableClientState(ArrayCap.NormalArray);
|
GL.DisableClientState(ArrayCap.NormalArray);
|
||||||
|
@ -725,7 +725,7 @@ namespace Examples.Tutorial
|
||||||
GL.TexCoordPointer(2, TexCoordPointerType.Float, vboSphereStride, new IntPtr(Vector3.SizeInBytes + Vector3.SizeInBytes));
|
GL.TexCoordPointer(2, TexCoordPointerType.Float, vboSphereStride, new IntPtr(Vector3.SizeInBytes + Vector3.SizeInBytes));
|
||||||
|
|
||||||
GL.BindBuffer(BufferTarget.ElementArrayBuffer, eboSphere);
|
GL.BindBuffer(BufferTarget.ElementArrayBuffer, eboSphere);
|
||||||
GL.DrawElements(BeginMode.Triangles, 16 * 16 * 6, DrawElementsType.UnsignedShort, IntPtr.Zero);
|
GL.DrawElements(PrimitiveType.Triangles, 16 * 16 * 6, DrawElementsType.UnsignedShort, IntPtr.Zero);
|
||||||
|
|
||||||
//GL.Arb.DrawArraysInstanced(BeginMode.Triangles, 0, cubeData.Length/8, 1);
|
//GL.Arb.DrawArraysInstanced(BeginMode.Triangles, 0, cubeData.Length/8, 1);
|
||||||
//GL.DrawArrays(BeginMode.Triangles, 0, sphereData.Length / (vboSphereStride / sizeof(float)));
|
//GL.DrawArrays(BeginMode.Triangles, 0, sphereData.Length / (vboSphereStride / sizeof(float)));
|
||||||
|
@ -758,7 +758,7 @@ namespace Examples.Tutorial
|
||||||
// Create 6 ModelViewProjection matrices, one to look in each direction
|
// Create 6 ModelViewProjection matrices, one to look in each direction
|
||||||
// proj with 90 degrees (1/2 pi) fov
|
// proj with 90 degrees (1/2 pi) fov
|
||||||
// translate negative to place cam insize sphere
|
// translate negative to place cam insize sphere
|
||||||
Matrix4 model = Matrix4.Scale(-1) * Matrix4.CreateTranslation(spherePos);
|
Matrix4 model = Matrix4.CreateScale(-1) * Matrix4.CreateTranslation(spherePos);
|
||||||
Matrix4 proj = Matrix4.CreatePerspectiveFieldOfView(MathHelper.PiOver2, 1, 0.1f, 100f);
|
Matrix4 proj = Matrix4.CreatePerspectiveFieldOfView(MathHelper.PiOver2, 1, 0.1f, 100f);
|
||||||
|
|
||||||
Matrix4[] m = new Matrix4[6];
|
Matrix4[] m = new Matrix4[6];
|
||||||
|
|
|
@ -158,11 +158,11 @@ namespace Examples.Tutorial
|
||||||
}
|
}
|
||||||
#endregion Textures
|
#endregion Textures
|
||||||
|
|
||||||
Keyboard.KeyUp += KeyUp;
|
Keyboard.KeyUp += Keyboard_KeyUp;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
void KeyUp(object sender, KeyboardKeyEventArgs e)
|
void Keyboard_KeyUp(object sender, KeyboardKeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Key == Key.F12)
|
if (e.Key == Key.F12)
|
||||||
{
|
{
|
||||||
|
@ -272,7 +272,7 @@ namespace Examples.Tutorial
|
||||||
GL.Uniform1(GL.GetUniformLocation(ProgramObject, "OFFSETY"), UniformOffsetY);
|
GL.Uniform1(GL.GetUniformLocation(ProgramObject, "OFFSETY"), UniformOffsetY);
|
||||||
|
|
||||||
// Fullscreen quad. Using immediate mode, since this app is fragment shader limited anyways.
|
// Fullscreen quad. Using immediate mode, since this app is fragment shader limited anyways.
|
||||||
GL.Begin(BeginMode.Quads);
|
GL.Begin(PrimitiveType.Quads);
|
||||||
{
|
{
|
||||||
GL.Vertex2(-1.0f, -1.0f);
|
GL.Vertex2(-1.0f, -1.0f);
|
||||||
GL.Vertex2(1.0f, -1.0f);
|
GL.Vertex2(1.0f, -1.0f);
|
||||||
|
|
|
@ -252,7 +252,7 @@ namespace Examples.Tutorial
|
||||||
GL.ColorPointer(4, ColorPointerType.UnsignedByte, 0, IntPtr.Zero);
|
GL.ColorPointer(4, ColorPointerType.UnsignedByte, 0, IntPtr.Zero);
|
||||||
GL.BindBuffer(BufferTarget.ElementArrayBuffer, element_buffer_object);
|
GL.BindBuffer(BufferTarget.ElementArrayBuffer, element_buffer_object);
|
||||||
|
|
||||||
GL.DrawElements(BeginMode.Triangles, shape.Indices.Length,
|
GL.DrawElements(PrimitiveType.Triangles, shape.Indices.Length,
|
||||||
DrawElementsType.UnsignedInt, IntPtr.Zero);
|
DrawElementsType.UnsignedInt, IntPtr.Zero);
|
||||||
|
|
||||||
//GL.DrawArrays(GL.Enums.BeginMode.POINTS, 0, shape.Vertices.Length);
|
//GL.DrawArrays(GL.Enums.BeginMode.POINTS, 0, shape.Vertices.Length);
|
||||||
|
|
|
@ -161,7 +161,7 @@ namespace Examples.Tutorial
|
||||||
GL.DeleteShader( VertexShaderObject );
|
GL.DeleteShader( VertexShaderObject );
|
||||||
GL.DeleteShader( FragmentShaderObject );
|
GL.DeleteShader( FragmentShaderObject );
|
||||||
|
|
||||||
GL.GetProgram( ProgramObject, ProgramParameter.LinkStatus, out temp[0] );
|
GL.GetProgram(ProgramObject, GetProgramParameterName.LinkStatus, out temp[0]);
|
||||||
Trace.WriteLine( "Linking Program (" + ProgramObject + ") " + ( ( temp[0] == 1 ) ? "succeeded." : "FAILED!" ) );
|
Trace.WriteLine( "Linking Program (" + ProgramObject + ") " + ( ( temp[0] == 1 ) ? "succeeded." : "FAILED!" ) );
|
||||||
if ( temp[0] != 1 )
|
if ( temp[0] != 1 )
|
||||||
{
|
{
|
||||||
|
@ -169,7 +169,7 @@ namespace Examples.Tutorial
|
||||||
Trace.WriteLine( "Program Log:\n" + LogInfo );
|
Trace.WriteLine( "Program Log:\n" + LogInfo );
|
||||||
}
|
}
|
||||||
|
|
||||||
GL.GetProgram( ProgramObject, ProgramParameter.ActiveAttributes, out temp[0] );
|
GL.GetProgram(ProgramObject, GetProgramParameterName.ActiveAttributes, out temp[0]);
|
||||||
Trace.WriteLine( "Program registered " + temp[0] + " Attributes. (Should be 4: Pos, UV, Normal, Tangent)" );
|
Trace.WriteLine( "Program registered " + temp[0] + " Attributes. (Should be 4: Pos, UV, Normal, Tangent)" );
|
||||||
|
|
||||||
Trace.WriteLine( "Tangent attribute bind location: " + GL.GetAttribLocation( ProgramObject, "AttributeTangent" ) );
|
Trace.WriteLine( "Tangent attribute bind location: " + GL.GetAttribLocation( ProgramObject, "AttributeTangent" ) );
|
||||||
|
@ -315,7 +315,7 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
GL.Color3( 1f, 1f, 1f );
|
GL.Color3( 1f, 1f, 1f );
|
||||||
|
|
||||||
GL.Begin( BeginMode.Quads );
|
GL.Begin(PrimitiveType.Quads);
|
||||||
{
|
{
|
||||||
GL.Normal3( Normal );
|
GL.Normal3( Normal );
|
||||||
GL.VertexAttrib3( AttribTangent, ref Tangent );
|
GL.VertexAttrib3( AttribTangent, ref Tangent );
|
||||||
|
@ -344,7 +344,7 @@ namespace Examples.Tutorial
|
||||||
GL.UseProgram( 0 );
|
GL.UseProgram( 0 );
|
||||||
|
|
||||||
// visualize the light position 'somehow'
|
// visualize the light position 'somehow'
|
||||||
GL.Begin( BeginMode.Points );
|
GL.Begin(PrimitiveType.Points);
|
||||||
{
|
{
|
||||||
GL.Color3( LightSpecular );
|
GL.Color3( LightSpecular );
|
||||||
GL.Vertex3( LightPosition );
|
GL.Vertex3( LightPosition );
|
||||||
|
|
|
@ -160,7 +160,7 @@ namespace Examples.WinForms
|
||||||
|
|
||||||
private void DrawCube()
|
private void DrawCube()
|
||||||
{
|
{
|
||||||
GL.Begin(BeginMode.Quads);
|
GL.Begin(PrimitiveType.Quads);
|
||||||
|
|
||||||
GL.Color3(Color.Silver);
|
GL.Color3(Color.Silver);
|
||||||
GL.Vertex3(-1.0f, -1.0f, -1.0f);
|
GL.Vertex3(-1.0f, -1.0f, -1.0f);
|
||||||
|
|
|
@ -99,7 +99,7 @@ namespace Examples
|
||||||
{
|
{
|
||||||
GL.Clear(ClearBufferMask.ColorBufferBit);
|
GL.Clear(ClearBufferMask.ColorBufferBit);
|
||||||
|
|
||||||
GL.Begin(BeginMode.Triangles);
|
GL.Begin(PrimitiveType.Triangles);
|
||||||
|
|
||||||
GL.Color3(Color.MidnightBlue);
|
GL.Color3(Color.MidnightBlue);
|
||||||
GL.Vertex2(-1.0f, 1.0f);
|
GL.Vertex2(-1.0f, 1.0f);
|
||||||
|
|
|
@ -98,7 +98,7 @@ namespace Examples.Tutorial
|
||||||
{
|
{
|
||||||
GL.Clear(ClearBufferMask.ColorBufferBit);
|
GL.Clear(ClearBufferMask.ColorBufferBit);
|
||||||
|
|
||||||
GL.Begin(BeginMode.Triangles);
|
GL.Begin(PrimitiveType.Triangles);
|
||||||
|
|
||||||
GL.Color3(Color.MidnightBlue);
|
GL.Color3(Color.MidnightBlue);
|
||||||
GL.Vertex2(-1.0f, 1.0f);
|
GL.Vertex2(-1.0f, 1.0f);
|
||||||
|
|
|
@ -287,7 +287,7 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
||||||
|
|
||||||
GL.Begin(BeginMode.Points);
|
GL.Begin(PrimitiveType.Points);
|
||||||
foreach (Particle p in Particles)
|
foreach (Particle p in Particles)
|
||||||
{
|
{
|
||||||
GL.Color4(p.Color);
|
GL.Color4(p.Color);
|
||||||
|
|
|
@ -218,7 +218,7 @@ void main(void)
|
||||||
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
||||||
|
|
||||||
GL.BindVertexArray(vaoHandle);
|
GL.BindVertexArray(vaoHandle);
|
||||||
GL.DrawElements(BeginMode.Triangles, indicesVboData.Length,
|
GL.DrawElements(PrimitiveType.Triangles, indicesVboData.Length,
|
||||||
DrawElementsType.UnsignedInt, IntPtr.Zero);
|
DrawElementsType.UnsignedInt, IntPtr.Zero);
|
||||||
|
|
||||||
SwapBuffers();
|
SwapBuffers();
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace Examples.Shapes
|
||||||
|
|
||||||
public abstract class DrawableShape: IDisposable
|
public abstract class DrawableShape: IDisposable
|
||||||
{
|
{
|
||||||
protected BeginMode PrimitiveMode;
|
protected PrimitiveType PrimitiveMode;
|
||||||
protected VertexT2dN3dV3d[] VertexArray;
|
protected VertexT2dN3dV3d[] VertexArray;
|
||||||
protected uint[] IndexArray;
|
protected uint[] IndexArray;
|
||||||
|
|
||||||
|
@ -31,8 +31,8 @@ namespace Examples.Shapes
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
switch ( PrimitiveMode )
|
switch ( PrimitiveMode )
|
||||||
{
|
{
|
||||||
case BeginMode.Triangles:
|
case PrimitiveType.Triangles:
|
||||||
if ( IndexArray != null )
|
if ( IndexArray != null )
|
||||||
{
|
{
|
||||||
return IndexArray.Length / 3;
|
return IndexArray.Length / 3;
|
||||||
|
@ -56,14 +56,14 @@ namespace Examples.Shapes
|
||||||
public DrawableShape( bool useDisplayList )
|
public DrawableShape( bool useDisplayList )
|
||||||
{
|
{
|
||||||
UseDisplayList = useDisplayList;
|
UseDisplayList = useDisplayList;
|
||||||
PrimitiveMode = BeginMode.Triangles;
|
PrimitiveMode = PrimitiveType.Triangles;
|
||||||
VertexArray = null;
|
VertexArray = null;
|
||||||
IndexArray = null;
|
IndexArray = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Convert to VBO
|
#region Convert to VBO
|
||||||
|
|
||||||
public void GetArraysforVBO(out BeginMode primitives, out VertexT2dN3dV3d[] vertices, out uint[] indices)
|
public void GetArraysforVBO(out PrimitiveType primitives, out VertexT2dN3dV3d[] vertices, out uint[] indices)
|
||||||
{
|
{
|
||||||
primitives = PrimitiveMode;
|
primitives = PrimitiveMode;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ namespace Examples.Shapes
|
||||||
indices = IndexArray;
|
indices = IndexArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetArraysforVBO(out BeginMode primitives, out VertexT2fN3fV3f[] vertices, out uint[] indices)
|
public void GetArraysforVBO(out PrimitiveType primitives, out VertexT2fN3fV3f[] vertices, out uint[] indices)
|
||||||
{
|
{
|
||||||
primitives = PrimitiveMode;
|
primitives = PrimitiveMode;
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ namespace Examples.Shapes
|
||||||
indices = IndexArray;
|
indices = IndexArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetArraysforVBO(out BeginMode primitives, out VertexT2hN3hV3h[] vertices, out uint[] indices)
|
public void GetArraysforVBO(out PrimitiveType primitives, out VertexT2hN3hV3h[] vertices, out uint[] indices)
|
||||||
{
|
{
|
||||||
primitives = PrimitiveMode;
|
primitives = PrimitiveMode;
|
||||||
|
|
||||||
|
|
|
@ -46,9 +46,9 @@ namespace Examples.Shapes
|
||||||
HoseSubDivs = 15;
|
HoseSubDivs = 15;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
PrimitiveMode = OpenTK.Graphics.OpenGL.BeginMode.Triangles;
|
PrimitiveMode = OpenTK.Graphics.OpenGL.PrimitiveType.Triangles;
|
||||||
|
|
||||||
OpenTK.Graphics.OpenGL.BeginMode TemporaryMode;
|
OpenTK.Graphics.OpenGL.PrimitiveType TemporaryMode;
|
||||||
VertexT2dN3dV3d[] TemporaryVBO;
|
VertexT2dN3dV3d[] TemporaryVBO;
|
||||||
uint[] TemporaryIBO;
|
uint[] TemporaryIBO;
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace Examples.Shapes
|
||||||
#region Temporary Storage
|
#region Temporary Storage
|
||||||
|
|
||||||
List<Chunk> AllChunks = new List<Chunk>();
|
List<Chunk> AllChunks = new List<Chunk>();
|
||||||
OpenTK.Graphics.OpenGL.BeginMode TemporaryMode;
|
OpenTK.Graphics.OpenGL.PrimitiveType TemporaryMode;
|
||||||
VertexT2dN3dV3d[] TemporaryVBO;
|
VertexT2dN3dV3d[] TemporaryVBO;
|
||||||
uint[] TemporaryIBO;
|
uint[] TemporaryIBO;
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ namespace Examples.Shapes
|
||||||
#endregion 6 quads for the sides
|
#endregion 6 quads for the sides
|
||||||
|
|
||||||
#region Final Assembly of Chunks
|
#region Final Assembly of Chunks
|
||||||
PrimitiveMode = OpenTK.Graphics.OpenGL.BeginMode.Triangles;
|
PrimitiveMode = OpenTK.Graphics.OpenGL.PrimitiveType.Triangles;
|
||||||
Chunk.GetArray( ref AllChunks, out VertexArray, out IndexArray );
|
Chunk.GetArray( ref AllChunks, out VertexArray, out IndexArray );
|
||||||
AllChunks.Clear();
|
AllChunks.Clear();
|
||||||
#endregion Final Assembly of Chunks
|
#endregion Final Assembly of Chunks
|
||||||
|
|
|
@ -6,7 +6,7 @@ namespace Examples.Shapes
|
||||||
{
|
{
|
||||||
public sealed class VboShape: DrawableShape
|
public sealed class VboShape: DrawableShape
|
||||||
{
|
{
|
||||||
public VboShape( ref OpenTK.Graphics.OpenGL.BeginMode primitives, ref VertexT2dN3dV3d[] vertices, ref uint[] indices, bool useDL )
|
public VboShape(ref OpenTK.Graphics.OpenGL.PrimitiveType primitives, ref VertexT2dN3dV3d[] vertices, ref uint[] indices, bool useDL)
|
||||||
: base( useDL )
|
: base( useDL )
|
||||||
{
|
{
|
||||||
PrimitiveMode = primitives;
|
PrimitiveMode = primitives;
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace Examples.Shapes
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PrimitiveMode = OpenTK.Graphics.OpenGL.BeginMode.Triangles;
|
PrimitiveMode = OpenTK.Graphics.OpenGL.PrimitiveType.Triangles;
|
||||||
SierpinskiTetrahedron.GetVertexArray( ref Triangles, out VertexArray );
|
SierpinskiTetrahedron.GetVertexArray( ref Triangles, out VertexArray );
|
||||||
IndexArray = null;
|
IndexArray = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace Examples.Shapes
|
||||||
default: throw new ArgumentOutOfRangeException( "Subdivisions other than contained in the enum cause overflows and are not allowed." );
|
default: throw new ArgumentOutOfRangeException( "Subdivisions other than contained in the enum cause overflows and are not allowed." );
|
||||||
}
|
}
|
||||||
|
|
||||||
PrimitiveMode = OpenTK.Graphics.OpenGL.BeginMode.Triangles;
|
PrimitiveMode = OpenTK.Graphics.OpenGL.PrimitiveType.Triangles;
|
||||||
|
|
||||||
#region Get Array Dimensions
|
#region Get Array Dimensions
|
||||||
uint
|
uint
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace Examples.Shapes
|
||||||
default: throw new ArgumentOutOfRangeException( "Subdivisions other than contained in the enum cause overflows and are not allowed." );
|
default: throw new ArgumentOutOfRangeException( "Subdivisions other than contained in the enum cause overflows and are not allowed." );
|
||||||
}
|
}
|
||||||
|
|
||||||
PrimitiveMode = OpenTK.Graphics.OpenGL.BeginMode.Triangles;
|
PrimitiveMode = OpenTK.Graphics.OpenGL.PrimitiveType.Triangles;
|
||||||
SierpinskiTetrahedron.GetVertexArray( ref Triangles, out VertexArray );
|
SierpinskiTetrahedron.GetVertexArray( ref Triangles, out VertexArray );
|
||||||
IndexArray = null;
|
IndexArray = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace Examples.Shapes
|
||||||
public SlicedHose( eSide side, uint subdivs, double scale, Vector3d offset1, Vector3d offset2, bool useDL )
|
public SlicedHose( eSide side, uint subdivs, double scale, Vector3d offset1, Vector3d offset2, bool useDL )
|
||||||
: base( useDL )
|
: base( useDL )
|
||||||
{
|
{
|
||||||
PrimitiveMode = OpenTK.Graphics.OpenGL.BeginMode.Triangles;
|
PrimitiveMode = OpenTK.Graphics.OpenGL.PrimitiveType.Triangles;
|
||||||
|
|
||||||
Vector3d start = Vector3d.Zero,
|
Vector3d start = Vector3d.Zero,
|
||||||
end = Vector3d.Zero;
|
end = Vector3d.Zero;
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace Examples.Shapes
|
||||||
{
|
{
|
||||||
double Diameter = radius;
|
double Diameter = radius;
|
||||||
|
|
||||||
PrimitiveMode = OpenTK.Graphics.OpenGL.BeginMode.Triangles;
|
PrimitiveMode = OpenTK.Graphics.OpenGL.PrimitiveType.Triangles;
|
||||||
|
|
||||||
if ( sides[0] == eDir.All )
|
if ( sides[0] == eDir.All )
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace Examples.Shapes
|
||||||
Trace.Assert( shapevertices >= MINShapeVertices, "A Shape must contain at least " + MINShapeVertices + " Vertices to be considered valid and create a volume." );
|
Trace.Assert( shapevertices >= MINShapeVertices, "A Shape must contain at least " + MINShapeVertices + " Vertices to be considered valid and create a volume." );
|
||||||
Trace.Assert( TexCount >= 1, "at least 1 Texture set is required." );
|
Trace.Assert( TexCount >= 1, "at least 1 Texture set is required." );
|
||||||
|
|
||||||
PrimitiveMode = OpenTK.Graphics.OpenGL.BeginMode.TriangleStrip;
|
PrimitiveMode = OpenTK.Graphics.OpenGL.PrimitiveType.TriangleStrip;
|
||||||
|
|
||||||
Vector3d[] PathPositions = new Vector3d[pathsteps];
|
Vector3d[] PathPositions = new Vector3d[pathsteps];
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,7 @@ namespace OpenTK
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Frees a marshalled string that allocated by <c>MarshalStringToPtr</c>.
|
/// Frees a marshalled string that allocated by <c>MarshalStringToPtr</c>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ptr">An unmanaged pointer allocated with <c>MarshalStringToPtr</param>
|
/// <param name="ptr">An unmanaged pointer allocated with <c>MarshalStringToPtr</c></param>
|
||||||
protected static void FreeStringPtr(IntPtr ptr)
|
protected static void FreeStringPtr(IntPtr ptr)
|
||||||
{
|
{
|
||||||
Marshal.FreeHGlobal(ptr);
|
Marshal.FreeHGlobal(ptr);
|
||||||
|
|
|
@ -44,7 +44,6 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
static bool runningOnWindows, runningOnUnix, runningOnX11, runningOnMacOS, runningOnLinux;
|
static bool runningOnWindows, runningOnUnix, runningOnX11, runningOnMacOS, runningOnLinux;
|
||||||
static bool runningOnMono;
|
static bool runningOnMono;
|
||||||
static bool runningOnAndroid;
|
|
||||||
volatile static bool initialized;
|
volatile static bool initialized;
|
||||||
readonly static object InitLock = new object();
|
readonly static object InitLock = new object();
|
||||||
|
|
||||||
|
|
|
@ -183,6 +183,11 @@ namespace OpenTK.Graphics
|
||||||
|
|
||||||
#region IEquatable<ColorFormat> Members
|
#region IEquatable<ColorFormat> Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Compares whether this ColorFormat structure is equal to the specified ColorFormat.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="other">The ColorFormat structure to compare to.</param>
|
||||||
|
/// <returns>True if both ColorFormat structures contain the same components; false otherwise.</returns>
|
||||||
public bool Equals(ColorFormat other)
|
public bool Equals(ColorFormat other)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
|
|
|
@ -39,7 +39,17 @@ namespace OpenTK.Graphics
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class GraphicsContext : IGraphicsContext, IGraphicsContextInternal
|
public sealed class GraphicsContext : IGraphicsContext, IGraphicsContextInternal
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Used to retrive function pointers by name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="function">The function name.</param>
|
||||||
|
/// <returns>A function pointer to <paramref name="function"/>, or <c>IntPtr.Zero</c></returns>
|
||||||
public delegate IntPtr GetAddressDelegate(string function);
|
public delegate IntPtr GetAddressDelegate(string function);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Used to return the handel of the current OpenGL context.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The current OpenGL context, or <c>IntPtr.Zero</c> if no context is on the calling thread.</returns>
|
||||||
public delegate ContextHandle GetCurrentContextDelegate();
|
public delegate ContextHandle GetCurrentContextDelegate();
|
||||||
|
|
||||||
#region --- Fields ---
|
#region --- Fields ---
|
||||||
|
@ -497,8 +507,10 @@ namespace OpenTK.Graphics
|
||||||
[Obsolete("Use SwapInterval property instead.")]
|
[Obsolete("Use SwapInterval property instead.")]
|
||||||
public bool VSync
|
public bool VSync
|
||||||
{
|
{
|
||||||
|
#pragma warning disable 0612, 0618 // CS0612/CS0618: 'member' is obsolete
|
||||||
get { return implementation.VSync; }
|
get { return implementation.VSync; }
|
||||||
set { implementation.VSync = value; }
|
set { implementation.VSync = value; }
|
||||||
|
#pragma warning restore 0612, 0618
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -646,7 +658,7 @@ namespace OpenTK.Graphics
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marks this context as deleted, but does not actually release unmanaged resources
|
/// Marks this context as deleted, but does not actually release unmanaged resources
|
||||||
/// due to the threading requirements of OpenGL. Use <see cref="GraphicsContext.Dispose"/>
|
/// due to the threading requirements of OpenGL. Use <see cref="GraphicsContext.Dispose()"/>
|
||||||
/// instead.
|
/// instead.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
~GraphicsContext()
|
~GraphicsContext()
|
||||||
|
|
|
@ -24,7 +24,6 @@ namespace OpenTK.Platform.Dummy
|
||||||
{
|
{
|
||||||
readonly GraphicsContext.GetAddressDelegate Loader;
|
readonly GraphicsContext.GetAddressDelegate Loader;
|
||||||
|
|
||||||
bool vsync;
|
|
||||||
int swap_interval;
|
int swap_interval;
|
||||||
static int handle_count;
|
static int handle_count;
|
||||||
Thread current_thread;
|
Thread current_thread;
|
||||||
|
|
|
@ -164,7 +164,6 @@ namespace OpenTK.Platform
|
||||||
{
|
{
|
||||||
#region Fields
|
#region Fields
|
||||||
|
|
||||||
bool disposed;
|
|
||||||
static readonly string error_string = "Please, refer to http://www.opentk.com for more information.";
|
static readonly string error_string = "Please, refer to http://www.opentk.com for more information.";
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -49,7 +49,6 @@ namespace OpenTK.Platform.MacOS
|
||||||
|
|
||||||
CarbonWindowInfo carbonWindow;
|
CarbonWindowInfo carbonWindow;
|
||||||
IntPtr shareContextRef;
|
IntPtr shareContextRef;
|
||||||
DisplayDevice device;
|
|
||||||
bool mIsFullscreen = false;
|
bool mIsFullscreen = false;
|
||||||
|
|
||||||
public AglContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext)
|
public AglContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext)
|
||||||
|
|
|
@ -64,8 +64,6 @@ namespace OpenTK.Platform.MacOS
|
||||||
bool mExists = true;
|
bool mExists = true;
|
||||||
DisplayDevice mDisplayDevice;
|
DisplayDevice mDisplayDevice;
|
||||||
|
|
||||||
WindowAttributes mWindowAttrib;
|
|
||||||
WindowClass mWindowClass;
|
|
||||||
WindowPositionMethod mPositionMethod = WindowPositionMethod.CenterOnMainScreen;
|
WindowPositionMethod mPositionMethod = WindowPositionMethod.CenterOnMainScreen;
|
||||||
int mTitlebarHeight;
|
int mTitlebarHeight;
|
||||||
private WindowBorder windowBorder = WindowBorder.Resizable;
|
private WindowBorder windowBorder = WindowBorder.Resizable;
|
||||||
|
|
|
@ -58,7 +58,6 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
readonly uint ModalLoopTimerPeriod = 1;
|
readonly uint ModalLoopTimerPeriod = 1;
|
||||||
UIntPtr timer_handle;
|
UIntPtr timer_handle;
|
||||||
readonly Functions.TimerProc ModalLoopCallback;
|
|
||||||
|
|
||||||
bool class_registered;
|
bool class_registered;
|
||||||
bool disposed;
|
bool disposed;
|
||||||
|
@ -716,7 +715,7 @@ namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
if (timer_handle == UIntPtr.Zero)
|
if (timer_handle == UIntPtr.Zero)
|
||||||
{
|
{
|
||||||
timer_handle = Functions.SetTimer(handle, new UIntPtr(1), ModalLoopTimerPeriod, ModalLoopCallback);
|
timer_handle = Functions.SetTimer(handle, new UIntPtr(1), ModalLoopTimerPeriod, null);
|
||||||
if (timer_handle == UIntPtr.Zero)
|
if (timer_handle == UIntPtr.Zero)
|
||||||
Debug.Print("[Warning] Failed to set modal loop timer callback ({0}:{1}->{2}).",
|
Debug.Print("[Warning] Failed to set modal loop timer callback ({0}:{1}->{2}).",
|
||||||
GetType().Name, handle, Marshal.GetLastWin32Error());
|
GetType().Name, handle, Marshal.GetLastWin32Error());
|
||||||
|
|
|
@ -144,7 +144,7 @@ namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
gamepad_driver = new XInputJoystick();
|
gamepad_driver = new XInputJoystick();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
Debug.Print("[Win] XInput driver not supported, falling back to WinMM");
|
Debug.Print("[Win] XInput driver not supported, falling back to WinMM");
|
||||||
gamepad_driver = new MappedGamePadDriver();
|
gamepad_driver = new MappedGamePadDriver();
|
||||||
|
|
|
@ -34,8 +34,6 @@ namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
class X11Factory : PlatformFactoryBase
|
class X11Factory : PlatformFactoryBase
|
||||||
{
|
{
|
||||||
bool disposed;
|
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
public X11Factory()
|
public X11Factory()
|
||||||
|
|
Loading…
Reference in a new issue