mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 05:15:32 +00:00
This commit is contained in:
parent
fdd693a4f1
commit
cd32a6db54
BIN
Build/Prebuild.exe
Normal file
BIN
Build/Prebuild.exe
Normal file
Binary file not shown.
4
Build/VS2005.bat
Normal file
4
Build/VS2005.bat
Normal file
|
@ -0,0 +1,4 @@
|
|||
@rem Generates a solution (.sln) and a set of project files (.csproj, .vbproj, etc.)
|
||||
@rem for Microsoft Visual Studio .NET 2005
|
||||
cd ..
|
||||
Build\Prebuild.exe /target vs2005 /file prebuild.xml /pause
|
130
OpenTK.sln
130
OpenTK.sln
|
@ -1,130 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{80BD2C66-A90B-42E7-BED8-CBF7BB8C2E3F}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
changelog.txt = changelog.txt
|
||||
license.txt = license.txt
|
||||
todo.txt = todo.txt
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Projects", "Projects", "{E9FF51BB-295E-4891-AA30-D1374F26DCE0}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenTK", "OpenTK", "{7E640424-E2CD-4DD5-9392-7A706D73930E}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Platform", "Platform", "{50DCE788-72FC-47E0-A6BD-50BCCE3FCE5B}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.Platform.Windows", "Source\Platform\Windows\OpenTK.Platform.Windows.csproj", "{FDFA00B6-FA81-4658-86E1-F312EFB42E1C}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Input", "Input", "{4BB769A0-1B69-474E-A99A-B6B9BE1A3A1E}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Math", "Math", "{84EAC24B-BF87-477C-838D-7110A1A24D41}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenAL", "OpenAL", "{30996477-EDDE-4E45-AB3D-5E466314C755}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenGL", "OpenGL", "{2F3FEAD4-0FBD-48CC-AFA0-29FFF28284C2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.OpenGL", "Source\OpenGL\OpenGL\OpenTK.OpenGL.csproj", "{836876D1-0C8D-4240-BEE4-859D9D3D46CB}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{1EDDE592-3923-4898-9006-3D69579E1745} = {1EDDE592-3923-4898-9006-3D69579E1745}
|
||||
{FDFA00B6-FA81-4658-86E1-F312EFB42E1C} = {FDFA00B6-FA81-4658-86E1-F312EFB42E1C}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.OpenGL.Bind", "Source\OpenGL\Bind\OpenTK.OpenGL.Bind.csproj", "{1EDDE592-3923-4898-9006-3D69579E1745}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{C6E60A87-12B4-444A-BE03-7E980EAC0172}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenGL", "OpenGL", "{70FA6EE8-62C6-437F-AD82-117F2D9CDE68}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GLSL.Lesson01", "Source\Examples\OpenGL\GLSL\Lesson01\GLSL.Lesson01.csproj", "{46980D11-67FA-4B33-903F-BC9D8A4FE60F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.Platform.X", "Source\Platform\X\OpenTK.Platform.X.csproj", "{E3F35BD6-67CE-4AD5-AB98-043CF072A75A}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{508EF114-8C2A-470D-89FE-5AC15B336B4C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.Framework", "Source\Framework\OpenTK.Framework.csproj", "{26B55626-4EAB-4CAE-82FE-93CD6564D9EA}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Specifications", "Specifications", "{D26F26AC-2154-4900-93EB-66E5A7761D05}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
Source\OpenGL\Specifications\csharp.tm = Source\OpenGL\Specifications\csharp.tm
|
||||
Source\OpenGL\Specifications\enum.spec = Source\OpenGL\Specifications\enum.spec
|
||||
Source\OpenGL\Specifications\enumext.spec = Source\OpenGL\Specifications\enumext.spec
|
||||
Source\OpenGL\Specifications\enumglu.spec = Source\OpenGL\Specifications\enumglu.spec
|
||||
Source\OpenGL\Specifications\gl.spec = Source\OpenGL\Specifications\gl.spec
|
||||
Source\OpenGL\Specifications\gl.tm = Source\OpenGL\Specifications\gl.tm
|
||||
Source\OpenGL\Specifications\glu.spec = Source\OpenGL\Specifications\glu.spec
|
||||
Source\OpenGL\Specifications\glx.spec = Source\OpenGL\Specifications\glx.spec
|
||||
Source\OpenGL\Specifications\glx.tm = Source\OpenGL\Specifications\glx.tm
|
||||
Source\OpenGL\Specifications\glxenum.spec = Source\OpenGL\Specifications\glxenum.spec
|
||||
Source\OpenGL\Specifications\glxenumext.spec = Source\OpenGL\Specifications\glxenumext.spec
|
||||
Source\OpenGL\Specifications\glxext.spec = Source\OpenGL\Specifications\glxext.spec
|
||||
Source\OpenGL\Specifications\wgl.spec = Source\OpenGL\Specifications\wgl.spec
|
||||
Source\OpenGL\Specifications\wgl.tm = Source\OpenGL\Specifications\wgl.tm
|
||||
Source\OpenGL\Specifications\wglenum.spec = Source\OpenGL\Specifications\wglenum.spec
|
||||
Source\OpenGL\Specifications\wglenumext.spec = Source\OpenGL\Specifications\wglenumext.spec
|
||||
Source\OpenGL\Specifications\wglext.spec = Source\OpenGL\Specifications\wglext.spec
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{91C9E74A-12CE-4770-82F4-C257CC4A4046}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GLSL.Lesson02", "Source\Examples\OpenGL\GLSL\Lesson02\GLSL.Lesson02.csproj", "{8814A9FE-F6B2-4BE1-82D5-1E9F02BD9B4B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{FDFA00B6-FA81-4658-86E1-F312EFB42E1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FDFA00B6-FA81-4658-86E1-F312EFB42E1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FDFA00B6-FA81-4658-86E1-F312EFB42E1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FDFA00B6-FA81-4658-86E1-F312EFB42E1C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{836876D1-0C8D-4240-BEE4-859D9D3D46CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{836876D1-0C8D-4240-BEE4-859D9D3D46CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{836876D1-0C8D-4240-BEE4-859D9D3D46CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{836876D1-0C8D-4240-BEE4-859D9D3D46CB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1EDDE592-3923-4898-9006-3D69579E1745}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1EDDE592-3923-4898-9006-3D69579E1745}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1EDDE592-3923-4898-9006-3D69579E1745}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1EDDE592-3923-4898-9006-3D69579E1745}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{46980D11-67FA-4B33-903F-BC9D8A4FE60F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{46980D11-67FA-4B33-903F-BC9D8A4FE60F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{46980D11-67FA-4B33-903F-BC9D8A4FE60F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{46980D11-67FA-4B33-903F-BC9D8A4FE60F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E3F35BD6-67CE-4AD5-AB98-043CF072A75A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E3F35BD6-67CE-4AD5-AB98-043CF072A75A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E3F35BD6-67CE-4AD5-AB98-043CF072A75A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E3F35BD6-67CE-4AD5-AB98-043CF072A75A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{26B55626-4EAB-4CAE-82FE-93CD6564D9EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{26B55626-4EAB-4CAE-82FE-93CD6564D9EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{26B55626-4EAB-4CAE-82FE-93CD6564D9EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{26B55626-4EAB-4CAE-82FE-93CD6564D9EA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8814A9FE-F6B2-4BE1-82D5-1E9F02BD9B4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8814A9FE-F6B2-4BE1-82D5-1E9F02BD9B4B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8814A9FE-F6B2-4BE1-82D5-1E9F02BD9B4B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8814A9FE-F6B2-4BE1-82D5-1E9F02BD9B4B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{7E640424-E2CD-4DD5-9392-7A706D73930E} = {E9FF51BB-295E-4891-AA30-D1374F26DCE0}
|
||||
{C6E60A87-12B4-444A-BE03-7E980EAC0172} = {E9FF51BB-295E-4891-AA30-D1374F26DCE0}
|
||||
{50DCE788-72FC-47E0-A6BD-50BCCE3FCE5B} = {7E640424-E2CD-4DD5-9392-7A706D73930E}
|
||||
{4BB769A0-1B69-474E-A99A-B6B9BE1A3A1E} = {7E640424-E2CD-4DD5-9392-7A706D73930E}
|
||||
{84EAC24B-BF87-477C-838D-7110A1A24D41} = {7E640424-E2CD-4DD5-9392-7A706D73930E}
|
||||
{30996477-EDDE-4E45-AB3D-5E466314C755} = {7E640424-E2CD-4DD5-9392-7A706D73930E}
|
||||
{2F3FEAD4-0FBD-48CC-AFA0-29FFF28284C2} = {7E640424-E2CD-4DD5-9392-7A706D73930E}
|
||||
{508EF114-8C2A-470D-89FE-5AC15B336B4C} = {7E640424-E2CD-4DD5-9392-7A706D73930E}
|
||||
{FDFA00B6-FA81-4658-86E1-F312EFB42E1C} = {50DCE788-72FC-47E0-A6BD-50BCCE3FCE5B}
|
||||
{E3F35BD6-67CE-4AD5-AB98-043CF072A75A} = {50DCE788-72FC-47E0-A6BD-50BCCE3FCE5B}
|
||||
{836876D1-0C8D-4240-BEE4-859D9D3D46CB} = {2F3FEAD4-0FBD-48CC-AFA0-29FFF28284C2}
|
||||
{1EDDE592-3923-4898-9006-3D69579E1745} = {2F3FEAD4-0FBD-48CC-AFA0-29FFF28284C2}
|
||||
{D26F26AC-2154-4900-93EB-66E5A7761D05} = {2F3FEAD4-0FBD-48CC-AFA0-29FFF28284C2}
|
||||
{70FA6EE8-62C6-437F-AD82-117F2D9CDE68} = {C6E60A87-12B4-444A-BE03-7E980EAC0172}
|
||||
{91C9E74A-12CE-4770-82F4-C257CC4A4046} = {C6E60A87-12B4-444A-BE03-7E980EAC0172}
|
||||
{46980D11-67FA-4B33-903F-BC9D8A4FE60F} = {70FA6EE8-62C6-437F-AD82-117F2D9CDE68}
|
||||
{8814A9FE-F6B2-4BE1-82D5-1E9F02BD9B4B} = {70FA6EE8-62C6-437F-AD82-117F2D9CDE68}
|
||||
{26B55626-4EAB-4CAE-82FE-93CD6564D9EA} = {508EF114-8C2A-470D-89FE-5AC15B336B4C}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
157
Source/Examples/OpenGL/Basic/Lesson01/Basic01.cs
Normal file
157
Source/Examples/OpenGL/Basic/Lesson01/Basic01.cs
Normal file
|
@ -0,0 +1,157 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using OpenTK.OpenGL;
|
||||
|
||||
namespace Lesson01
|
||||
{
|
||||
|
||||
public class Cube : OpenTK.Frameworks.Framework
|
||||
{
|
||||
static float angle;
|
||||
|
||||
#region Load event handler
|
||||
protected override void OnLoad(object sender, EventArgs e)
|
||||
{
|
||||
base.OnLoad(sender, e);
|
||||
|
||||
Text =
|
||||
GL.GetString(Enums.StringName.VENDOR) + " " +
|
||||
GL.GetString(Enums.StringName.RENDERER) + " " +
|
||||
GL.GetString(Enums.StringName.VERSION);
|
||||
|
||||
GL.ClearColor(0.1f, 0.1f, 0.5f, 0.0f);
|
||||
GL.Enable(Enums.EnableCap.DEPTH_TEST);
|
||||
|
||||
OnResize(this, e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Resize event handler
|
||||
protected override void OnResize(object sender, EventArgs e)
|
||||
{
|
||||
base.OnResize(sender, e);
|
||||
|
||||
// if (this.Context == null)
|
||||
// return;
|
||||
|
||||
if (ClientSize.Height == 0)
|
||||
ClientSize = new System.Drawing.Size(ClientSize.Width, 1);
|
||||
|
||||
GL.Viewport(0, 0, ClientSize.Width, ClientSize.Height);
|
||||
|
||||
double ratio = 0.0;
|
||||
ratio = ClientSize.Width / (double)ClientSize.Height;
|
||||
//if (ClientSize.Width > ClientSize.Height)
|
||||
// ratio = ClientSize.Width / (double)ClientSize.Height;
|
||||
//else
|
||||
// ratio = ClientSize.Height / (double)ClientSize.Width;
|
||||
|
||||
GL.MatrixMode(Enums.MatrixMode.PROJECTION);
|
||||
GL.LoadIdentity();
|
||||
Glu.Perspective(45.0, ratio, 1.0, 64.0);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Paint event handler
|
||||
|
||||
protected override void OnPaint()
|
||||
{
|
||||
GL.MatrixMode(Enums.MatrixMode.MODELVIEW);
|
||||
GL.LoadIdentity();
|
||||
Glu.LookAt(
|
||||
0.0, 5.0, 5.0,
|
||||
0.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0
|
||||
);
|
||||
GL.Rotatef(angle, 0.0f, 1.0f, 0.0f);
|
||||
angle += 0.5f;
|
||||
|
||||
GL.Clear(Enums.ClearBufferMask.COLOR_BUFFER_BIT | Enums.ClearBufferMask.DEPTH_BUFFER_BIT);
|
||||
|
||||
DrawCube();
|
||||
|
||||
ActiveContext.SwapBuffers();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region KeyDown event handler
|
||||
|
||||
protected override void OnKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
base.OnKeyDown(sender, e);
|
||||
|
||||
switch (e.KeyData)
|
||||
{
|
||||
case Keys.Escape:
|
||||
Application.Exit();
|
||||
break;
|
||||
|
||||
case Keys.F1:
|
||||
this.SetResolution(this.Width, this.Height, this.ColorDepth, !this.IsFullscreen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DrawCube
|
||||
public void DrawCube()
|
||||
{
|
||||
GL.Begin(Enums.BeginMode.QUADS);
|
||||
|
||||
GL.Color3f(1, 0, 0);
|
||||
GL.Vertex3f(-1.0f, -1.0f, -1.0f);
|
||||
GL.Vertex3f(-1.0f, 1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, -1.0f, -1.0f);
|
||||
|
||||
GL.Color3f(1, 1, 0);
|
||||
GL.Vertex3f(-1.0f, -1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, -1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, -1.0f, 1.0f);
|
||||
GL.Vertex3f(-1.0f, -1.0f, 1.0f);
|
||||
|
||||
GL.Color3f(1, 0, 1);
|
||||
GL.Vertex3f(-1.0f, -1.0f, -1.0f);
|
||||
GL.Vertex3f(-1.0f, -1.0f, 1.0f);
|
||||
GL.Vertex3f(-1.0f, 1.0f, 1.0f);
|
||||
GL.Vertex3f(-1.0f, 1.0f, -1.0f);
|
||||
|
||||
GL.Color3f(0, 1, 0);
|
||||
GL.Vertex3f(-1.0f, -1.0f, 1.0f);
|
||||
GL.Vertex3f(1.0f, -1.0f, 1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, 1.0f);
|
||||
GL.Vertex3f(-1.0f, 1.0f, 1.0f);
|
||||
|
||||
GL.Color3f(0, 0, 1);
|
||||
GL.Vertex3f(-1.0f, 1.0f, -1.0f);
|
||||
GL.Vertex3f(-1.0f, 1.0f, 1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, 1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, -1.0f);
|
||||
|
||||
GL.Color3f(0, 1, 1);
|
||||
GL.Vertex3f(1.0f, -1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, 1.0f);
|
||||
GL.Vertex3f(1.0f, -1.0f, 1.0f);
|
||||
|
||||
GL.End();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Entry point
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
new Cube().Run();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Lesson01")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Lesson01")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2006")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("462dc50a-1799-43d2-8e28-af3c0a13f788")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
63
Source/Examples/OpenGL/Basic/Lesson01/Properties/Resources.Designer.cs
generated
Normal file
63
Source/Examples/OpenGL/Basic/Lesson01/Properties/Resources.Designer.cs
generated
Normal file
|
@ -0,0 +1,63 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.42
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Lesson02.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Lesson02.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
117
Source/Examples/OpenGL/Basic/Lesson01/Properties/Resources.resx
Normal file
117
Source/Examples/OpenGL/Basic/Lesson01/Properties/Resources.resx
Normal file
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
26
Source/Examples/OpenGL/Basic/Lesson01/Properties/Settings.Designer.cs
generated
Normal file
26
Source/Examples/OpenGL/Basic/Lesson01/Properties/Settings.Designer.cs
generated
Normal file
|
@ -0,0 +1,26 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.42
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Lesson02.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
|
@ -0,0 +1,33 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("NoFramework")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("NoFramework")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2006")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("f54e9ba9-854c-4baf-ae19-a1bbbfe6fbf3")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
71
Source/Examples/OpenGL/Basic/NoFramework/Properties/Resources.Designer.cs
generated
Normal file
71
Source/Examples/OpenGL/Basic/NoFramework/Properties/Resources.Designer.cs
generated
Normal file
|
@ -0,0 +1,71 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.42
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NoFramework.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NoFramework.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
30
Source/Examples/OpenGL/Basic/NoFramework/Properties/Settings.Designer.cs
generated
Normal file
30
Source/Examples/OpenGL/Basic/NoFramework/Properties/Settings.Designer.cs
generated
Normal file
|
@ -0,0 +1,30 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.42
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace NoFramework.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
183
Source/Examples/OpenGL/Basic/NoFramework/QueryModesForm.Designer.cs
generated
Normal file
183
Source/Examples/OpenGL/Basic/NoFramework/QueryModesForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,183 @@
|
|||
namespace NoFramework
|
||||
{
|
||||
partial class QueryModesForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.create1 = new System.Windows.Forms.Button();
|
||||
this.dispose1 = new System.Windows.Forms.Button();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.create2 = new System.Windows.Forms.Button();
|
||||
this.dispose2 = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.panel1.Location = new System.Drawing.Point(12, 12);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(283, 131);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// timer1
|
||||
//
|
||||
this.timer1.Interval = 40;
|
||||
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.panel2.Location = new System.Drawing.Point(12, 149);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(283, 130);
|
||||
this.panel2.TabIndex = 0;
|
||||
//
|
||||
// create1
|
||||
//
|
||||
this.create1.Location = new System.Drawing.Point(6, 19);
|
||||
this.create1.Name = "create1";
|
||||
this.create1.Size = new System.Drawing.Size(63, 23);
|
||||
this.create1.TabIndex = 0;
|
||||
this.create1.Text = "Create";
|
||||
this.create1.UseVisualStyleBackColor = true;
|
||||
this.create1.Click += new System.EventHandler(this.create1_Click);
|
||||
//
|
||||
// dispose1
|
||||
//
|
||||
this.dispose1.Enabled = false;
|
||||
this.dispose1.Location = new System.Drawing.Point(6, 48);
|
||||
this.dispose1.Name = "dispose1";
|
||||
this.dispose1.Size = new System.Drawing.Size(63, 23);
|
||||
this.dispose1.TabIndex = 0;
|
||||
this.dispose1.Text = "Dispose";
|
||||
this.dispose1.UseVisualStyleBackColor = true;
|
||||
this.dispose1.Click += new System.EventHandler(this.dispose1_Click);
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox1.Controls.Add(this.create1);
|
||||
this.groupBox1.Controls.Add(this.dispose1);
|
||||
this.groupBox1.Location = new System.Drawing.Point(301, 12);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(75, 77);
|
||||
this.groupBox1.TabIndex = 1;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Context";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox2.Controls.Add(this.create2);
|
||||
this.groupBox2.Controls.Add(this.dispose2);
|
||||
this.groupBox2.Location = new System.Drawing.Point(301, 149);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(75, 77);
|
||||
this.groupBox2.TabIndex = 2;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Context";
|
||||
//
|
||||
// create2
|
||||
//
|
||||
this.create2.Location = new System.Drawing.Point(6, 19);
|
||||
this.create2.Name = "create2";
|
||||
this.create2.Size = new System.Drawing.Size(63, 23);
|
||||
this.create2.TabIndex = 0;
|
||||
this.create2.Text = "Create";
|
||||
this.create2.UseVisualStyleBackColor = true;
|
||||
this.create2.Click += new System.EventHandler(this.create2_Click);
|
||||
//
|
||||
// dispose2
|
||||
//
|
||||
this.dispose2.Enabled = false;
|
||||
this.dispose2.Location = new System.Drawing.Point(6, 48);
|
||||
this.dispose2.Name = "dispose2";
|
||||
this.dispose2.Size = new System.Drawing.Size(63, 23);
|
||||
this.dispose2.TabIndex = 0;
|
||||
this.dispose2.Text = "Dispose";
|
||||
this.dispose2.UseVisualStyleBackColor = true;
|
||||
this.dispose2.Click += new System.EventHandler(this.dispose2_Click);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(9, 287);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(210, 13);
|
||||
this.label1.TabIndex = 3;
|
||||
this.label1.Text = "Press F1 to toggle FullScreen / Windowed.";
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(388, 310);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.KeyPreview = true;
|
||||
this.Name = "Form1";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
|
||||
this.Text = "Form1";
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
|
||||
this.Load += new System.EventHandler(this.Form1_Load);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Button create1;
|
||||
private System.Windows.Forms.Button dispose1;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Button create2;
|
||||
private System.Windows.Forms.Button dispose2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
||||
|
273
Source/Examples/OpenGL/Basic/NoFramework/QueryModesForm.cs
Normal file
273
Source/Examples/OpenGL/Basic/NoFramework/QueryModesForm.cs
Normal file
|
@ -0,0 +1,273 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using OpenTK.OpenGL;
|
||||
|
||||
namespace NoFramework
|
||||
{
|
||||
public partial class QueryModesForm : Form
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new QueryModesForm());
|
||||
}
|
||||
|
||||
|
||||
GLContext context1, context2;
|
||||
|
||||
public QueryModesForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
timer1.Enabled = true;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
base.OnClosed(e);
|
||||
|
||||
if (context1 != null)
|
||||
context1.Dispose();
|
||||
|
||||
if (context2 != null)
|
||||
context2.Dispose();
|
||||
}
|
||||
static float angle;
|
||||
|
||||
#region Load event handler
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
OnResize(e);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
int count;
|
||||
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
PaintGLScene();
|
||||
|
||||
count++;
|
||||
|
||||
if (count == 20)
|
||||
create1_Click(null, EventArgs.Empty);
|
||||
|
||||
if (context1 == null)
|
||||
return;
|
||||
|
||||
//if (count == 60)
|
||||
// ToggleFullScreen();
|
||||
|
||||
if (context1.IsFullscreen)
|
||||
{
|
||||
this.Location = new Point(this.Location.X + (int)(Math.Sin(count / (5 * Math.PI)) * 3),
|
||||
this.Location.Y);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
PaintGLScene();
|
||||
}
|
||||
|
||||
private void PaintGLScene()
|
||||
{
|
||||
RenderToContext(context1, 0);
|
||||
RenderToContext(context2, 45);
|
||||
|
||||
}
|
||||
|
||||
private void RenderToContext(GLContext context, float angle_add)
|
||||
{
|
||||
if (context == null)
|
||||
return;
|
||||
|
||||
context.MakeCurrent();
|
||||
|
||||
GL.ClearColor(0.1f, 0.1f, 0.5f, 0.0f);
|
||||
GL.Enable(Enums.EnableCap.DEPTH_TEST);
|
||||
|
||||
GL.Viewport(0, 0, context.Width, context.Height);
|
||||
|
||||
double ratio = 0.0;
|
||||
ratio = context.Width / (double)context.Height;
|
||||
|
||||
GL.MatrixMode(Enums.MatrixMode.PROJECTION);
|
||||
GL.LoadIdentity();
|
||||
Glu.Perspective(45.0, context.AspectRatio, 1.0, 64.0);
|
||||
|
||||
|
||||
GL.MatrixMode(Enums.MatrixMode.MODELVIEW);
|
||||
GL.LoadIdentity();
|
||||
Glu.LookAt(
|
||||
0.0, 5.0, 5.0,
|
||||
0.0, 0.0, 0.0,
|
||||
0.0, 1.0, 0.0
|
||||
);
|
||||
GL.Rotatef(angle + angle_add, 0.0f, 1.0f, 0.0f);
|
||||
angle += 0.5f;
|
||||
|
||||
GL.Clear(Enums.ClearBufferMask.COLOR_BUFFER_BIT | Enums.ClearBufferMask.DEPTH_BUFFER_BIT);
|
||||
|
||||
DrawCube();
|
||||
|
||||
if (context == null)
|
||||
{
|
||||
Console.WriteLine("Context is null! Press any key to crash.");
|
||||
Console.ReadKey();
|
||||
}
|
||||
context.SwapBuffers();
|
||||
}
|
||||
|
||||
#region KeyDown event handler
|
||||
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
|
||||
switch (e.KeyData)
|
||||
{
|
||||
case Keys.Escape:
|
||||
Application.Exit();
|
||||
break;
|
||||
|
||||
case Keys.F1:
|
||||
//this.SetResolution(this.Width, this.Height, this.ColorDepth, !this.Fullscreen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DrawCube
|
||||
public void DrawCube()
|
||||
{
|
||||
GL.Begin(Enums.BeginMode.QUADS);
|
||||
|
||||
GL.Color3f(1, 0, 0);
|
||||
GL.Vertex3f(-1.0f, -1.0f, -1.0f);
|
||||
GL.Vertex3f(-1.0f, 1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, -1.0f, -1.0f);
|
||||
|
||||
GL.Color3f(1, 1, 0);
|
||||
GL.Vertex3f(-1.0f, -1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, -1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, -1.0f, 1.0f);
|
||||
GL.Vertex3f(-1.0f, -1.0f, 1.0f);
|
||||
|
||||
GL.Color3f(1, 0, 1);
|
||||
GL.Vertex3f(-1.0f, -1.0f, -1.0f);
|
||||
GL.Vertex3f(-1.0f, -1.0f, 1.0f);
|
||||
GL.Vertex3f(-1.0f, 1.0f, 1.0f);
|
||||
GL.Vertex3f(-1.0f, 1.0f, -1.0f);
|
||||
|
||||
GL.Color3f(0, 1, 0);
|
||||
GL.Vertex3f(-1.0f, -1.0f, 1.0f);
|
||||
GL.Vertex3f(1.0f, -1.0f, 1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, 1.0f);
|
||||
GL.Vertex3f(-1.0f, 1.0f, 1.0f);
|
||||
|
||||
GL.Color3f(0, 0, 1);
|
||||
GL.Vertex3f(-1.0f, 1.0f, -1.0f);
|
||||
GL.Vertex3f(-1.0f, 1.0f, 1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, 1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, -1.0f);
|
||||
|
||||
GL.Color3f(0, 1, 1);
|
||||
GL.Vertex3f(1.0f, -1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, -1.0f);
|
||||
GL.Vertex3f(1.0f, 1.0f, 1.0f);
|
||||
GL.Vertex3f(1.0f, -1.0f, 1.0f);
|
||||
|
||||
GL.End();
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void create1_Click(object sender, EventArgs e)
|
||||
{
|
||||
context1 = GLContext.Create(panel1, new OpenTK.OpenGL.ColorDepth(8, 8, 8, 8), 8, 0);
|
||||
|
||||
create1.Enabled = false;
|
||||
dispose1.Enabled = true;
|
||||
|
||||
|
||||
Text =
|
||||
GL.GetString(Enums.StringName.VENDOR) + " " +
|
||||
GL.GetString(Enums.StringName.RENDERER) + " " +
|
||||
GL.GetString(Enums.StringName.VERSION);
|
||||
|
||||
}
|
||||
|
||||
private void create2_Click(object sender, EventArgs e)
|
||||
{
|
||||
context2 = GLContext.Create(panel2, new OpenTK.OpenGL.ColorDepth(8, 8, 8, 8), 8, 0);
|
||||
|
||||
create2.Enabled = false;
|
||||
dispose2.Enabled = true;
|
||||
}
|
||||
|
||||
private void dispose1_Click(object sender, EventArgs e)
|
||||
{
|
||||
context1.Dispose();
|
||||
context1 = null;
|
||||
panel1.Invalidate();
|
||||
|
||||
create1.Enabled = true;
|
||||
dispose1.Enabled = false;
|
||||
}
|
||||
|
||||
private void dispose2_Click(object sender, EventArgs e)
|
||||
{
|
||||
context2.Dispose();
|
||||
context2 = null;
|
||||
panel2.Invalidate();
|
||||
|
||||
create2.Enabled = true;
|
||||
dispose2.Enabled = false;
|
||||
}
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.BringToFront();
|
||||
}
|
||||
private void Form1_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (context1 == null)
|
||||
return;
|
||||
|
||||
if (e.KeyCode == Keys.F1)
|
||||
{
|
||||
ToggleFullScreen();
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleFullScreen()
|
||||
{
|
||||
if (context1.IsFullscreen)
|
||||
context1.SetWindowed();
|
||||
else
|
||||
{
|
||||
context1.SetFullScreen(640, 480, new OpenTK.OpenGL.ColorDepth(8, 8, 8, 8));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
123
Source/Examples/OpenGL/Basic/NoFramework/QueryModesForm.resx
Normal file
123
Source/Examples/OpenGL/Basic/NoFramework/QueryModesForm.resx
Normal file
|
@ -0,0 +1,123 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
60
Source/Examples/OpenGL/Basic/QueryDisplayModes/DisplayModesForm.Designer.cs
generated
Normal file
60
Source/Examples/OpenGL/Basic/QueryDisplayModes/DisplayModesForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,60 @@
|
|||
namespace QueryDisplayModes
|
||||
{
|
||||
partial class DisplayModesForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.listBox1 = new System.Windows.Forms.ListBox();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// listBox1
|
||||
//
|
||||
this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.listBox1.FormattingEnabled = true;
|
||||
this.listBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.listBox1.Name = "listBox1";
|
||||
this.listBox1.Size = new System.Drawing.Size(292, 264);
|
||||
this.listBox1.TabIndex = 0;
|
||||
//
|
||||
// DisplayModes
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(292, 266);
|
||||
this.Controls.Add(this.listBox1);
|
||||
this.Name = "DisplayModes";
|
||||
this.Text = "Query Display Modes";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ListBox listBox1;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using OpenTK.OpenGL;
|
||||
|
||||
namespace QueryDisplayModes
|
||||
{
|
||||
public partial class DisplayModesForm : Form
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new DisplayModesForm());
|
||||
}
|
||||
|
||||
GLContext context;
|
||||
|
||||
public DisplayModesForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
context = GLContext.Create(this, new OpenTK.OpenGL.ColorDepth(8, 8, 8, 8), 0, 0);
|
||||
|
||||
DisplayMode[] modes = context.EnumDisplayModes();
|
||||
|
||||
for (int i = 0; i < modes.Length; i++)
|
||||
listBox1.Items.Add(modes[i]);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
11
Source/Examples/OpenGL/Basic/QueryDisplayModes/Program.cs
Normal file
11
Source/Examples/OpenGL/Basic/QueryDisplayModes/Program.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace QueryDisplayModes
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("QueryDisplayModes")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("QueryDisplayModes")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2006")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("27ed3249-d42f-4f47-b80a-5d8039d18d77")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
71
Source/Examples/OpenGL/Basic/QueryDisplayModes/Properties/Resources.Designer.cs
generated
Normal file
71
Source/Examples/OpenGL/Basic/QueryDisplayModes/Properties/Resources.Designer.cs
generated
Normal file
|
@ -0,0 +1,71 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.42
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace QueryDisplayModes.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("QueryDisplayModes.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
30
Source/Examples/OpenGL/Basic/QueryDisplayModes/Properties/Settings.Designer.cs
generated
Normal file
30
Source/Examples/OpenGL/Basic/QueryDisplayModes/Properties/Settings.Designer.cs
generated
Normal file
|
@ -0,0 +1,30 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.42
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace QueryDisplayModes.Properties
|
||||
{
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
|
@ -7,7 +7,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
@ -39,9 +38,9 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
|||
static float angle;
|
||||
|
||||
#region Load event handler
|
||||
protected override void OnLoad(EventArgs e)
|
||||
protected override void OnLoad(object sender, EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
base.OnLoad(sender, e);
|
||||
|
||||
Text =
|
||||
GL.GetString(Enums.StringName.VENDOR) + " " +
|
||||
|
@ -87,14 +86,14 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
|||
GL.LinkProgram(shader_program);
|
||||
GL.UseProgram(shader_program);
|
||||
|
||||
OnResize(e);
|
||||
OnResize(sender, e);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Resize event handler
|
||||
protected override void OnResize(EventArgs e)
|
||||
protected override void OnResize(object sender, EventArgs e)
|
||||
{
|
||||
base.OnResize(e);
|
||||
base.OnResize(sender, e);
|
||||
|
||||
// if (this.Context == null)
|
||||
// return;
|
||||
|
@ -119,9 +118,9 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
|||
|
||||
#region Paint event handler
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
protected override void OnPaint()
|
||||
{
|
||||
base.OnPaint(e);
|
||||
base.OnPaint();
|
||||
|
||||
GL.MatrixMode(Enums.MatrixMode.MODELVIEW);
|
||||
GL.LoadIdentity();
|
||||
|
@ -137,16 +136,16 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
|||
|
||||
DrawCube();
|
||||
|
||||
Context.SwapBuffers();
|
||||
ActiveContext.SwapBuffers();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region KeyDown event handler
|
||||
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
protected override void OnKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
base.OnKeyDown(e);
|
||||
base.OnKeyDown(sender, e);
|
||||
|
||||
switch (e.KeyData)
|
||||
{
|
||||
|
@ -155,7 +154,7 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
|||
break;
|
||||
|
||||
case Keys.F1:
|
||||
this.SetResolution(this.Width, this.Height, this.ColorDepth, !this.Fullscreen);
|
||||
this.SetResolution(this.Width, this.Height, this.ColorDepth, !this.IsFullscreen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -216,7 +215,7 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
|||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Cube());
|
||||
new Cube().Run();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -1,87 +0,0 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{46980D11-67FA-4B33-903F-BC9D8A4FE60F}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenTK.Examples.OpenGL.GLSL</RootNamespace>
|
||||
<AssemblyName>GLSL.Lesson01</AssemblyName>
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<NoStdLib>False</NoStdLib>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
|
||||
<BaseAddress>4194304</BaseAddress>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>Full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\..\..\Binaries\Debug\Examples\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\..\..\..\Binaries\Release\Examples\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Cube.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\Framework\OpenTK.Framework.csproj">
|
||||
<Project>{26B55626-4EAB-4CAE-82FE-93CD6564D9EA}</Project>
|
||||
<Name>OpenTK.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\OpenGL\OpenGL\OpenTK.OpenGL.csproj">
|
||||
<Project>{836876D1-0C8D-4240-BEE4-859D9D3D46CB}</Project>
|
||||
<Name>OpenTK.OpenGL</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\Platform\Windows\OpenTK.Platform.Windows.csproj">
|
||||
<Project>{FDFA00B6-FA81-4658-86E1-F312EFB42E1C}</Project>
|
||||
<Name>OpenTK.Platform.Windows</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||
</Project>
|
|
@ -1,5 +1,6 @@
|
|||
#region License
|
||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
||||
* Contributions from Erik Ylvisaker
|
||||
* See license.txt for license info
|
||||
*/
|
||||
#endregion
|
||||
|
@ -17,6 +18,361 @@ using OpenTK.OpenGL;
|
|||
|
||||
namespace OpenTK.Frameworks
|
||||
{
|
||||
public class Framework : IDisposable
|
||||
{
|
||||
private Form activeForm;
|
||||
private GLContext activeContext;
|
||||
private PlatformSpecific platform;
|
||||
|
||||
private OpenGL.ColorDepth _color_depth;
|
||||
private int _z_depth;
|
||||
private int _stencil_depth;
|
||||
|
||||
private string text = "OpenTK Windows application";
|
||||
|
||||
#region --- Public Properties ---
|
||||
|
||||
public Form ActiveForm
|
||||
{
|
||||
get { return activeForm; }
|
||||
|
||||
}
|
||||
public GLContext ActiveContext
|
||||
{
|
||||
get { return activeContext; }
|
||||
private set { activeContext = value; }
|
||||
}
|
||||
public string Text
|
||||
{
|
||||
get { return text; }
|
||||
set
|
||||
{
|
||||
text = value;
|
||||
|
||||
if (activeForm != null)
|
||||
activeForm.Text = value;
|
||||
}
|
||||
}
|
||||
public Size ClientSize
|
||||
{
|
||||
get { return ActiveForm.ClientSize; }
|
||||
set { activeForm.ClientSize = value; }
|
||||
}
|
||||
public int Width
|
||||
{
|
||||
get { return ClientSize.Width; }
|
||||
set { ClientSize = new Size(value, ClientSize.Height); }
|
||||
}
|
||||
public int Height
|
||||
{
|
||||
get { return ClientSize.Height; }
|
||||
set { ClientSize = new Size(ClientSize.Width, value); }
|
||||
}
|
||||
public bool IsFullscreen
|
||||
{
|
||||
get
|
||||
{
|
||||
return ActiveContext.IsFullscreen;
|
||||
}
|
||||
}
|
||||
|
||||
public OpenGL.ColorDepth ColorDepth
|
||||
{
|
||||
get { return _color_depth; }
|
||||
private set { _color_depth = value; }
|
||||
}
|
||||
public int ZDepth
|
||||
{
|
||||
get { return _z_depth; }
|
||||
set { _z_depth = value; }
|
||||
}
|
||||
public int StencilDepth
|
||||
{
|
||||
get { return _stencil_depth; }
|
||||
set { _stencil_depth = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Creation and Destruction ---
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a Framework object.
|
||||
/// </summary>
|
||||
public Framework()
|
||||
: this(null, 800, 600, new OpenTK.OpenGL.ColorDepth(8, 8, 8, 8), 16, 0, false)
|
||||
{ }
|
||||
public Framework(string title, int width, int height, OpenTK.OpenGL.ColorDepth color,
|
||||
int depth, int stencil, bool fullscreen)
|
||||
{
|
||||
platform = PlatformSpecific.CreatePlatformMethods();
|
||||
|
||||
Setup(title, width, height, color, depth, stencil, fullscreen);
|
||||
}
|
||||
|
||||
~Framework()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
}
|
||||
|
||||
if (activeContext != null)
|
||||
{
|
||||
activeContext.Dispose();
|
||||
activeContext = null;
|
||||
}
|
||||
if (activeForm != null)
|
||||
{
|
||||
activeForm.Dispose();
|
||||
activeForm = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Creation and setup of windows ---
|
||||
|
||||
private void Setup(string title, int width, int height, OpenTK.OpenGL.ColorDepth color,
|
||||
int depth, int stencil, bool fullscreen)
|
||||
{
|
||||
System.Console.WriteLine("Created Framework.");
|
||||
|
||||
// Initialise components.
|
||||
ColorDepth = color;
|
||||
ZDepth = depth;
|
||||
StencilDepth = stencil;
|
||||
|
||||
if (string.IsNullOrEmpty(title) == false)
|
||||
Text = title;
|
||||
|
||||
if (fullscreen)
|
||||
CreateFullScreenDisplay(width, height);
|
||||
else
|
||||
CreateWindowedDisplay(width, height);
|
||||
|
||||
|
||||
System.Console.WriteLine("Done Initializing.");
|
||||
}
|
||||
|
||||
private void CreateWindowedDisplay(int width, int height)
|
||||
{
|
||||
DisposeForm();
|
||||
|
||||
activeForm = new WindowedForm();
|
||||
activeForm.Text = Text;
|
||||
|
||||
activeContext = GLContext.Create(activeForm,
|
||||
this.ColorDepth, this.ZDepth, this.StencilDepth);
|
||||
|
||||
AttachEvents(activeForm);
|
||||
|
||||
activeForm.Show();
|
||||
|
||||
activeForm.ClientSize = new Size(width, height);
|
||||
}
|
||||
|
||||
private void CreateFullScreenDisplay(int width, int height)
|
||||
{
|
||||
DisposeForm();
|
||||
|
||||
activeForm = new FullScreenForm();
|
||||
activeForm.Text = Text;
|
||||
|
||||
activeContext = GLContext.Create(activeForm,
|
||||
this.ColorDepth, this.ZDepth, this.StencilDepth);
|
||||
|
||||
AttachEvents(activeForm);
|
||||
|
||||
activeForm.Show();
|
||||
|
||||
activeForm.ClientSize = new Size(width, height);
|
||||
activeForm.Location = Point.Empty;
|
||||
|
||||
activeContext.SetFullScreen(width, height, ColorDepth);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void AttachEvents(Form frm)
|
||||
{
|
||||
frm.Load += new EventHandler(OnLoad);
|
||||
frm.Resize += new EventHandler(OnResize);
|
||||
frm.Paint += new PaintEventHandler(OnPaint);
|
||||
frm.KeyDown += new KeyEventHandler(OnKeyDown);
|
||||
frm.KeyUp += new KeyEventHandler(OnKeyUp);
|
||||
frm.KeyPress += new KeyPressEventHandler(OnKeyPress);
|
||||
frm.Click += new EventHandler(OnClick);
|
||||
frm.MouseDown += new MouseEventHandler(OnMouseDown);
|
||||
frm.MouseEnter += new EventHandler(OnMouseEnter);
|
||||
frm.MouseHover += new EventHandler(OnMouseHover);
|
||||
frm.MouseLeave += new EventHandler(OnMouseLeave);
|
||||
frm.MouseMove += new MouseEventHandler(OnMouseMove);
|
||||
frm.MouseUp += new MouseEventHandler(OnMouseUp);
|
||||
frm.MouseWheel += new MouseEventHandler(OnMouseWheel);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
virtual protected void OnMouseWheel(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (MouseWheel != null)
|
||||
MouseWheel(sender, e);
|
||||
}
|
||||
virtual protected void OnMouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (MouseUp != null)
|
||||
MouseUp(sender, e);
|
||||
}
|
||||
virtual protected void OnMouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (MouseMove != null)
|
||||
MouseMove(sender, e);
|
||||
}
|
||||
virtual protected void OnMouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
if (MouseLeave != null)
|
||||
MouseLeave(sender, e);
|
||||
}
|
||||
virtual protected void OnMouseHover(object sender, EventArgs e)
|
||||
{
|
||||
if (MouseHover != null)
|
||||
MouseHover(sender, e);
|
||||
}
|
||||
virtual protected void OnMouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
if (MouseEnter != null)
|
||||
MouseEnter(sender, e);
|
||||
}
|
||||
virtual protected void OnMouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (MouseDown != null)
|
||||
MouseDown(sender, e);
|
||||
}
|
||||
virtual protected void OnClick(object sender, EventArgs e)
|
||||
{
|
||||
if (Click != null)
|
||||
Click(sender, e);
|
||||
}
|
||||
virtual protected void OnKeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (KeyPress != null)
|
||||
KeyPress(sender, e);
|
||||
}
|
||||
virtual protected void OnKeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (KeyUp != null)
|
||||
KeyUp(sender, e);
|
||||
}
|
||||
virtual protected void OnKeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (KeyDown != null)
|
||||
KeyDown(sender, e);
|
||||
}
|
||||
private void OnPaint(object sender, PaintEventArgs e)
|
||||
{
|
||||
OnPaint();
|
||||
|
||||
if (Paint != null)
|
||||
Paint(sender, e);
|
||||
}
|
||||
virtual protected void OnPaint()
|
||||
{
|
||||
}
|
||||
|
||||
virtual protected void OnResize(object sender, EventArgs e)
|
||||
{
|
||||
if (Resize != null)
|
||||
Resize(sender, e);
|
||||
}
|
||||
virtual protected void OnLoad(object sender, EventArgs e)
|
||||
{
|
||||
if (Load != null)
|
||||
Load(sender, e);
|
||||
}
|
||||
|
||||
public event EventHandler Load;
|
||||
public event EventHandler Resize;
|
||||
public event PaintEventHandler Paint;
|
||||
|
||||
public event KeyEventHandler KeyDown;
|
||||
public event KeyEventHandler KeyUp;
|
||||
public event KeyPressEventHandler KeyPress;
|
||||
|
||||
public event EventHandler Click;
|
||||
public event MouseEventHandler MouseDown;
|
||||
public event EventHandler MouseEnter;
|
||||
public event EventHandler MouseHover;
|
||||
public event EventHandler MouseLeave;
|
||||
public event MouseEventHandler MouseMove;
|
||||
public event MouseEventHandler MouseUp;
|
||||
public event MouseEventHandler MouseWheel;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Window Management
|
||||
|
||||
private void DisposeForm()
|
||||
{
|
||||
if (activeContext != null)
|
||||
activeContext.Dispose();
|
||||
if (activeForm != null)
|
||||
activeForm.Dispose();
|
||||
|
||||
activeContext = null;
|
||||
activeForm = null;
|
||||
}
|
||||
|
||||
public void SetResolution(int width, int height, OpenGL.ColorDepth color, bool fullscreen)
|
||||
{
|
||||
ColorDepth = color;
|
||||
|
||||
if (fullscreen && IsFullscreen)
|
||||
{
|
||||
activeForm.ClientSize = new Size(width, height);
|
||||
activeContext.SetFullScreen(width, height, color);
|
||||
}
|
||||
else if (fullscreen && !IsFullscreen)
|
||||
{
|
||||
CreateFullScreenDisplay(width, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateWindowedDisplay(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Render Loop
|
||||
|
||||
public void Run()
|
||||
{
|
||||
while (ActiveForm != null && ActiveForm.IsDisposed == false)
|
||||
{
|
||||
OnPaint(this, null);
|
||||
|
||||
if (platform.IsIdle() == false)
|
||||
Application.DoEvents();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/*
|
||||
public partial class Framework : Form, IDisposable
|
||||
{
|
||||
#region Public properties
|
||||
|
@ -28,7 +384,7 @@ namespace OpenTK.Frameworks
|
|||
public GLContext Context
|
||||
{
|
||||
get { return _context; }
|
||||
private set { _context = value; }
|
||||
internal set { _context = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -40,7 +396,7 @@ namespace OpenTK.Frameworks
|
|||
public bool Fullscreen
|
||||
{
|
||||
get { return _fullscreen; }
|
||||
private set { _fullscreen = value; }
|
||||
internal set { _fullscreen = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -52,7 +408,7 @@ namespace OpenTK.Frameworks
|
|||
public OpenTK.OpenGL.ColorDepth ColorDepth
|
||||
{
|
||||
get { return _color_depth; }
|
||||
private set { _color_depth = value; }
|
||||
internal set { _color_depth = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -64,7 +420,7 @@ namespace OpenTK.Frameworks
|
|||
public int ZDepth
|
||||
{
|
||||
get { return _z_depth; }
|
||||
private set { _z_depth = value; }
|
||||
internal set { _z_depth = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -76,7 +432,7 @@ namespace OpenTK.Frameworks
|
|||
public int StencilDepth
|
||||
{
|
||||
get { return _stencil_depth; }
|
||||
private set { _stencil_depth = value; }
|
||||
internal set { _stencil_depth = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -88,7 +444,7 @@ namespace OpenTK.Frameworks
|
|||
public Size DesktopResolution
|
||||
{
|
||||
get { return _desktop_resolution; }
|
||||
private set { _desktop_resolution = value; }
|
||||
internal set { _desktop_resolution = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -100,7 +456,7 @@ namespace OpenTK.Frameworks
|
|||
public float DesktopRefreshRate
|
||||
{
|
||||
get { return _desktop_refresh_rate; }
|
||||
private set { _desktop_refresh_rate = value; }
|
||||
internal set { _desktop_refresh_rate = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -112,7 +468,7 @@ namespace OpenTK.Frameworks
|
|||
public OpenTK.OpenGL.ColorDepth DesktopColorDepth
|
||||
{
|
||||
get { return _desktop_color_depth; }
|
||||
private set { _desktop_color_depth = value; }
|
||||
internal set { _desktop_color_depth = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -140,17 +496,27 @@ namespace OpenTK.Frameworks
|
|||
|
||||
private void Setup(string title, int width, int height, OpenTK.OpenGL.ColorDepth color, int depth, int stencil, bool fullscreen)
|
||||
{
|
||||
System.Console.WriteLine("Created Framework.");
|
||||
|
||||
// Set platform.
|
||||
try
|
||||
{
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT || Environment.OSVersion.Platform == PlatformID.Win32Windows)
|
||||
PlatformID platform = Environment.OSVersion.Platform;
|
||||
|
||||
if (platform == PlatformID.Win32NT ||
|
||||
platform == PlatformID.Win32Windows)
|
||||
{
|
||||
System.Console.Write("Instantiating Windows Implementation...");
|
||||
Implementation = new WindowsImplementation(this);
|
||||
System.Console.WriteLine("success.");
|
||||
|
||||
}
|
||||
else if (Environment.OSVersion.Platform == PlatformID.Unix)
|
||||
else if (platform == PlatformID.Unix ||
|
||||
platform == (PlatformID)128) // older versions of Mono report 128.
|
||||
{
|
||||
//Implementation = new X11Implementation();
|
||||
throw new PlatformNotSupportedException("The platform on which you are trying to run this program is not currently supported. Sorry for the inconvenience.");
|
||||
System.Console.Write("Instantiating X11 Implementation...");
|
||||
Implementation = new X11Implementation(this);
|
||||
System.Console.WriteLine("success.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -177,23 +543,27 @@ namespace OpenTK.Frameworks
|
|||
ZDepth = depth;
|
||||
StencilDepth = stencil;
|
||||
|
||||
System.Console.WriteLine("Creating Context.");
|
||||
Context = GLContext.Create(this, color, depth, stencil);
|
||||
|
||||
// Code taken from NeHe tutorials
|
||||
this.CreateParams.Style |= (int)Api.WindowClassStyle.HRedraw | (int)Api.WindowClassStyle.VRedraw | (int)Api.WindowClassStyle.OwnDC;
|
||||
this.CreateParams.Style |= (int)WinApi.WindowClassStyle.HRedraw | (int)WinApi.WindowClassStyle.VRedraw | (int)WinApi.WindowClassStyle.OwnDC;
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); // No Need To Erase Form Background
|
||||
this.SetStyle(ControlStyles.Opaque, true); // No Need To Draw Form Background
|
||||
//this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); // Buffer Control
|
||||
//this.SetStyle(ControlStyles.ResizeRedraw, true); // Redraw On Resize
|
||||
this.SetStyle(ControlStyles.UserPaint, true); // We'll Handle Painting Ourselves
|
||||
|
||||
System.Console.WriteLine("Setting Resolution.");
|
||||
Implementation.SetResolution(width, height, color, fullscreen);
|
||||
|
||||
if (title == null)
|
||||
if (string.IsNullOrEmpty(title))
|
||||
title = "OpenTK Windows application";
|
||||
this.Text = title;
|
||||
|
||||
Application.Idle += new EventHandler(OnIdle);
|
||||
|
||||
System.Console.WriteLine("Done Initializing.");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -205,7 +575,7 @@ namespace OpenTK.Frameworks
|
|||
/// </summary>
|
||||
/// <param name="sender">Not used.</param>
|
||||
/// <param name="e">Not used.</param>
|
||||
protected void OnIdle(object sender, EventArgs args)
|
||||
protected internal void OnIdle(object sender, EventArgs args)
|
||||
{
|
||||
while (Implementation.IsIdle())
|
||||
{
|
||||
|
@ -217,6 +587,11 @@ namespace OpenTK.Frameworks
|
|||
|
||||
#endregion
|
||||
|
||||
internal new void SetTopLevel(bool topLevel)
|
||||
{
|
||||
base.SetTopLevel(topLevel);
|
||||
}
|
||||
|
||||
#region Public member functions
|
||||
|
||||
/// <summary>
|
||||
|
@ -245,4 +620,5 @@ namespace OpenTK.Frameworks
|
|||
|
||||
#endregion
|
||||
}
|
||||
* */
|
||||
}
|
||||
|
|
|
@ -11,15 +11,12 @@ using System.Drawing;
|
|||
|
||||
namespace OpenTK.Frameworks
|
||||
{
|
||||
public partial class Framework
|
||||
internal abstract class FrameworkImplementation
|
||||
{
|
||||
internal abstract class FrameworkImplementation
|
||||
{
|
||||
public abstract void OnHandleCreated(object sender, EventArgs args);
|
||||
public abstract bool IsIdle();
|
||||
public abstract void Setup();
|
||||
//abstract public void CloseWindow();
|
||||
public abstract void SetResolution(int width, int height, OpenTK.OpenGL.ColorDepth color, bool fullscreen);
|
||||
}
|
||||
public abstract void OnHandleCreated(object sender, EventArgs args);
|
||||
public abstract bool IsIdle();
|
||||
public abstract void Setup();
|
||||
//abstract public void CloseWindow();
|
||||
public abstract void SetResolution(int width, int height, OpenTK.OpenGL.ColorDepth color, bool fullscreen);
|
||||
}
|
||||
}
|
||||
}
|
48
Source/Framework/FullScreenForm.Designer.cs
generated
Normal file
48
Source/Framework/FullScreenForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,48 @@
|
|||
namespace OpenTK
|
||||
{
|
||||
partial class FullScreenForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// FullScreenForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(292, 266);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.KeyPreview = true;
|
||||
this.Name = "FullScreenForm";
|
||||
this.Text = "FullScreenForm";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
24
Source/Framework/FullScreenForm.cs
Normal file
24
Source/Framework/FullScreenForm.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
public partial class FullScreenForm : Form
|
||||
{
|
||||
public FullScreenForm()
|
||||
{
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); // No Need To Erase Form Background
|
||||
this.SetStyle(ControlStyles.Opaque, true); // No Need To Draw Form Background
|
||||
//this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); // Buffer Control
|
||||
//this.SetStyle(ControlStyles.ResizeRedraw, true); // Redraw On Resize
|
||||
this.SetStyle(ControlStyles.UserPaint, true); // We'll Handle Painting Ourselves
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
120
Source/Framework/FullScreenForm.resx
Normal file
120
Source/Framework/FullScreenForm.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -1,76 +0,0 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{26B55626-4EAB-4CAE-82FE-93CD6564D9EA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenTK</RootNamespace>
|
||||
<AssemblyName>OpenTK.Framework</AssemblyName>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Framework.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FrameworkImplementation.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WindowsImplementation.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenGL\OpenGL\OpenTK.OpenGL.csproj">
|
||||
<Project>{836876D1-0C8D-4240-BEE4-859D9D3D46CB}</Project>
|
||||
<Name>OpenTK.OpenGL</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Platform\Windows\OpenTK.Platform.Windows.csproj">
|
||||
<Project>{FDFA00B6-FA81-4658-86E1-F312EFB42E1C}</Project>
|
||||
<Name>OpenTK.Platform.Windows</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Platform\X\OpenTK.Platform.X.csproj">
|
||||
<Project>{E3F35BD6-67CE-4AD5-AB98-043CF072A75A}</Project>
|
||||
<Name>OpenTK.Platform.X</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Documentation\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
39
Source/Framework/Platform.cs
Normal file
39
Source/Framework/Platform.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
public class PlatformSpecific
|
||||
{
|
||||
public static PlatformSpecific CreatePlatformMethods()
|
||||
{
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT ||
|
||||
Environment.OSVersion.Platform == PlatformID.Win32Windows)
|
||||
{
|
||||
return new WindowsPlatform();
|
||||
}
|
||||
else if (Environment.OSVersion.Platform == PlatformID.Unix ||
|
||||
Environment.OSVersion.Platform == (PlatformID)128) // some older versions of Mono reported 128.
|
||||
{
|
||||
return new X11Platform();
|
||||
}
|
||||
else
|
||||
{
|
||||
// return an object which implements the base methods, using "safe" .net fallback routines.
|
||||
return new PlatformSpecific();
|
||||
|
||||
//throw new PlatformNotSupportedException("The platform on which you are trying to run this program is not currently supported. Sorry for the inconvenience.");
|
||||
}
|
||||
}
|
||||
|
||||
protected PlatformSpecific()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual bool IsIdle()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
47
Source/Framework/WindowedForm.Designer.cs
generated
Normal file
47
Source/Framework/WindowedForm.Designer.cs
generated
Normal file
|
@ -0,0 +1,47 @@
|
|||
namespace OpenTK
|
||||
{
|
||||
partial class WindowedForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// WindowedForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(292, 266);
|
||||
this.KeyPreview = true;
|
||||
this.Name = "WindowedForm";
|
||||
this.Text = "Form1";
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
24
Source/Framework/WindowedForm.cs
Normal file
24
Source/Framework/WindowedForm.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
public partial class WindowedForm : Form
|
||||
{
|
||||
public WindowedForm()
|
||||
{
|
||||
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); // No Need To Erase Form Background
|
||||
this.SetStyle(ControlStyles.Opaque, true); // No Need To Draw Form Background
|
||||
//this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); // Buffer Control
|
||||
//this.SetStyle(ControlStyles.ResizeRedraw, true); // Redraw On Resize
|
||||
this.SetStyle(ControlStyles.UserPaint, true); // We'll Handle Painting Ourselves
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
120
Source/Framework/WindowedForm.resx
Normal file
120
Source/Framework/WindowedForm.resx
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -1,141 +0,0 @@
|
|||
#region License
|
||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
||||
* See license.txt for license info
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using OpenTK.Platform.Windows;
|
||||
using System.Runtime.InteropServices;
|
||||
using OpenTK.OpenGL.Platform;
|
||||
using OpenTK.OpenGL;
|
||||
|
||||
namespace OpenTK.Frameworks
|
||||
{
|
||||
public partial class Framework
|
||||
{
|
||||
internal class WindowsImplementation : FrameworkImplementation
|
||||
{
|
||||
private Framework framework;
|
||||
|
||||
public WindowsImplementation(Framework f)
|
||||
{
|
||||
framework = f;
|
||||
|
||||
Setup();
|
||||
// Set desktop resolution, refresh rate, pixel depth
|
||||
}
|
||||
|
||||
override public void OnHandleCreated(object sender, EventArgs args)
|
||||
{
|
||||
//throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if there all pending messages have been processed.
|
||||
/// </summary>
|
||||
/// <returns>Returns true if there are no messages left, false otherwise.</returns>
|
||||
override public bool IsIdle()
|
||||
{
|
||||
Api.Message msg;
|
||||
return !Api.PeekMessage(out msg, IntPtr.Zero, 0, 0, 0);
|
||||
}
|
||||
|
||||
override public void Setup()
|
||||
{
|
||||
Api.DeviceMode device_mode = new Api.DeviceMode();
|
||||
Api.EnumDisplaySettings(null, Api.Constants.ENUM_REGISTRY_SETTINGS, device_mode);
|
||||
|
||||
framework.DesktopResolution = new Size(device_mode.PelsWidth, device_mode.PelsHeight);
|
||||
framework.DesktopRefreshRate = device_mode.DisplayFrequency;
|
||||
framework.DesktopColorDepth = new OpenTK.OpenGL.ColorDepth(device_mode.BitsPerPel);
|
||||
}
|
||||
|
||||
public override void SetResolution(int width, int height, OpenTK.OpenGL.ColorDepth color, bool fullscreen)
|
||||
{
|
||||
if (framework.Size == new Size(width, height) && framework.ColorDepth == color && framework.Fullscreen == fullscreen)
|
||||
return;
|
||||
|
||||
// If we want to change to a fullscreen mode
|
||||
if (fullscreen)
|
||||
{
|
||||
Application.Idle -= framework.OnIdle;
|
||||
|
||||
if (framework.WindowState == FormWindowState.Maximized)
|
||||
{
|
||||
Rectangle bounds = framework.RestoreBounds;
|
||||
framework.WindowState = FormWindowState.Normal;
|
||||
width = bounds.Width;
|
||||
height = bounds.Height;
|
||||
//framework.Size = new Size(bounds.Width, bounds.Height);
|
||||
//framework.Bounds = new Rectangle(0, 0, bounds.Width, bounds.Height);
|
||||
}
|
||||
|
||||
//if (color != framework.ColorDepth)
|
||||
// framework.Context.Dispose();
|
||||
|
||||
Api.DeviceMode ScreenSettings = new Api.DeviceMode();
|
||||
ScreenSettings.PelsWidth = width; // Selected Screen Width
|
||||
ScreenSettings.PelsHeight = height; // Selected Screen Height
|
||||
ScreenSettings.BitsPerPel = color.Alpha + // Selected Bits Per Pixel
|
||||
color.Red +
|
||||
color.Green +
|
||||
color.Blue;
|
||||
ScreenSettings.Fields = Api.Constants.DM_BITSPERPEL | Api.Constants.DM_PELSWIDTH | Api.Constants.DM_PELSHEIGHT;
|
||||
|
||||
//framework.Context = GLContext.Create(framework, framework.ColorDepth, 16, 0);
|
||||
Application.Idle += framework.OnIdle;
|
||||
|
||||
// Try To Set Selected Mode And Get Results. NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
|
||||
if (Api.ChangeDisplaySettings(ScreenSettings, Api.Constants.CDS_FULLSCREEN) == Api.Constants.DISP_CHANGE_SUCCESSFUL)
|
||||
{
|
||||
framework.Fullscreen = true;
|
||||
|
||||
framework.FormBorderStyle = FormBorderStyle.None;
|
||||
framework.StartPosition = FormStartPosition.Manual;
|
||||
framework.Location = new System.Drawing.Point(0, 0);
|
||||
//framework.Region = new Region(new Rectangle(0, 0, width, height));
|
||||
framework.Capture = true;
|
||||
framework.SetTopLevel(true);
|
||||
Cursor.Hide();
|
||||
|
||||
framework.Size = new Size(width, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If mode change wasn't possible.
|
||||
framework.Fullscreen = false;
|
||||
framework.Size = new Size(width, height);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we already are in fullscreen mode and we want to change to windowed mode.
|
||||
|
||||
if (framework.Fullscreen)
|
||||
{
|
||||
Application.Idle -= framework.OnIdle;
|
||||
|
||||
// Restore display settings
|
||||
Api.ChangeDisplaySettings(null, 0);
|
||||
framework.FormBorderStyle = FormBorderStyle.Sizable;
|
||||
framework.StartPosition = FormStartPosition.WindowsDefaultLocation;
|
||||
framework.Capture = false;
|
||||
framework.SetTopLevel(true);
|
||||
Cursor.Show();
|
||||
|
||||
Application.Idle += framework.OnIdle;
|
||||
}
|
||||
|
||||
framework.Fullscreen = false;
|
||||
framework.Size = new Size(width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
17
Source/Framework/WindowsPlatform.cs
Normal file
17
Source/Framework/WindowsPlatform.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
using OpenTK.Platform.Windows;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
class WindowsPlatform : PlatformSpecific
|
||||
{
|
||||
public override bool IsIdle()
|
||||
{
|
||||
WinApi.Message msg;
|
||||
return !WinApi.PeekMessage(out msg, IntPtr.Zero, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
#region License
|
||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
||||
* See license.txt for license info
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using OpenTK.Platform.X;
|
||||
using System.Runtime.InteropServices;
|
||||
using OpenTK.OpenGL.Platform;
|
||||
using OpenTK.OpenGL;
|
||||
|
||||
namespace OpenTK.Frameworks
|
||||
{
|
||||
public partial class Framework
|
||||
{
|
||||
internal class X11Implementation : FrameworkImplementation
|
||||
{
|
||||
private IntPtr display;
|
||||
public GLContext Context;
|
||||
|
||||
public override void OnHandleCreated(object sender, EventArgs args)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override bool IsIdle()
|
||||
{
|
||||
return Api.Pending(display) == 0 ? true : false;
|
||||
}
|
||||
|
||||
public override void Setup()
|
||||
{
|
||||
// Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms");
|
||||
// if (xplatui != null)
|
||||
// {
|
||||
// display = (IntPtr)xplatui.GetField("DisplayHandle",
|
||||
// System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetValue(null);
|
||||
// }
|
||||
}
|
||||
|
||||
public override bool SetResolution(int width, int height, OpenTK.OpenGL.ColorDepth color, bool fullscreen)
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
31
Source/Framework/X11Platform.cs
Normal file
31
Source/Framework/X11Platform.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
using OpenTK.Platform.X;
|
||||
|
||||
namespace OpenTK
|
||||
{
|
||||
class X11Platform : PlatformSpecific
|
||||
{
|
||||
IntPtr display;
|
||||
|
||||
public X11Platform()
|
||||
{
|
||||
Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms");
|
||||
if (xplatui != null)
|
||||
{
|
||||
Console.WriteLine("Got XplatUIX11 type.");
|
||||
|
||||
display = (IntPtr)xplatui.GetField("DisplayHandle",
|
||||
System.Reflection.BindingFlags.Static |
|
||||
System.Reflection.BindingFlags.NonPublic).GetValue(null);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsIdle()
|
||||
{
|
||||
return (X11Api.Pending(display) == 0) ? true : false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{1EDDE592-3923-4898-9006-3D69579E1745}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenTK.OpenGL.Bind</RootNamespace>
|
||||
<AssemblyName>OpenTK.OpenGL.Bind</AssemblyName>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<PostBuildEvent>$(TargetName)</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\Binaries\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\..\Binaries\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System">
|
||||
<HintPath>H:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<HintPath>H:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Deployment">
|
||||
<HintPath>H:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.XML">
|
||||
<HintPath>H:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ReadSpecs.cs" />
|
||||
<Compile Include="Settings.cs" />
|
||||
<Compile Include="Structures\Constant.cs" />
|
||||
<Compile Include="Structures\Enum.cs" />
|
||||
<Compile Include="Structures\Function.cs" />
|
||||
<Compile Include="Structures\Parameter.cs" />
|
||||
<Compile Include="TranslateSpecs.cs" />
|
||||
<Compile Include="WriteSpecs.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Documentation\changelog.txt" />
|
||||
<Content Include="Documentation\todo.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -1,8 +0,0 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<PublishUrlHistory>publish\</PublishUrlHistory>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<FallbackCulture>en-US</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
122
Source/OpenGL/Bind/Properties/Bind.Designer.cs
generated
122
Source/OpenGL/Bind/Properties/Bind.Designer.cs
generated
|
@ -1,122 +0,0 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.42
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace OpenTK.OpenGL.Bind.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
|
||||
internal sealed partial class Bind : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Bind defaultInstance = ((Bind)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Bind())));
|
||||
|
||||
public static Bind Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("GL")]
|
||||
public string OutputGLClass {
|
||||
get {
|
||||
return ((string)(this["OutputGLClass"]));
|
||||
}
|
||||
set {
|
||||
this["OutputGLClass"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("OpenTK.OpenGL")]
|
||||
public string OutputNamespace {
|
||||
get {
|
||||
return ((string)(this["OutputNamespace"]));
|
||||
}
|
||||
set {
|
||||
this["OutputNamespace"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("..\\..\\Source\\OpenGL\\OpenGL\\Bindings")]
|
||||
public string OutputPath {
|
||||
get {
|
||||
return ((string)(this["OutputPath"]));
|
||||
}
|
||||
set {
|
||||
this["OutputPath"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("..\\..\\Specifications")]
|
||||
public string InputPath {
|
||||
get {
|
||||
return ((string)(this["InputPath"]));
|
||||
}
|
||||
set {
|
||||
this["InputPath"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Platform")]
|
||||
public string OutputPlatformNamespace {
|
||||
get {
|
||||
return ((string)(this["OutputPlatformNamespace"]));
|
||||
}
|
||||
set {
|
||||
this["OutputPlatformNamespace"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Imports")]
|
||||
public string WriteInternalImportsClass {
|
||||
get {
|
||||
return ((string)(this["WriteInternalImportsClass"]));
|
||||
}
|
||||
set {
|
||||
this["WriteInternalImportsClass"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Enums")]
|
||||
public string OutputEnumsClass {
|
||||
get {
|
||||
return ((string)(this["OutputEnumsClass"]));
|
||||
}
|
||||
set {
|
||||
this["OutputEnumsClass"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Context")]
|
||||
public string OutputContextClass {
|
||||
get {
|
||||
return ((string)(this["OutputContextClass"]));
|
||||
}
|
||||
set {
|
||||
this["OutputContextClass"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
namespace OpenTK.OpenGL.Bind.Properties {
|
||||
|
||||
|
||||
// This class allows you to handle specific events on the settings class:
|
||||
// The SettingChanging event is raised before a setting's value is changed.
|
||||
// The PropertyChanged event is raised after a setting's value is changed.
|
||||
// The SettingsLoaded event is raised after the setting values are loaded.
|
||||
// The SettingsSaving event is raised before the setting values are saved.
|
||||
internal sealed partial class Bind {
|
||||
|
||||
public Bind() {
|
||||
// // To add event handlers for saving and changing settings, uncomment the lines below:
|
||||
//
|
||||
// this.SettingChanging += this.SettingChangingEventHandler;
|
||||
//
|
||||
// this.SettingsSaving += this.SettingsSavingEventHandler;
|
||||
//
|
||||
}
|
||||
|
||||
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
|
||||
// Add code to handle the SettingChangingEvent event here.
|
||||
}
|
||||
|
||||
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
|
||||
// Add code to handle the SettingsSaving event here.
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,8 +11,8 @@ namespace OpenTK.OpenGL.Bind
|
|||
{
|
||||
static class Settings
|
||||
{
|
||||
public static string InputPath = "..\\..\\Source\\OpenGL\\Specifications";
|
||||
public static string OutputPath = "..\\..\\Source\\OpenGL\\OpenGL\\Bindings";
|
||||
public static string InputPath = "..\\..\\..\\Source\\OpenGL\\Specifications";
|
||||
public static string OutputPath = "..\\..\\..\\Source\\OpenGL\\OpenGL\\Bindings";
|
||||
public static string GLClass = "GL";
|
||||
public static string OutputNamespace = "OpenTK.OpenGL";
|
||||
}
|
||||
|
|
|
@ -1,117 +0,0 @@
|
|||
#region License
|
||||
//Copyright (c) 2006 Stephen Apostolopoulos
|
||||
//See license.txt for license info
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
namespace OpenTK.OpenGL.Bind
|
||||
{
|
||||
static class ContextWriter
|
||||
{
|
||||
#region Write main context
|
||||
public static void WriteMainContext(string output_path, string class_name, string gl_class_name, List<Function> functions)
|
||||
{
|
||||
string filename = Path.Combine(output_path, "GLContextLoad.cs");
|
||||
|
||||
if (!Directory.Exists(Settings.OutputPath))
|
||||
Directory.CreateDirectory(Settings.OutputPath);
|
||||
|
||||
StreamWriter sw = new StreamWriter(filename, false);
|
||||
|
||||
Console.WriteLine("Writing Context.Load() function to {1}", class_name, filename);
|
||||
|
||||
SpecWriter.WriteLicense(sw);
|
||||
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine("using System.Runtime.InteropServices;");
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
sw.WriteLine(" public abstract partial class GLContext");
|
||||
sw.WriteLine(" {");
|
||||
|
||||
sw.WriteLine(" #region OpenGL function loading");
|
||||
sw.WriteLine();
|
||||
sw.WriteLine(" public virtual void Load()");
|
||||
sw.WriteLine(" {");
|
||||
|
||||
foreach (Function f in functions)
|
||||
{
|
||||
sw.WriteLine(" {2}.{0} = ({2}.Delegates.{0})GetAddress(\"gl{1}\", typeof({2}.Delegates.{0}));", f.Name, f.Name.TrimEnd('_'), gl_class_name);
|
||||
}
|
||||
|
||||
sw.WriteLine(" }");
|
||||
sw.WriteLine(" #endregion");
|
||||
sw.WriteLine(" }");
|
||||
sw.WriteLine("}");
|
||||
sw.WriteLine();
|
||||
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Write derived context
|
||||
public static void WriteDerivedContext(string output_path, string class_name, string gl_class_name, List<Function> functions, params string[] import_list)
|
||||
{
|
||||
string filename = Path.Combine(output_path, class_name + "Load.cs");
|
||||
|
||||
if (!Directory.Exists(Settings.OutputPath))
|
||||
Directory.CreateDirectory(Settings.OutputPath);
|
||||
|
||||
StreamWriter sw = new StreamWriter(filename, false);
|
||||
|
||||
Console.WriteLine("Writing {0}.Load() function to {1}", class_name, filename);
|
||||
|
||||
SpecWriter.WriteLicense(sw);
|
||||
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine("using System.Runtime.InteropServices;");
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("namespace {0}.Platform", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
sw.WriteLine(" public partial class {0}", class_name);
|
||||
sw.WriteLine(" {");
|
||||
|
||||
sw.WriteLine(" #region OpenGL core and extension function loading");
|
||||
sw.WriteLine();
|
||||
sw.WriteLine(" public override void Load()");
|
||||
sw.WriteLine(" {");
|
||||
sw.WriteLine(" base.Load();");
|
||||
|
||||
foreach (Function f in functions)
|
||||
{
|
||||
if (IsImportFunction(f, import_list))
|
||||
sw.WriteLine(" {0}.{1} = new {0}.Delegates.{1}({0}.Imports.{1});", gl_class_name, f.Name);
|
||||
}
|
||||
|
||||
sw.WriteLine(" }");
|
||||
sw.WriteLine(" #endregion");
|
||||
sw.WriteLine(" }");
|
||||
sw.WriteLine("}");
|
||||
sw.WriteLine();
|
||||
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region IsImport
|
||||
private static bool IsImportFunction(Function f, string[] import_list)
|
||||
{
|
||||
if (f.Extension)
|
||||
return false;
|
||||
|
||||
foreach (string version in import_list)
|
||||
if (f.Version == version)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -29,39 +29,39 @@ namespace OpenTK.OpenGL.Bind
|
|||
|
||||
private static void WriteExtensionFunctionSpecs(string output_path, string class_name, List<Function> functions, List<Function> wrappers)
|
||||
{
|
||||
string filename = Path.Combine(output_path, class_name + "Extensions.cs");
|
||||
//string filename = Path.Combine(output_path, class_name + "Extensions.cs");
|
||||
|
||||
if (!Directory.Exists(output_path))
|
||||
Directory.CreateDirectory(output_path);
|
||||
//if (!Directory.Exists(output_path))
|
||||
// Directory.CreateDirectory(output_path);
|
||||
|
||||
StreamWriter sw = new StreamWriter(filename, false);
|
||||
//StreamWriter sw = new StreamWriter(filename, false);
|
||||
|
||||
Console.WriteLine("Writing {0} class to {1}", class_name, filename);
|
||||
//Console.WriteLine("Writing {0} class to {1}", class_name, filename);
|
||||
|
||||
WriteLicense(sw);
|
||||
WriteUsingDirectives(sw);
|
||||
//WriteLicense(sw);
|
||||
//WriteUsingDirectives(sw);
|
||||
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
//sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
//sw.WriteLine("{");
|
||||
|
||||
WriteTypes(sw);
|
||||
//WriteTypes(sw);
|
||||
|
||||
sw.WriteLine(" static public partial class {0}", class_name);
|
||||
sw.WriteLine(" {");
|
||||
sw.WriteLine(" static public class Extensions");
|
||||
sw.WriteLine(" {");
|
||||
//sw.WriteLine(" static public partial class {0}", class_name);
|
||||
//sw.WriteLine(" {");
|
||||
//sw.WriteLine(" static public class Extensions");
|
||||
//sw.WriteLine(" {");
|
||||
|
||||
WriteExtensionFunctionSignatures(sw, functions);
|
||||
WriteExtensionFunctions(sw, functions);
|
||||
WriteExtensionWrappers(sw, wrappers);
|
||||
//WriteExtensionFunctionSignatures(sw, functions);
|
||||
//WriteExtensionFunctions(sw, functions);
|
||||
//WriteExtensionWrappers(sw, wrappers);
|
||||
|
||||
sw.WriteLine(" }");
|
||||
sw.WriteLine(" }");
|
||||
sw.WriteLine("}");
|
||||
sw.WriteLine();
|
||||
//sw.WriteLine(" }");
|
||||
//sw.WriteLine(" }");
|
||||
//sw.WriteLine("}");
|
||||
//sw.WriteLine();
|
||||
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
//sw.Flush();
|
||||
//sw.Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -17888,3 +17888,4 @@ namespace OpenTK.OpenGL
|
|||
#endregion static Constructor
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -5,16 +5,21 @@
|
|||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
|
||||
namespace OpenTK.OpenGL
|
||||
{
|
||||
#region ColorDepth struct
|
||||
|
||||
public struct ColorDepth
|
||||
public class ColorDepth
|
||||
{
|
||||
public byte Red, Green, Blue, Alpha;
|
||||
public bool IsIndexed = false;
|
||||
public int BitsPerPixel;
|
||||
|
||||
public ColorDepth(int bpp)
|
||||
{
|
||||
Red = Green = Blue = Alpha = 0;
|
||||
BitsPerPixel = bpp;
|
||||
|
||||
switch (bpp)
|
||||
{
|
||||
|
@ -31,18 +36,30 @@ namespace OpenTK.OpenGL
|
|||
case 15:
|
||||
Red = Green = Blue = 5;
|
||||
break;
|
||||
case 8:
|
||||
IsIndexed = true;
|
||||
break;
|
||||
case 4:
|
||||
IsIndexed = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public ColorDepth(byte red, byte green, byte blue, byte alpha)
|
||||
public ColorDepth(int red, int green, int blue, int alpha)
|
||||
{
|
||||
Red = red;
|
||||
Green = green;
|
||||
Blue = blue;
|
||||
Alpha = alpha;
|
||||
Red = (byte)red;
|
||||
Green = (byte)green;
|
||||
Blue = (byte)blue;
|
||||
Alpha = (byte)alpha;
|
||||
BitsPerPixel = red + green + blue + alpha;
|
||||
}
|
||||
|
||||
public byte Red, Green, Blue, Alpha;
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
return (obj is ColorDepth) ? (this == (ColorDepth)obj) : false;
|
||||
}
|
||||
|
||||
public static bool operator ==(ColorDepth left, ColorDepth right)
|
||||
{
|
||||
|
@ -56,7 +73,15 @@ namespace OpenTK.OpenGL
|
|||
{
|
||||
return !(left == right);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Red ^ Green ^ Blue ^ Alpha;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format(CultureInfo.CurrentCulture, "{0}", BitsPerPixel + (IsIndexed ? " indexed" : String.Empty) + " bpp");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,61 +1,238 @@
|
|||
#region License
|
||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
||||
* Contributions from Erik Ylvisaker
|
||||
* See license.txt for license info
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using OpenTK.OpenGL.Platform;
|
||||
|
||||
namespace OpenTK.OpenGL
|
||||
{
|
||||
public abstract partial class GLContext : IDisposable
|
||||
{
|
||||
#region Created property
|
||||
private bool _created = false;
|
||||
#region --- Private Variables ---
|
||||
|
||||
private Control control;
|
||||
private bool isDisposed = false;
|
||||
private bool isFullScreen = false;
|
||||
private GLContext fullScreenContext = null;
|
||||
|
||||
public bool Created
|
||||
{
|
||||
get { return _created; }
|
||||
set { _created = value; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
public abstract void SwapBuffers();
|
||||
public abstract System.Delegate GetAddress(string function_string, Type function_type);
|
||||
public abstract void MakeCurrent();
|
||||
#region --- Creation / Destruction ---
|
||||
|
||||
public abstract void Dispose();
|
||||
|
||||
public static GLContext Create(Control c, ColorDepth color, int depth, int stencil)
|
||||
/// <summary>
|
||||
/// Constructs a GLContext abstract base class.
|
||||
/// </summary>
|
||||
/// <param name="control"></param>
|
||||
protected GLContext(Control control)
|
||||
{
|
||||
try
|
||||
this.control = control;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finalizes the GLContext object.
|
||||
/// </summary>
|
||||
~GLContext()
|
||||
{
|
||||
if (isDisposed == false)
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes of the GLContext object. If called on a full-screen context, this
|
||||
/// will return the display resolution to the desktop settings.
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
if (isDisposed == false)
|
||||
{
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT || Environment.OSVersion.Platform == PlatformID.Win32Windows)
|
||||
{
|
||||
return new WindowsContext(c, color, depth, stencil);
|
||||
}
|
||||
//else if (Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version.Major >= 6)
|
||||
//{
|
||||
// return new WindowsVistaContext(c, red, green, blue, alpha, depth, stencil);
|
||||
//}
|
||||
else if (Environment.OSVersion.Platform == PlatformID.Unix)
|
||||
{
|
||||
return new X11Context(c, color, depth, stencil);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new PlatformNotSupportedException("The platform on which you are trying to run this program is not currently supported. Sorry for the inconvenience.");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show(e.ToString());
|
||||
return null;
|
||||
Dispose(true);
|
||||
|
||||
isDisposed = true;
|
||||
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override to provide platform-specific destruction methods.
|
||||
/// </summary>
|
||||
/// <param name="disposing"></param>
|
||||
protected abstract void Dispose(bool disposing);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an object driving from GLContext which handles the necessary
|
||||
/// details for interacting with the operating system the application is run on.
|
||||
/// </summary>
|
||||
/// <param name="c">The control to which the GLContext is bound. OpenGL rendering
|
||||
/// will occur within this control.</param>
|
||||
/// <param name="color">A structure indicating the color depth the application is requesting.</param>
|
||||
/// <param name="depth">The number of bits the depth buffer should contain.</param>
|
||||
/// <param name="stencil">The number of bits the stencil buffer should contain.</param>
|
||||
/// <returns>A GLContext object.</returns>
|
||||
public static GLContext Create(Control c, ColorDepth color, int depth, int stencil)
|
||||
{
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT ||
|
||||
Environment.OSVersion.Platform == PlatformID.Win32Windows)
|
||||
{
|
||||
return new WindowsContext(c, color, depth, stencil);
|
||||
}
|
||||
else if (Environment.OSVersion.Platform == PlatformID.Unix ||
|
||||
Environment.OSVersion.Platform == (PlatformID)128) // some older versions of Mono reported 128.
|
||||
{
|
||||
return new X11Context(c, color, depth, stencil);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new PlatformNotSupportedException("The platform on which you are trying to run this program is not currently supported. Sorry for the inconvenience.");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Public Properties ---
|
||||
|
||||
/// <summary>
|
||||
/// Returns the AspectRatio of the control this GLContext object
|
||||
/// renders to. This is usually used in a call to Glu.Perspective.
|
||||
/// </summary>
|
||||
public double AspectRatio
|
||||
{
|
||||
get
|
||||
{
|
||||
return control.Width / (double)control.Height;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the width of the render target control in pixels.
|
||||
/// </summary>
|
||||
public int Width
|
||||
{
|
||||
get { return control.Width; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the height of the render target control in pixels.
|
||||
/// </summary>
|
||||
public int Height
|
||||
{
|
||||
get { return control.Height; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the size of the render target control.
|
||||
/// </summary>
|
||||
public Size Size
|
||||
{
|
||||
get { return control.Size; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this context is managing a full-screen environment.
|
||||
/// Only one context can manage a full-screen environment at a time.
|
||||
/// </summary>
|
||||
public bool IsFullscreen
|
||||
{
|
||||
get { return isFullScreen; }
|
||||
protected set
|
||||
{
|
||||
CheckAnyFullScreen();
|
||||
|
||||
if (value)
|
||||
fullScreenContext = this;
|
||||
else if (fullScreenContext == this)
|
||||
fullScreenContext = null;
|
||||
|
||||
isFullScreen = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The WinForms Control that this GLContext is bound to.
|
||||
/// </summary>
|
||||
public Control Control
|
||||
{
|
||||
get { return control; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if this object has had its Dispose method called.
|
||||
/// If IsDisposed is true, no calls should be made on the context object.
|
||||
/// </summary>
|
||||
public bool IsDisposed
|
||||
{
|
||||
get { return isDisposed; }
|
||||
set { isDisposed = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Protected Helper Methods ---
|
||||
|
||||
/// <summary>
|
||||
/// This method checks to see if any context other than the current one is a full-screen
|
||||
/// context, and throws an exception if it is. This is meant to be called from inside
|
||||
/// an overriden SetFullScreen function.
|
||||
/// </summary>
|
||||
protected void CheckAnyFullScreen()
|
||||
{
|
||||
if (fullScreenContext == null || fullScreenContext == this)
|
||||
return;
|
||||
|
||||
throw new Exception("Already have a full screen context!");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Public Context Management Methods ---
|
||||
|
||||
/// <summary>
|
||||
/// Swaps buffers on a context. This presents the rendered scene to the user.
|
||||
/// </summary>
|
||||
public abstract void SwapBuffers();
|
||||
|
||||
/// <summary>
|
||||
/// Makes this context the current rendering target.
|
||||
/// </summary>
|
||||
public abstract void MakeCurrent();
|
||||
|
||||
/// <summary>
|
||||
/// Requests that the GLContext object set the screen to a particular resolution and color
|
||||
/// depth. Only one context can be set to be a full screen context at a time.
|
||||
/// </summary>
|
||||
/// <param name="width"></param>
|
||||
/// <param name="height"></param>
|
||||
/// <param name="color"></param>
|
||||
public abstract void SetFullScreen(int width, int height, OpenTK.OpenGL.ColorDepth color);
|
||||
|
||||
/// <summary>
|
||||
/// Restores the desktop resolution after a call to SetFullScreen.
|
||||
/// </summary>
|
||||
public abstract void SetWindowed();
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Display Mode Methods ---
|
||||
|
||||
public abstract DisplayMode[] EnumDisplayModes();
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Gets the address of an OpenGL extension function.
|
||||
/// </summary>
|
||||
/// <param name="function_string">The name of the OpenGL function (e.g. "glGetString")</param>
|
||||
/// <param name="function_type">The function signature.</param>
|
||||
/// <returns>A Delegate that can be used to call this function, or null if the function is not supported by the drivers.</returns>
|
||||
protected abstract System.Delegate GetAddress(string function_string, Type function_type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,19 @@
|
|||
#region License
|
||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
||||
* Contributions from Erik Ylvisaker
|
||||
* See license.txt for license info
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenTK.OpenGL;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
using System.Text;
|
||||
|
||||
using OpenTK.OpenGL;
|
||||
using OpenTK.Platform.Windows;
|
||||
|
||||
namespace OpenTK.OpenGL.Platform
|
||||
{
|
||||
|
@ -20,7 +25,8 @@ namespace OpenTK.OpenGL.Platform
|
|||
protected int _render_context;
|
||||
protected IntPtr _window_handle;
|
||||
|
||||
public WindowsContext(System.Windows.Forms.Control c, ColorDepth color, int depth, int stencil)
|
||||
public WindowsContext(Control c, ColorDepth color, int depth, int stencil)
|
||||
: base(c)
|
||||
{
|
||||
int error_code = 0;
|
||||
_window_handle = c.Handle;
|
||||
|
@ -28,9 +34,9 @@ namespace OpenTK.OpenGL.Platform
|
|||
// Dynamically load the OpenGL32.dll in order to use the extension loading capabilities of Wgl.
|
||||
if (_dll_handle == 0)
|
||||
{
|
||||
_dll_handle = OpenTK.Platform.Windows.Api.LoadLibrary(_dll_name);
|
||||
|
||||
_dll_handle = OpenTK.Platform.Windows.WinApi.LoadLibrary(_dll_name);
|
||||
error_code = Marshal.GetLastWin32Error();
|
||||
|
||||
if (error_code != 0)
|
||||
{
|
||||
//System.Diagnostics.Debug.WriteLine("LoadLibrary({0}) set error code: {1}. Will not load extensions.", _dll_name, error_code);
|
||||
|
@ -41,8 +47,8 @@ namespace OpenTK.OpenGL.Platform
|
|||
}
|
||||
}
|
||||
|
||||
_device_context = OpenTK.Platform.Windows.Api.GetDC(_window_handle.ToInt32());
|
||||
OpenTK.Platform.Windows.Api.PixelFormatDescriptor pixel_format = new OpenTK.Platform.Windows.Api.PixelFormatDescriptor();
|
||||
_device_context = OpenTK.Platform.Windows.WinApi.GetDC(_window_handle.ToInt32());
|
||||
OpenTK.Platform.Windows.WinApi.PixelFormatDescriptor pixel_format = new OpenTK.Platform.Windows.WinApi.PixelFormatDescriptor();
|
||||
|
||||
pixel_format.ColorBits = (byte)(color.Red + color.Green + color.Blue);
|
||||
pixel_format.RedBits = (byte)color.Red;
|
||||
|
@ -63,7 +69,7 @@ namespace OpenTK.OpenGL.Platform
|
|||
|
||||
if (depth <= 0)
|
||||
{
|
||||
pixel_format.Flags |= OpenTK.Platform.Windows.Api.PixelFormatDescriptorFlags.DEPTH_DONTCARE;
|
||||
pixel_format.Flags |= OpenTK.Platform.Windows.WinApi.PixelFormatDescriptorFlags.DEPTH_DONTCARE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -80,20 +86,22 @@ namespace OpenTK.OpenGL.Platform
|
|||
}
|
||||
*/
|
||||
|
||||
int pixel = OpenTK.Platform.Windows.Api.ChoosePixelFormat(_device_context, pixel_format);
|
||||
int pixel = OpenTK.Platform.Windows.WinApi.ChoosePixelFormat(_device_context, pixel_format);
|
||||
|
||||
if (pixel == 0)
|
||||
{
|
||||
// "The pixel format requested is not supported by the hardware configuration."
|
||||
throw new Exception("Pixel format not supported.");
|
||||
throw new Exception("The requested pixel format is not supported by the hardware configuration.");
|
||||
}
|
||||
|
||||
OpenTK.Platform.Windows.Api.SetPixelFormat(_device_context, pixel, pixel_format);
|
||||
OpenTK.Platform.Windows.WinApi.SetPixelFormat(_device_context, pixel, pixel_format);
|
||||
|
||||
_render_context = Wgl.CreateContext(_device_context);
|
||||
|
||||
MakeCurrent();
|
||||
|
||||
c.TopLevelControl.Move += new EventHandler(c_Move);
|
||||
c.Move += new EventHandler(c_Move);
|
||||
c.Resize += new EventHandler(c_Resize);
|
||||
//GL.Init();
|
||||
//new GL();
|
||||
|
||||
|
@ -101,12 +109,43 @@ namespace OpenTK.OpenGL.Platform
|
|||
// LoadExtensions();
|
||||
}
|
||||
|
||||
public override void SwapBuffers()
|
||||
void c_Resize(object sender, EventArgs e)
|
||||
{
|
||||
OpenTK.Platform.Windows.Api.SwapBuffers(_device_context);
|
||||
if (IsFullscreen)
|
||||
SetCursorClip();
|
||||
}
|
||||
|
||||
public override Delegate GetAddress(string function_string, Type function_type)
|
||||
void c_Move(object sender, EventArgs e)
|
||||
{
|
||||
if (IsFullscreen)
|
||||
SetCursorClip();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (IsFullscreen)
|
||||
SetWindowed();
|
||||
|
||||
if (_render_context != 0)
|
||||
Wgl.DeleteContext(_render_context);
|
||||
|
||||
if (_device_context != 0)
|
||||
OpenTK.Platform.Windows.WinApi.ReleaseDC(_window_handle.ToInt32(), _device_context);
|
||||
|
||||
if (_dll_handle != 0)
|
||||
OpenTK.Platform.Windows.WinApi.FreeLibrary(_dll_handle);
|
||||
|
||||
_render_context = 0;
|
||||
_device_context = 0;
|
||||
_dll_handle = 0;
|
||||
}
|
||||
|
||||
public override void SwapBuffers()
|
||||
{
|
||||
OpenTK.Platform.Windows.WinApi.SwapBuffers(_device_context);
|
||||
}
|
||||
|
||||
protected override Delegate GetAddress(string function_string, Type function_type)
|
||||
{
|
||||
IntPtr address = Wgl.GetProcAddress(function_string);
|
||||
if (address == IntPtr.Zero)
|
||||
|
@ -120,20 +159,87 @@ namespace OpenTK.OpenGL.Platform
|
|||
Wgl.MakeCurrent(_device_context, _render_context);
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
public override void SetWindowed()
|
||||
{
|
||||
if (_render_context != 0)
|
||||
Wgl.DeleteContext(_render_context);
|
||||
WinApi.ChangeDisplaySettings(null, 0);
|
||||
IsFullscreen = false;
|
||||
}
|
||||
|
||||
if (_device_context != 0)
|
||||
OpenTK.Platform.Windows.Api.ReleaseDC(_window_handle.ToInt32(), _device_context);
|
||||
public override void SetFullScreen(int width, int height, OpenTK.OpenGL.ColorDepth color)
|
||||
{
|
||||
CheckAnyFullScreen();
|
||||
|
||||
if (_dll_handle != 0)
|
||||
OpenTK.Platform.Windows.Api.FreeLibrary(_dll_handle);
|
||||
WinApi.DeviceMode ScreenSettings = new WinApi.DeviceMode();
|
||||
ScreenSettings.PelsWidth = width; // Selected Screen Width
|
||||
ScreenSettings.PelsHeight = height; // Selected Screen Height
|
||||
ScreenSettings.BitsPerPel = color.Alpha + // Selected Bits Per Pixel
|
||||
color.Red +
|
||||
color.Green +
|
||||
color.Blue;
|
||||
ScreenSettings.Fields = WinApi.Constants.DM_BITSPERPEL
|
||||
| WinApi.Constants.DM_PELSWIDTH
|
||||
| WinApi.Constants.DM_PELSHEIGHT;
|
||||
|
||||
_render_context = 0;
|
||||
_device_context = 0;
|
||||
_dll_handle = 0;
|
||||
// Try To Set Selected Mode And Get Results. NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
|
||||
if (WinApi.ChangeDisplaySettings(ScreenSettings,
|
||||
WinApi.Constants.CDS_FULLSCREEN) == WinApi.Constants.DISP_CHANGE_SUCCESSFUL)
|
||||
{
|
||||
IsFullscreen = true;
|
||||
|
||||
SetCursorClip();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Could not change full-screen resolution.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clips the cursor's available positions to within the render target.
|
||||
/// </summary>
|
||||
private void SetCursorClip()
|
||||
{
|
||||
Cursor.Clip = new Rectangle(this.Control.PointToScreen(Point.Empty), this.Control.Size);
|
||||
}
|
||||
|
||||
public override DisplayMode[] EnumDisplayModes()
|
||||
{
|
||||
List<DisplayMode> modes = new List<DisplayMode>();
|
||||
bool done = false;
|
||||
int index = 0;
|
||||
|
||||
while (!done)
|
||||
{
|
||||
WinApi.DeviceMode currentMode = new WinApi.DeviceMode();
|
||||
IntPtr handle = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(WinApi.DeviceMode)));
|
||||
Marshal.StructureToPtr(currentMode, handle, true);
|
||||
|
||||
done = (WinApi.EnumDisplaySettings(null, index++, handle) != 0) ? false : true;
|
||||
int error = Marshal.GetLastWin32Error();
|
||||
|
||||
Marshal.PtrToStructure(handle, currentMode);
|
||||
Marshal.FreeHGlobal(handle);
|
||||
|
||||
if (error != 0)
|
||||
{
|
||||
Console.WriteLine("Error: {0}", error);
|
||||
continue;
|
||||
}
|
||||
if (done)
|
||||
break;
|
||||
|
||||
//DisplayMode mode = new DisplayMode(currentMode.PelsWidth, currentMode.PelsHeight);
|
||||
DisplayMode mode = new DisplayMode(
|
||||
currentMode.PelsWidth,
|
||||
currentMode.PelsHeight,
|
||||
currentMode.BitsPerPel,
|
||||
currentMode.DisplayFrequency
|
||||
);
|
||||
|
||||
modes.Add(mode);
|
||||
}
|
||||
|
||||
return modes.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,72 +1,161 @@
|
|||
#region License
|
||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
||||
* Contributions from Erik Ylvisaker
|
||||
* See license.txt for license info
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using OpenTK.Platform.X;
|
||||
|
||||
namespace OpenTK.OpenGL.Platform
|
||||
{
|
||||
public partial class X11Context : OpenTK.OpenGL.GLContext
|
||||
{
|
||||
//private IntPtr drawable;
|
||||
private IntPtr Handle;
|
||||
private IntPtr GLXVisualInfo;
|
||||
private IntPtr context;
|
||||
private IntPtr glxVisualInfo;
|
||||
private IntPtr x11context;
|
||||
private IntPtr display;
|
||||
const string _dll_name = "libGL.so.1";
|
||||
private IntPtr rootWindow;
|
||||
private Type xplatui;
|
||||
private int screenNo;
|
||||
private Size fullScreenSize;
|
||||
|
||||
private IntPtr desktopResolution = IntPtr.Zero;
|
||||
|
||||
private int depthBits;
|
||||
private int stencilBits;
|
||||
|
||||
//const string _dll_name = "libGL.so.1";
|
||||
|
||||
public X11Context(Control c, ColorDepth color, int depth, int stencil)
|
||||
: base(c)
|
||||
{
|
||||
Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms");
|
||||
this.depthBits = depth;
|
||||
this.stencilBits = stencil;
|
||||
|
||||
Console.WriteLine("Creating X11Context.");
|
||||
|
||||
xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms");
|
||||
if (xplatui != null)
|
||||
{
|
||||
IntPtr display = (IntPtr)xplatui.GetField("DisplayHandle", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetValue(null);
|
||||
IntPtr RootWindow = (IntPtr)xplatui.GetField("RootWindow", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetValue(null);
|
||||
int ScreenNo = (int)xplatui.GetField("ScreenNo", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).GetValue(null);
|
||||
|
||||
Handle = c.Handle;
|
||||
Console.WriteLine("Got XplatUIX11 type.");
|
||||
|
||||
display = (IntPtr)xplatui.GetField("DisplayHandle",
|
||||
System.Reflection.BindingFlags.Static |
|
||||
System.Reflection.BindingFlags.NonPublic).GetValue(null);
|
||||
|
||||
rootWindow = (IntPtr)xplatui.GetField("RootWindow",
|
||||
System.Reflection.BindingFlags.Static |
|
||||
System.Reflection.BindingFlags.NonPublic).GetValue(null);
|
||||
|
||||
screenNo = (int)xplatui.GetField("ScreenNo",
|
||||
System.Reflection.BindingFlags.Static |
|
||||
System.Reflection.BindingFlags.NonPublic).GetValue(null);
|
||||
|
||||
Console.WriteLine("DisplayHandle: {0} RootWindow: {1} ScreenNo: {2}",
|
||||
display, rootWindow, screenNo);
|
||||
|
||||
int[] dblBuf = new int[]
|
||||
{
|
||||
5,
|
||||
(int)Glx.Enums.GLXAttribute.RGBA,
|
||||
(int)Glx.Enums.GLXAttribute.RED_SIZE, 1,
|
||||
(int)Glx.Enums.GLXAttribute.GREEN_SIZE, 1,
|
||||
(int)Glx.Enums.GLXAttribute.BLUE_SIZE, 1,
|
||||
(int)Glx.Enums.GLXAttribute.DEPTH_SIZE, 1,
|
||||
(int)Glx.Enums.GLXAttribute.RED_SIZE, color.Red,
|
||||
(int)Glx.Enums.GLXAttribute.GREEN_SIZE, color.Green,
|
||||
(int)Glx.Enums.GLXAttribute.BLUE_SIZE, color.Blue,
|
||||
(int)Glx.Enums.GLXAttribute.DEPTH_SIZE, depth,
|
||||
0
|
||||
};
|
||||
GLXVisualInfo = Glx.ChooseVisual(display, ScreenNo, dblBuf);
|
||||
|
||||
Api.VisualInfo xVisualInfo = (Api.VisualInfo)Marshal.PtrToStructure(GLXVisualInfo, typeof(Api.VisualInfo));
|
||||
IntPtr glxVisualInfo = Glx.ChooseVisual(display, screenNo, dblBuf);
|
||||
Console.WriteLine("GLXVisualInfo: {0}", glxVisualInfo);
|
||||
|
||||
X11Api.VisualInfo xVisualInfo = (X11Api.VisualInfo)
|
||||
Marshal.PtrToStructure(glxVisualInfo, typeof(X11Api.VisualInfo));
|
||||
|
||||
IntPtr visual = xVisualInfo.visual;
|
||||
IntPtr colormap = Api.CreateColormap(display, RootWindow, visual, 0/*AllocNone*/);
|
||||
IntPtr colormap = X11Api.CreateColormap(display, rootWindow, visual, 0/*AllocNone*/);
|
||||
|
||||
xplatui.GetField("CustomVisual", System.Reflection.BindingFlags.Static |
|
||||
System.Reflection.BindingFlags.NonPublic).SetValue(null, visual);
|
||||
|
||||
xplatui.GetField("CustomColormap", System.Reflection.BindingFlags.Static |
|
||||
System.Reflection.BindingFlags.NonPublic).SetValue(null, colormap);
|
||||
|
||||
Console.WriteLine("colormap: {0}", colormap);
|
||||
|
||||
x11context = Glx.CreateContext(display, glxVisualInfo, IntPtr.Zero, true);
|
||||
Console.WriteLine("x11context: {0}", x11context);
|
||||
|
||||
X11Api.XMapRaised(display, Control.TopLevelControl.Handle);
|
||||
|
||||
xplatui.GetField("CustomVisual", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(null, visual);
|
||||
xplatui.GetField("CustomColormap", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic).SetValue(null, colormap);
|
||||
|
||||
context = Glx.CreateContext(display, GLXVisualInfo, IntPtr.Zero, true);
|
||||
|
||||
MakeCurrent();
|
||||
|
||||
//GL.Init();
|
||||
//new GL();
|
||||
X11Api.Free(glxVisualInfo);
|
||||
}
|
||||
|
||||
c.MouseDown += new MouseEventHandler(c_MouseDown);
|
||||
c.MouseLeave += new EventHandler(c_MouseLeave);
|
||||
c.MouseUp += new MouseEventHandler(c_MouseUp);
|
||||
}
|
||||
|
||||
void c_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (IsFullscreen)
|
||||
GrabPointer();
|
||||
}
|
||||
|
||||
void c_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
Console.WriteLine("{0}", Cursor.Position);
|
||||
|
||||
if (Cursor.Position.X > fullScreenSize.Width)
|
||||
Cursor.Position = new Point(fullScreenSize.Width, Cursor.Position.Y);
|
||||
if (Cursor.Position.Y > fullScreenSize.Height)
|
||||
Cursor.Position = new Point(Cursor.Position.X, fullScreenSize.Height);
|
||||
|
||||
ResetViewport();
|
||||
}
|
||||
|
||||
void c_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (IsFullscreen)
|
||||
GrabPointer();
|
||||
}
|
||||
|
||||
void c_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
if (IsFullscreen)
|
||||
GrabPointer();
|
||||
}
|
||||
|
||||
public override void MakeCurrent()
|
||||
{
|
||||
bool result = Glx.MakeCurrent(display, this.Control.Handle, x11context);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
Console.WriteLine("Failed to make context {0} current.", x11context);
|
||||
// probably need to recreate context here.
|
||||
}
|
||||
}
|
||||
|
||||
public override void SwapBuffers()
|
||||
{
|
||||
Glx.SwapBuffers(display, Handle);
|
||||
Glx.SwapBuffers(display, this.Control.Handle);
|
||||
}
|
||||
|
||||
public override Delegate GetAddress(string function_string, Type function_type)
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
SetWindowed();
|
||||
|
||||
Glx.DestroyContext(display, x11context);
|
||||
}
|
||||
|
||||
protected override Delegate GetAddress(string function_string, Type function_type)
|
||||
{
|
||||
IntPtr address = Glx.GetProcAddress(function_string);
|
||||
if (address == IntPtr.Zero)
|
||||
|
@ -75,16 +164,197 @@ namespace OpenTK.OpenGL.Platform
|
|||
return Marshal.GetDelegateForFunctionPointer(address, function_type);
|
||||
}
|
||||
|
||||
public override void MakeCurrent()
|
||||
public override void SetWindowed()
|
||||
{
|
||||
Glx.MakeCurrent(display, Handle, context);
|
||||
if (desktopResolution != IntPtr.Zero)
|
||||
{
|
||||
// set the resolution back to the desktop mode.
|
||||
X11Api.XUngrabPointer(display, 0);
|
||||
X11Api.XUngrabKeyboard(display, 0);
|
||||
|
||||
X11Api.XF86VidModeSwitchToMode(display, 0, desktopResolution);
|
||||
|
||||
Marshal.FreeHGlobal(desktopResolution);
|
||||
desktopResolution = IntPtr.Zero;
|
||||
|
||||
IsFullscreen = false;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
public override void SetFullScreen(int width, int height, ColorDepth color)
|
||||
{
|
||||
//throw new Exception("The method or operation is not implemented.");
|
||||
Glx.DestroyContext(context);
|
||||
Api.CloseDisplay(display);
|
||||
CheckAnyFullScreen();
|
||||
|
||||
// query and output the version of the video mode extension.
|
||||
int majorVersion, minorVersion;
|
||||
X11Api.XF86VidModeQueryVersion(display, out majorVersion, out minorVersion);
|
||||
Console.WriteLine("XFree86 Video Mode Extension version {0}.{1}", majorVersion, minorVersion);
|
||||
|
||||
// get the list of display modes
|
||||
X11Api.XF86VidModeModeInfo[] modeList = GetXDisplayModeList();
|
||||
|
||||
int selectedMode = 0;
|
||||
|
||||
for (int i = 0; i < modeList.Length; i++)
|
||||
{
|
||||
Console.Write(" ");
|
||||
|
||||
if (selectedMode == 0 &&
|
||||
modeList[i].hdisplay == width && modeList[i].vdisplay == height)
|
||||
{
|
||||
selectedMode = i;
|
||||
Console.Write("*");
|
||||
}
|
||||
else
|
||||
Console.Write(" ");
|
||||
|
||||
Console.Write("Mode #{0}: {1}x{2}", i,
|
||||
modeList[i].hdisplay, modeList[i].vdisplay);
|
||||
|
||||
if (i % 3 == 0 && i > 0)
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
// store the resolution of the desktop.
|
||||
desktopResolution = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(X11Api.XF86VidModeModeInfo)));
|
||||
Marshal.StructureToPtr(modeList[0], desktopResolution, true);
|
||||
|
||||
Console.WriteLine("Attempting to set resolutions to {0}x{1}", width, height);
|
||||
if (selectedMode == 0)
|
||||
Console.WriteLine("--- Failed to find an appropriate mode.");
|
||||
|
||||
fullScreenSize = new Size(width, height);
|
||||
SwitchDisplayMode(modeList[selectedMode]);
|
||||
|
||||
GrabPointer();
|
||||
BindColorMap(color, depthBits, stencilBits);
|
||||
|
||||
this.IsFullscreen = true;
|
||||
}
|
||||
|
||||
private void BindColorMap(ColorDepth color, int depth, int stencil)
|
||||
{
|
||||
int[] dblBuf = new int[]
|
||||
{
|
||||
5,
|
||||
(int)Glx.Enums.GLXAttribute.RGBA,
|
||||
(int)Glx.Enums.GLXAttribute.RED_SIZE, color.Red,
|
||||
(int)Glx.Enums.GLXAttribute.GREEN_SIZE, color.Green,
|
||||
(int)Glx.Enums.GLXAttribute.BLUE_SIZE, color.Blue,
|
||||
(int)Glx.Enums.GLXAttribute.DEPTH_SIZE, depth,
|
||||
0
|
||||
};
|
||||
|
||||
glxVisualInfo = Glx.ChooseVisual(display, screenNo, dblBuf);
|
||||
|
||||
X11Api.VisualInfo xVisualInfo = (X11Api.VisualInfo)Marshal.PtrToStructure
|
||||
(glxVisualInfo, typeof(X11Api.VisualInfo));
|
||||
|
||||
IntPtr visual = xVisualInfo.visual;
|
||||
IntPtr colormap = X11Api.CreateColormap(display, rootWindow, visual, 0/*AllocNone*/);
|
||||
|
||||
xplatui.GetField("CustomVisual", System.Reflection.BindingFlags.Static |
|
||||
System.Reflection.BindingFlags.NonPublic).SetValue(null, visual);
|
||||
xplatui.GetField("CustomColormap", System.Reflection.BindingFlags.Static |
|
||||
System.Reflection.BindingFlags.NonPublic).SetValue(null, colormap);
|
||||
|
||||
|
||||
X11Api.Free(glxVisualInfo);
|
||||
}
|
||||
|
||||
private void GrabPointer()
|
||||
{
|
||||
Console.Write("Grabbing pointer... ");
|
||||
X11Api.ErrorCodes retval = X11Api.XGrabPointer(display, this.Control.Handle, true, 0,
|
||||
X11Api.GrabMode.Async, X11Api.GrabMode.Async,
|
||||
this.Control.Handle, IntPtr.Zero, 0);
|
||||
|
||||
Console.WriteLine(retval.ToString());
|
||||
|
||||
Console.Write("Grabbing keyboard... ");
|
||||
retval = X11Api.XGrabKeyboard(display, this.Control.Handle, true,
|
||||
X11Api.GrabMode.Async, X11Api.GrabMode.Async, 0);
|
||||
|
||||
Console.WriteLine(retval.ToString());
|
||||
|
||||
ResetViewport();
|
||||
}
|
||||
|
||||
private void SwitchDisplayMode(X11Api.XF86VidModeModeInfo mode)
|
||||
{
|
||||
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(mode));
|
||||
Marshal.StructureToPtr(mode, ptr, true);
|
||||
|
||||
X11Api.XF86VidModeSwitchToMode(display, screenNo, ptr);
|
||||
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
|
||||
ResetViewport();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resets the viewport for full screen modes.
|
||||
/// X does this thing where if your screen resolution is smaller than your desktop resolution,
|
||||
/// you can scroll around. This resets the part of the desktop you're looking at to the
|
||||
/// upper left.
|
||||
/// </summary>
|
||||
private void ResetViewport()
|
||||
{
|
||||
X11Api.XF86VidModeSetViewPort(display, screenNo, 0, 0);
|
||||
}
|
||||
|
||||
public override DisplayMode[] EnumDisplayModes()
|
||||
{
|
||||
List<DisplayMode> modes = new List<DisplayMode>();
|
||||
|
||||
X11Api.XF86VidModeModeInfo[] list= GetXDisplayModeList();
|
||||
|
||||
for (int i = 0; i < list.Length; i++)
|
||||
{
|
||||
modes.Add(new DisplayMode(list[i].hdisplay, list[i].vdisplay));
|
||||
|
||||
}
|
||||
|
||||
return modes.ToArray();
|
||||
}
|
||||
|
||||
|
||||
private X11Api.XF86VidModeModeInfo[] GetXDisplayModeList()
|
||||
{
|
||||
|
||||
// get a list of all the video modes.
|
||||
int modeCount;
|
||||
IntPtr modesInfoPtr;
|
||||
X11Api.XF86VidModeGetAllModeLines(display, screenNo, out modeCount, out modesInfoPtr);
|
||||
Console.WriteLine("Video mode query returned {0} available modes.", modeCount);
|
||||
|
||||
// modesInfo now contains a pointer to an array of pointers to XF86VidModeModeInfo structures.
|
||||
// first, we need to copy these pointers to an array of intptr's, then we can copy the
|
||||
// structures pointed to.
|
||||
IntPtr[] modesInfo = new IntPtr[modeCount];
|
||||
|
||||
// have to use unsafe here, because apparently Mono is missing the Marshal.Copy function??
|
||||
Marshal.Copy(modesInfoPtr, modesInfo, 0, modeCount);
|
||||
//unsafe
|
||||
//{
|
||||
// IntPtr* ptr = (IntPtr*)modesInfoPtr;
|
||||
// for (int i = 0; i < modeCount; i++)
|
||||
// modesInfo[i] = ptr[i];
|
||||
//}
|
||||
|
||||
X11Api.XF86VidModeModeInfo[] modeList = new X11Api.XF86VidModeModeInfo[modeCount];
|
||||
|
||||
|
||||
for (int i = 0; i < modeCount; i++)
|
||||
{
|
||||
modeList[i] = (X11Api.XF86VidModeModeInfo)
|
||||
Marshal.PtrToStructure(modesInfo[i], typeof(X11Api.XF86VidModeModeInfo));
|
||||
}
|
||||
|
||||
X11Api.Free(modesInfoPtr);
|
||||
return modeList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
83
Source/OpenGL/OpenGL/DisplayMode.cs
Normal file
83
Source/OpenGL/OpenGL/DisplayMode.cs
Normal file
|
@ -0,0 +1,83 @@
|
|||
#region License
|
||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
||||
* See license.txt for license info
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
|
||||
namespace OpenTK.OpenGL
|
||||
{
|
||||
public class DisplayMode
|
||||
{
|
||||
#region --- Private Variables ---
|
||||
|
||||
private Size size;
|
||||
private ColorDepth color;
|
||||
private int displayFrequency;
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- Public Properties ---
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Size of the DisplayMode.
|
||||
/// </summary>
|
||||
public Size Size
|
||||
{
|
||||
get { return size; }
|
||||
set { size = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Height of the DisplayMode. Height is the vertical span measured in pixels.
|
||||
/// </summary>
|
||||
public int Height
|
||||
{
|
||||
get { return size.Height; }
|
||||
set { size.Height = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Width of the DisplayMode. Width is the horizontal span measured in pixels.
|
||||
/// </summary>
|
||||
public int Width
|
||||
{
|
||||
get { return size.Width; }
|
||||
set { size.Width = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a DisplayMode.
|
||||
/// </summary>
|
||||
/// <param name="width">The Width of the DisplayMode in pixels.</param>
|
||||
/// <param name="height">The Height of the DisplayMode in pixels.</param>
|
||||
public DisplayMode(int width, int height)
|
||||
:this(width, height, 0, 0, 0, 0, 0)
|
||||
{
|
||||
}
|
||||
|
||||
public DisplayMode(int width, int height, int bpp, int frequency)
|
||||
:this(width, height, 0, 0, 0, 0, frequency)
|
||||
{
|
||||
color = new ColorDepth(bpp);
|
||||
}
|
||||
|
||||
public DisplayMode(int width, int height, int r, int g, int b, int a, int frequency)
|
||||
{
|
||||
size = new Size(width, height);
|
||||
color = new ColorDepth(r, g, b, a);
|
||||
displayFrequency = frequency;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format(CultureInfo.CurrentCulture, "{0}x{1}, {2}, {3}Hz", Width, Height, color, displayFrequency);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
#region License
|
||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
||||
* Contributions from Erik Ylvisaker
|
||||
* See license.txt for license info
|
||||
*/
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -272,10 +273,10 @@ namespace OpenTK.OpenGL
|
|||
//public static extern IntPtr CreateContext(IntPtr gc_id, Int32 screen, Int32 visual, IntPtr share_list);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "glXDestroyContext")]
|
||||
public static extern void DestroyContext(IntPtr context);
|
||||
public static extern void DestroyContext(IntPtr dpy, IntPtr context);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "glXMakeCurrent")]
|
||||
public static extern void MakeCurrent(IntPtr display, IntPtr drawable, IntPtr context);
|
||||
public static extern bool MakeCurrent(IntPtr display, IntPtr drawable, IntPtr context);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "glXSwapBuffers")]
|
||||
public static extern void SwapBuffers(IntPtr display, IntPtr drawable);
|
||||
|
|
|
@ -1,81 +0,0 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{836876D1-0C8D-4240-BEE4-859D9D3D46CB}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenTK.OpenGL</RootNamespace>
|
||||
<AssemblyName>OpenTK.OpenGL</AssemblyName>
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
|
||||
<NoStdLib>False</NoStdLib>
|
||||
<RegisterForComInterop>False</RegisterForComInterop>
|
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
|
||||
<BaseAddress>4194304</BaseAddress>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>Full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\Binaries\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\..\Binaries\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System">
|
||||
<HintPath>H:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<HintPath>H:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms">
|
||||
<HintPath>H:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<HintPath>H:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Bindings\GL.cs" />
|
||||
<Compile Include="Bindings\GLEnums.cs" />
|
||||
<Compile Include="Contexts\WindowsContext.cs" />
|
||||
<Compile Include="GL.cs" />
|
||||
<Compile Include="Glu.cs" />
|
||||
<Compile Include="Contexts\GLContext.cs" />
|
||||
<Compile Include="Contexts\X11Context.cs" />
|
||||
<Compile Include="Glx.cs" />
|
||||
<Compile Include="Structures.cs" />
|
||||
<Compile Include="Wgl.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Platform\Windows\OpenTK.Platform.Windows.csproj">
|
||||
<Project>{FDFA00B6-FA81-4658-86E1-F312EFB42E1C}</Project>
|
||||
<Name>OpenTK.Platform.Windows</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Platform\X\OpenTK.Platform.X.csproj">
|
||||
<Project>{E3F35BD6-67CE-4AD5-AB98-043CF072A75A}</Project>
|
||||
<Name>OpenTK.Platform.X</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Documentation\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||
</Project>
|
|
@ -1,42 +0,0 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{FDFA00B6-FA81-4658-86E1-F312EFB42E1C}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenTK.Platform.Windows</RootNamespace>
|
||||
<AssemblyName>OpenTK.Platform.Windows</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\Binaries\Debug\Libraries\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\..\Binaries\Release\Libraries\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WinAPI.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -1,11 +1,11 @@
|
|||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
||||
* Contributions from Erik Ylvisaker
|
||||
* See license.txt for license info
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
//using System.Windows.Forms;
|
||||
|
||||
/* TODO: Update the description of TimeBeginPeriod and other native methods. Update Timer. */
|
||||
|
||||
|
@ -15,7 +15,7 @@ namespace OpenTK.Platform.Windows
|
|||
/// For internal use by OpenTK only!
|
||||
/// Exposes useful native WINAPI methods and structures.
|
||||
/// </summary>
|
||||
public static class Api
|
||||
public static class WinApi
|
||||
{
|
||||
#region Constants
|
||||
public struct Constants
|
||||
|
@ -407,7 +407,8 @@ namespace OpenTK.Platform.Windows
|
|||
#region EnumDisplaySettings
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
public static extern int EnumDisplaySettings([MarshalAs(UnmanagedType.LPTStr)] string device_name, int graphics_mode, DeviceMode device_mode);
|
||||
public static extern int EnumDisplaySettings([MarshalAs(UnmanagedType.LPTStr)] string device_name,
|
||||
int graphics_mode, IntPtr device_mode);
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -588,8 +589,60 @@ namespace OpenTK.Platform.Windows
|
|||
#endregion
|
||||
|
||||
#region DeviceMode class
|
||||
/*
|
||||
typedef struct _devicemode {
|
||||
BCHAR dmDeviceName[CCHDEVICENAME];
|
||||
WORD dmSpecVersion;
|
||||
WORD dmDriverVersion;
|
||||
WORD dmSize;
|
||||
WORD dmDriverExtra;
|
||||
DWORD dmFields;
|
||||
union {
|
||||
struct {
|
||||
short dmOrientation;
|
||||
short dmPaperSize;
|
||||
short dmPaperLength;
|
||||
short dmPaperWidth;
|
||||
short dmScale;
|
||||
short dmCopies;
|
||||
short dmDefaultSource;
|
||||
short dmPrintQuality;
|
||||
};
|
||||
POINTL dmPosition;
|
||||
DWORD dmDisplayOrientation;
|
||||
DWORD dmDisplayFixedOutput;
|
||||
};
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
short dmColor;
|
||||
short dmDuplex;
|
||||
short dmYResolution;
|
||||
short dmTTOption;
|
||||
short dmCollate;
|
||||
BYTE dmFormName[CCHFORMNAME];
|
||||
WORD dmLogPixels;
|
||||
DWORD dmBitsPerPel;
|
||||
DWORD dmPelsWidth;
|
||||
DWORD dmPelsHeight;
|
||||
union {
|
||||
DWORD dmDisplayFlags;
|
||||
DWORD dmNup;
|
||||
}
|
||||
DWORD dmDisplayFrequency;
|
||||
#if(WINVER >= 0x0400)
|
||||
DWORD dmICMMethod;
|
||||
DWORD dmICMIntent;
|
||||
DWORD dmMediaType;
|
||||
DWORD dmDitherType;
|
||||
DWORD dmReserved1;
|
||||
DWORD dmReserved2;
|
||||
#if (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400)
|
||||
DWORD dmPanningWidth;
|
||||
DWORD dmPanningHeight;
|
||||
#endif
|
||||
#endif
|
||||
} DEVMODE;
|
||||
*/
|
||||
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
|
||||
public class DeviceMode
|
||||
{
|
||||
public DeviceMode()
|
||||
|
@ -604,6 +657,7 @@ namespace OpenTK.Platform.Windows
|
|||
private short Size;
|
||||
public short DriverExtra;
|
||||
public int Fields;
|
||||
|
||||
public short Orientation;
|
||||
public short PaperSize;
|
||||
public short PaperLength;
|
||||
|
@ -612,6 +666,7 @@ namespace OpenTK.Platform.Windows
|
|||
public short Copies;
|
||||
public short DefaultSource;
|
||||
public short PrintQuality;
|
||||
|
||||
public short Color;
|
||||
public short Duplex;
|
||||
public short YResolution;
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{E3F35BD6-67CE-4AD5-AB98-043CF072A75A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>X</RootNamespace>
|
||||
<AssemblyName>X</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="XApi.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -1,73 +0,0 @@
|
|||
#region License
|
||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
||||
* See license.txt for license info
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace OpenTK.Platform.X
|
||||
{
|
||||
public static class Api
|
||||
{
|
||||
private const string _dll_name = "libX11";
|
||||
|
||||
public struct Constants
|
||||
{
|
||||
public const int QueuedAlready = 0;
|
||||
public const int QueuedAfterReading = 1;
|
||||
public const int QueuedAfterFlush = 2;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct VisualInfo
|
||||
{
|
||||
public IntPtr visual;
|
||||
public int visualid;
|
||||
public int screen;
|
||||
public uint depth;
|
||||
public int @class;
|
||||
public ulong red_mask;
|
||||
public ulong green_mask;
|
||||
public ulong blue_mask;
|
||||
public int colormap_size;
|
||||
public int bits_per_rgb;
|
||||
}
|
||||
|
||||
#region Functions
|
||||
|
||||
// Display management
|
||||
[DllImport(_dll_name, EntryPoint = "XOpenDisplay")]
|
||||
extern public static IntPtr OpenDisplay([MarshalAs(UnmanagedType.LPTStr)] string display_name);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XCloseDisplay")]
|
||||
extern public static void CloseDisplay(IntPtr display);
|
||||
|
||||
//
|
||||
|
||||
[DllImport("libX11", EntryPoint = "XCreateColormap")]
|
||||
extern public static IntPtr CreateColormap(IntPtr display, IntPtr window, IntPtr visual, int alloc);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XDefaultScreen")]
|
||||
extern public static int DefaultScreen(IntPtr display);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XDefaultVisual")]
|
||||
extern public static IntPtr DefaultVisual(IntPtr display, int screen_number);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XFree")]
|
||||
extern public static void Free(IntPtr data);
|
||||
|
||||
// Queue management
|
||||
[DllImport(_dll_name, EntryPoint = "XEventsQueued")]
|
||||
extern public static int EventsQueued(IntPtr Display, int mode);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XPending")]
|
||||
extern public static int Pending(IntPtr Display);
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
395
Source/Platform/X11/XApi.cs
Normal file
395
Source/Platform/X11/XApi.cs
Normal file
|
@ -0,0 +1,395 @@
|
|||
#region License
|
||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
||||
* Contributions from Erik Ylvisaker
|
||||
* See license.txt for license info
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace OpenTK.Platform.X
|
||||
{
|
||||
public static class X11Api
|
||||
{
|
||||
private const string _dll_name = "libX11";
|
||||
private const string _dll_name_vid = "libXxf86vm";
|
||||
|
||||
#region X11 Constants
|
||||
|
||||
public struct Constants
|
||||
{
|
||||
public const int QueuedAlready = 0;
|
||||
public const int QueuedAfterReading = 1;
|
||||
public const int QueuedAfterFlush = 2;
|
||||
}
|
||||
|
||||
public enum ErrorCodes : int
|
||||
{
|
||||
Success = 0,
|
||||
BadRequest = 1,
|
||||
BadValue = 2,
|
||||
BadWindow = 3,
|
||||
BadPixmap = 4,
|
||||
BadAtom = 5,
|
||||
BadCursor = 6,
|
||||
BadFont = 7,
|
||||
BadMatch = 8,
|
||||
BadDrawable = 9,
|
||||
BadAccess = 10,
|
||||
BadAlloc = 11,
|
||||
BadColor = 12,
|
||||
BadGC = 13,
|
||||
BadIDChoice = 14,
|
||||
BadName = 15,
|
||||
BadLength = 16,
|
||||
BadImplementation = 17,
|
||||
}
|
||||
public enum GrabMode : int
|
||||
{
|
||||
Sync = 0,
|
||||
Async = 1,
|
||||
}
|
||||
#endregion
|
||||
#region X11 Structures
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct VisualInfo
|
||||
{
|
||||
public IntPtr visual;
|
||||
public int visualid;
|
||||
public int screen;
|
||||
public uint depth;
|
||||
public int @class;
|
||||
public ulong red_mask;
|
||||
public ulong green_mask;
|
||||
public ulong blue_mask;
|
||||
public int colormap_size;
|
||||
public int bits_per_rgb;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region libX11 Functions
|
||||
|
||||
// Display management
|
||||
[DllImport(_dll_name, EntryPoint = "XOpenDisplay")]
|
||||
extern public static IntPtr OpenDisplay([MarshalAs(UnmanagedType.LPTStr)] string display_name);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XCloseDisplay")]
|
||||
extern public static void CloseDisplay(IntPtr display);
|
||||
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XCreateColormap")]
|
||||
extern public static int XResizeWindow(IntPtr display, IntPtr window, int width, int height);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XCreateColormap")]
|
||||
extern public static IntPtr CreateColormap(IntPtr display, IntPtr window, IntPtr visual, int alloc);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XDefaultScreen")]
|
||||
extern public static int DefaultScreen(IntPtr display);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XDefaultVisual")]
|
||||
extern public static IntPtr DefaultVisual(IntPtr display, int screen_number);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XFree")]
|
||||
extern public static void Free(IntPtr data);
|
||||
|
||||
// Queue management
|
||||
[DllImport(_dll_name, EntryPoint = "XEventsQueued")]
|
||||
extern public static int EventsQueued(IntPtr Display, int mode);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XPending")]
|
||||
extern public static int Pending(IntPtr Display);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XGrabPointer")]
|
||||
extern public static ErrorCodes XGrabPointer(IntPtr display, IntPtr grab_window,
|
||||
bool owner_events, uint event_mask, GrabMode pointer_mode,
|
||||
GrabMode keyboard_mode, IntPtr confine_to, IntPtr cursor, int time);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XUngrabPointer")]
|
||||
extern public static ErrorCodes XUngrabPointer(IntPtr display, int time);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XGrabKeyboard")]
|
||||
extern public static ErrorCodes XGrabKeyboard(IntPtr display, IntPtr grab_window,
|
||||
bool owner_events, GrabMode pointer_mode, GrabMode keyboard_mode, int time);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XUngrabKeyboard")]
|
||||
extern public static void XUngrabKeyboard(IntPtr display, int time);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XMapWindow")]
|
||||
extern public static void XMapWindow(IntPtr display, IntPtr window);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "XMapRaised")]
|
||||
extern public static void XMapRaised(IntPtr display, IntPtr window);
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Xf86VidMode public structures
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct XF86VidModeModeLine
|
||||
{
|
||||
ushort hdisplay; /* Number of display pixels horizontally */
|
||||
ushort hsyncstart; /* Horizontal sync start */
|
||||
ushort hsyncend; /* Horizontal sync end */
|
||||
ushort htotal; /* Total horizontal pixels */
|
||||
ushort vdisplay; /* Number of display pixels vertically */
|
||||
ushort vsyncstart; /* Vertical sync start */
|
||||
ushort vsyncend; /* Vertical sync start */
|
||||
ushort vtotal; /* Total vertical pixels */
|
||||
uint flags; /* Mode flags */
|
||||
int privsize; /* Size of private */
|
||||
IntPtr _private; /* Server privates */
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an XF86 display mode.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct XF86VidModeModeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Pixel clock.
|
||||
/// </summary>
|
||||
public uint dotclock;
|
||||
|
||||
/// <summary>
|
||||
/// Number of display pixels horizontally
|
||||
/// </summary>
|
||||
public ushort hdisplay;
|
||||
|
||||
/// <summary>
|
||||
/// Horizontal sync start
|
||||
/// </summary>
|
||||
public ushort hsyncstart;
|
||||
|
||||
/// <summary>
|
||||
/// Horizontal sync end
|
||||
/// </summary>
|
||||
public ushort hsyncend;
|
||||
|
||||
/// <summary>
|
||||
/// Total horizontal pixel
|
||||
/// </summary>
|
||||
public ushort htotal;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public ushort hskew;
|
||||
|
||||
/// <summary>
|
||||
/// Number of display pixels vertically
|
||||
/// </summary>
|
||||
public ushort vdisplay;
|
||||
|
||||
/// <summary>
|
||||
/// Vertical sync start
|
||||
/// </summary>
|
||||
public ushort vsyncstart;
|
||||
|
||||
/// <summary>
|
||||
/// Vertical sync end
|
||||
/// </summary>
|
||||
public ushort vsyncend;
|
||||
|
||||
/// <summary>
|
||||
/// Total vertical pixels
|
||||
/// </summary>
|
||||
public ushort vtotal;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public ushort vskew;
|
||||
|
||||
/// <summary>
|
||||
/// Mode flags
|
||||
/// </summary>
|
||||
public uint flags;
|
||||
|
||||
int privsize; /* Size of private */
|
||||
IntPtr _private; /* Server privates */
|
||||
}
|
||||
|
||||
//Monitor information:
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct XF86VidModeMonitor
|
||||
{
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
string vendor; /* Name of manufacturer */
|
||||
[MarshalAs(UnmanagedType.LPStr)]
|
||||
string model; /* Model name */
|
||||
float EMPTY; /* unused, for backward compatibility */
|
||||
byte nhsync; /* Number of horiz sync ranges */
|
||||
/*XF86VidModeSyncRange* */
|
||||
IntPtr hsync;/* Horizontal sync ranges */
|
||||
byte nvsync; /* Number of vert sync ranges */
|
||||
/*XF86VidModeSyncRange* */
|
||||
IntPtr vsync;/* Vertical sync ranges */
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct XF86VidModeSyncRange
|
||||
{
|
||||
float hi; /* Top of range */
|
||||
float lo; /* Bottom of range */
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct XF86VidModeNotifyEvent
|
||||
{
|
||||
int type; /* of event */
|
||||
ulong serial; /* # of last request processed by server */
|
||||
bool send_event; /* true if this came from a SendEvent req */
|
||||
IntPtr display; /* Display the event was read from */
|
||||
IntPtr root; /* root window of event screen */
|
||||
int state; /* What happened */
|
||||
int kind; /* What happened */
|
||||
bool forced; /* extents of new region */
|
||||
/* Time */
|
||||
IntPtr time; /* event timestamp */
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct XF86VidModeGamma
|
||||
{
|
||||
float red; /* Red Gamma value */
|
||||
float green; /* Green Gamma value */
|
||||
float blue; /* Blue Gamma value */
|
||||
}
|
||||
#endregion
|
||||
#region libXxf86vm Functions
|
||||
|
||||
[DllImport(_dll_name_vid)]
|
||||
extern public static bool XF86VidModeQueryExtension(
|
||||
IntPtr display,
|
||||
out int event_base_return,
|
||||
out int error_base_return);
|
||||
/*
|
||||
[DllImport(_dll_name_vid)]
|
||||
extern public static bool XF86VidModeSwitchMode(
|
||||
IntPtr display,
|
||||
int screen,
|
||||
int zoom);
|
||||
*/
|
||||
|
||||
[DllImport(_dll_name_vid)]
|
||||
extern public static bool XF86VidModeSwitchToMode(
|
||||
IntPtr display,
|
||||
int screen,
|
||||
IntPtr
|
||||
/*XF86VidModeModeInfo* */ modeline);
|
||||
|
||||
|
||||
[DllImport(_dll_name_vid)]
|
||||
extern public static bool XF86VidModeQueryVersion(
|
||||
IntPtr display,
|
||||
out int major_version_return,
|
||||
out int minor_version_return);
|
||||
|
||||
[DllImport(_dll_name_vid)]
|
||||
extern public static bool XF86VidModeGetAllModeLines(
|
||||
IntPtr display,
|
||||
int screen,
|
||||
out int modecount_return,
|
||||
/*XF86VidModeModeInfo*** <-- yes, that's three *'s. */
|
||||
out IntPtr modesinfo);
|
||||
|
||||
[DllImport(_dll_name_vid)]
|
||||
extern public static bool XF86VidModeSetViewPort(
|
||||
IntPtr display,
|
||||
int screen,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
/*
|
||||
Bool XF86VidModeSetClientVersion(
|
||||
Display *display);
|
||||
|
||||
Bool XF86VidModeGetModeLine(
|
||||
Display *display,
|
||||
int screen,
|
||||
int *dotclock_return,
|
||||
XF86VidModeModeLine *modeline);
|
||||
|
||||
Bool XF86VidModeDeleteModeLine(
|
||||
Display *display,
|
||||
int screen,
|
||||
XF86VidModeModeInfo *modeline);
|
||||
|
||||
Bool XF86VidModeModModeLine(
|
||||
Display *display,
|
||||
int screen,
|
||||
XF86VidModeModeLine *modeline);
|
||||
|
||||
Status XF86VidModeValidateModeLine(
|
||||
Display *display,
|
||||
int screen,
|
||||
XF86VidModeModeLine *modeline);
|
||||
|
||||
|
||||
Bool XF86VidModeLockModeSwitch(
|
||||
Display *display,
|
||||
int screen,
|
||||
int lock);
|
||||
|
||||
Bool XF86VidModeGetMonitor(
|
||||
Display *display,
|
||||
int screen,
|
||||
XF86VidModeMonitor *monitor);
|
||||
|
||||
Bool XF86VidModeGetViewPort(
|
||||
Display *display,
|
||||
int screen,
|
||||
int *x_return,
|
||||
int *y_return);
|
||||
|
||||
|
||||
XF86VidModeGetDotClocks(
|
||||
Display *display,
|
||||
int screen,
|
||||
int *flags return,
|
||||
int *number of clocks return,
|
||||
int *max dot clock return,
|
||||
int **clocks return);
|
||||
|
||||
XF86VidModeGetGamma(
|
||||
Display *display,
|
||||
int screen,
|
||||
XF86VidModeGamma *Gamma);
|
||||
|
||||
XF86VidModeSetGamma(
|
||||
Display *display,
|
||||
int screen,
|
||||
XF86VidModeGamma *Gamma);
|
||||
|
||||
XF86VidModeGetGammaRamp(
|
||||
Display *display,
|
||||
int screen,
|
||||
int size,
|
||||
unsigned short *red array,
|
||||
unsigned short *green array,
|
||||
unsigned short *blue array);
|
||||
|
||||
XF86VidModeSetGammaRamp(
|
||||
Display *display,
|
||||
int screen,
|
||||
int size,
|
||||
unsigned short *red array,
|
||||
unsigned short *green array,
|
||||
unsigned short *blue array);
|
||||
|
||||
XF86VidModeGetGammaRampSize(
|
||||
Display *display,
|
||||
int screen,
|
||||
int *size);
|
||||
* */
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
68
Source/Platform/prebuild.xml
Normal file
68
Source/Platform/prebuild.xml
Normal file
|
@ -0,0 +1,68 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd" version="1.7">
|
||||
|
||||
<Solution name="OpenTK.Platform">
|
||||
|
||||
<Project name="OpenTK.Platform.Windows" path=".\Windows" language="C#" type="Library">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<CompilerDefines>DEBUG;TRACE;</CompilerDefines>
|
||||
<OptimizeCode>false</OptimizeCode>
|
||||
<OutputPath>..\..\..\Binaries\Debug\Libraries</OutputPath>
|
||||
<DebugInformation>true</DebugInformation>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<CompilerDefines>TRACE;</CompilerDefines>
|
||||
<OptimizeCode>true</OptimizeCode>
|
||||
<OutputPath>..\..\..\Binaries\Release\Libraries</OutputPath>
|
||||
<DebugInformation>false</DebugInformation>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="System.Windows.Forms"/>
|
||||
|
||||
<Files>
|
||||
<Match path="." pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
|
||||
</Project>
|
||||
|
||||
<Project name="OpenTK.Platform.X11" path=".\X11" language="C#" type="Library">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<CompilerDefines>DEBUG;TRACE;</CompilerDefines>
|
||||
<OptimizeCode>false</OptimizeCode>
|
||||
<OutputPath>..\..\..\Binaries\Debug\Libraries</OutputPath>
|
||||
<DebugInformation>true</DebugInformation>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<CompilerDefines>TRACE;</CompilerDefines>
|
||||
<OptimizeCode>true</OptimizeCode>
|
||||
<OutputPath>..\..\..\Binaries\Release\Libraries</OutputPath>
|
||||
<DebugInformation>false</DebugInformation>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="System.Windows.Forms"/>
|
||||
|
||||
<Files>
|
||||
<Match path="." pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
|
||||
</Project>
|
||||
|
||||
</Solution>
|
||||
|
||||
</Prebuild>
|
252
prebuild.xml
Normal file
252
prebuild.xml
Normal file
|
@ -0,0 +1,252 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Prebuild xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd">
|
||||
|
||||
<Solution name="OpenTK">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<CompilerDefines>DEBUG;TRACE;</CompilerDefines>
|
||||
<OptimizeCode>false</OptimizeCode>
|
||||
<OutputPath>..\..\Binaries\Debug\Libraries</OutputPath>
|
||||
<DebugInformation>true</DebugInformation>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<CompilerDefines>TRACE;</CompilerDefines>
|
||||
<OptimizeCode>true</OptimizeCode>
|
||||
<OutputPath>..\..\Binaries\Release\Libraries</OutputPath>
|
||||
<DebugInformation>false</DebugInformation>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Project name="OpenTK.Platform.Windows" path=".\Source\Platform\Windows" language="C#" type="Library">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\Binaries\Debug\Libraries</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\Binaries\Release\Libraries</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="System.Windows.Forms"/>
|
||||
|
||||
<Files>
|
||||
<Match path="." pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
|
||||
</Project>
|
||||
|
||||
<Project name="OpenTK.Platform.X11" path=".\Source\Platform\X11" language="C#" type="Library">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\Binaries\Debug\Libraries</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\Binaries\Release\Libraries</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="System.Windows.Forms"/>
|
||||
|
||||
<Files>
|
||||
<Match path="." pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
|
||||
</Project>
|
||||
|
||||
<Project name="OpenTK.OpenGL.Bind" path=".\Source\OpenGL\Bind" language="C#" type="Exe">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\Binaries\Debug\Exe</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\Binaries\Release\Exe</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Files>
|
||||
<Match path="." pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
|
||||
</Project>
|
||||
|
||||
<Project name="OpenTK.OpenGL" path=".\Source\OpenGL\OpenGL" language="C#" type="Library">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\Binaries\Debug\Exe</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\Binaries\Release\Exe</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Reference name="OpenTK.Platform.Windows"/>
|
||||
<Reference name="OpenTK.Platform.X11"/>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="System.Windows.Forms"/>
|
||||
|
||||
<Files>
|
||||
<Match path="." pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
|
||||
</Project>
|
||||
|
||||
<Project name="OpenTK.Framework" path=".\Source\Framework\" language="C#" type="Library">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>..\..\Binaries\Debug\Libraries</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>..\..\Binaries\Release\Libraries</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Reference name="OpenTK.Platform.Windows"/>
|
||||
<Reference name="OpenTK.Platform.X11"/>
|
||||
<Reference name="OpenTK.OpenGL"/>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="System.Windows.Forms"/>
|
||||
<Reference name="System.Data"/>
|
||||
|
||||
<Files>
|
||||
<Match path="." pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
|
||||
</Project>
|
||||
|
||||
<Project name="OpenTK.Examples.OpenGL.Basic.Lesson01" path=".\Source\Examples\OpenGL\Basic\Lesson01" language="C#" type="WinExe">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\..\..\Binaries\Debug\Examples</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\..\..\Binaries\Release\Examples</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Reference name="OpenTK.Framework"/>
|
||||
<Reference name="OpenTK.OpenGL"/>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="System.Windows.Forms"/>
|
||||
|
||||
<Files>
|
||||
<Match path="." pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
|
||||
</Project>
|
||||
|
||||
<Project name="OpenTK.Examples.OpenGL.Basic.NoFramework" path=".\Source\Examples\OpenGL\Basic\NoFramework" language="C#" type="WinExe">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\..\..\Binaries\Debug\Examples</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\..\..\Binaries\Release\Examples</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Reference name="OpenTK.Framework"/>
|
||||
<Reference name="OpenTK.OpenGL"/>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="System.Windows.Forms"/>
|
||||
|
||||
<Files>
|
||||
<Match path="." pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
|
||||
</Project>
|
||||
|
||||
<Project name="OpenTK.Examples.OpenGL.Basic.QueryDisplayModes" path=".\Source\Examples\OpenGL\Basic\QueryDisplayModes" language="C#" type="WinExe">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\..\..\Binaries\Debug\Examples</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\..\..\Binaries\Release\Examples</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Reference name="OpenTK.Framework"/>
|
||||
<Reference name="OpenTK.OpenGL"/>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="System.Windows.Forms"/>
|
||||
|
||||
<Files>
|
||||
<Match path="." pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
|
||||
</Project>
|
||||
|
||||
<Project name="OpenTK.Examples.OpenGL.GLSL.Lesson01" path=".\Source\Examples\OpenGL\GLSL\Lesson01" language="C#" type="WinExe">
|
||||
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\..\..\Binaries\Debug\Examples</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>..\..\..\..\..\Binaries\Release\Examples</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<Reference name="OpenTK.Framework"/>
|
||||
<Reference name="OpenTK.OpenGL"/>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Drawing"/>
|
||||
<Reference name="System.Windows.Forms"/>
|
||||
|
||||
<Files>
|
||||
<Match path="." pattern="*.cs" recurse="true"/>
|
||||
</Files>
|
||||
|
||||
</Project>
|
||||
|
||||
</Solution>
|
||||
|
||||
</Prebuild>
|
Loading…
Reference in a new issue