This commit is contained in:
parent
5d71876f8e
commit
24c3a6b290
31 changed files with 539 additions and 557 deletions
4
Build/Build-Mono.bat
Normal file
4
Build/Build-Mono.bat
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
cd..
|
||||||
|
Build\Prebuild.exe /target nant /file prebuild.xml
|
||||||
|
NAnt.exe -t:mono-2.0
|
||||||
|
Build\PostBuild.bat
|
4
Build/Build-Net.bat
Normal file
4
Build/Build-Net.bat
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
cd..
|
||||||
|
Build\Prebuild.exe /target nant /file prebuild.xml
|
||||||
|
NAnt.exe -t:net-2.0
|
||||||
|
Build\PostBuild.bat
|
|
@ -1,7 +1,3 @@
|
||||||
cd..
|
|
||||||
Build\Prebuild /target nant /file prebuild.xml
|
|
||||||
NAnt.exe
|
|
||||||
|
|
||||||
rem Copying files to output directory
|
rem Copying files to output directory
|
||||||
|
|
||||||
xcopy Source\OpenGL\Bind\bin\Release\*.exe Binaries\Release\Exe\*.* /Q /Y
|
xcopy Source\OpenGL\Bind\bin\Release\*.exe Binaries\Release\Exe\*.* /Q /Y
|
||||||
|
@ -14,6 +10,7 @@ xcopy Source\Platform\X11\bin\Release\*.dll Binaries\Release\Libraries\*.* /Q /Y
|
||||||
xcopy Source\Framework\bin\Release\*.dll Binaries\Release\Libraries\*.* /Q /Y
|
xcopy Source\Framework\bin\Release\*.dll Binaries\Release\Libraries\*.* /Q /Y
|
||||||
|
|
||||||
xcopy Source\Examples\OpenGL\Basic\Lesson01\bin\Release\*.exe Binaries\Release\Examples\*.* /Q /Y
|
xcopy Source\Examples\OpenGL\Basic\Lesson01\bin\Release\*.exe Binaries\Release\Examples\*.* /Q /Y
|
||||||
|
xcopy Source\Examples\OpenGL\Basic\DisplayLists\bin\Release\*.exe Binaries\Release\Examples\*.* /Q /Y
|
||||||
xcopy Source\Examples\OpenGL\Basic\NoFramework\bin\Release\*.exe Binaries\Release\Examples\*.* /Q /Y
|
xcopy Source\Examples\OpenGL\Basic\NoFramework\bin\Release\*.exe Binaries\Release\Examples\*.* /Q /Y
|
||||||
xcopy Source\Examples\OpenGL\Basic\QueryDisplayModes\bin\Release\*.exe Binaries\Release\Examples\*.* /Q /Y
|
xcopy Source\Examples\OpenGL\Basic\QueryDisplayModes\bin\Release\*.exe Binaries\Release\Examples\*.* /Q /Y
|
||||||
xcopy Source\Examples\OpenGL\GLSL\Lesson01\bin\Release\*.exe Binaries\Release\Examples\*.* /Q /Y
|
xcopy Source\Examples\OpenGL\GLSL\Lesson01\bin\Release\*.exe Binaries\Release\Examples\*.* /Q /Y
|
19
Release.txt
19
Release.txt
|
@ -1,14 +1,15 @@
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
OpenTK 0.3.5 alpha Release notes
|
OpenTK 0.3.6 WIP alpha Release notes
|
||||||
|
|
||||||
IMPORTANT: This release is not only intended for testing and experimentation, NOT for development. Use at your own risk! (see below for the reasons)
|
IMPORTANT: This release is not only intended for testing and experimentation, NOT for development. Use at your own risk! (see below for the reasons)
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
This release introduces Linux support. Thanks to Erik's code you can now write a project under Linux/Mono and run it under Windows/.Net without changing a single line of code!
|
This is the first release to implement High-level OpenGL bindings. Highlights:
|
||||||
|
|
||||||
Moreover, the structure of the OpenTK.OpenGL.GL class has been changed. Only the OpenGL core functions (versions 1.0-2.1) are directly exposed now in the GL class - the extension functions will reside in new structures named after the extension categories (for example GL.Arb, GL.Ext, GL.NV, GL.Ati etc). This change will make extension functions more discoverable. Extensions are currently disabled, until some internal changes are complete in OpenTK.OpenGL.Bind to allow for this change.
|
OpenTK.OpenGL (High level): DisplayList.
|
||||||
|
OpenTK.Examples: OpenGL.Basic.DisplayLists
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -23,25 +24,25 @@ For the bleeding edge code, do a svn checkout at https://svn.sourceforge.net/svn
|
||||||
The version number for this release is
|
The version number for this release is
|
||||||
Major: 0
|
Major: 0
|
||||||
Minor: 3
|
Minor: 3
|
||||||
Release: 5
|
Release: 6
|
||||||
Revision: 0
|
Revision: 1
|
||||||
|
|
||||||
The odd minor version number denotes that this is a WIP (Work In Progress). This means that the source and the public API (APplication Interface) changes rapidly from release to release.
|
The odd minor version number denotes that this is a WIP (Work In Progress). This means that the source and the public API (APplication Interface) changes rapidly from release to release.
|
||||||
|
|
||||||
This is an alpha release. This means it is not feature complete - more features are planned or are in currently in development. When all planned features are ready for testing, this package will move to the beta phase, were the focus will change to testing and bug-fixing.
|
This is an alpha release. This means it is not feature complete - more features are planned or are in currently in development. When all planned features are ready for testing, this package will move to the beta phase, were the focus will change to testing and bug-fixing.
|
||||||
|
|
||||||
Missing features include Linux support and more fine-grained window and context management. Also expect the naming scheme to change over the next few versions.
|
Missing features include more fine-grained window and context management, several High-level OpenGL bindings and several other things. Also expect the naming scheme to change over the next few versions.
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
This package contains the source for:
|
This package contains the source for:
|
||||||
OpenTK.OpenGL (0.3.5)
|
OpenTK.OpenGL (0.3.6.1)
|
||||||
OpenTK.OpenGL.Bind (0.7.7.0)
|
OpenTK.OpenGL.Bind (0.7.7.0)
|
||||||
OpenTK.Framework (0.3.2.0)
|
OpenTK.Framework (0.3.3.1)
|
||||||
OpenTK.Platform.Windows (0.1.1.0)
|
OpenTK.Platform.Windows (0.1.1.0)
|
||||||
OpenTK.Platform.X11 (0.1.1.0)
|
OpenTK.Platform.X11 (0.1.1.0)
|
||||||
|
|
||||||
OpenTK.OpenGL.Examples.Basic (Lesson01, NoFramework, QueryDisplayModes)
|
OpenTK.OpenGL.Examples.Basic (Lesson01, DisplayLists, NoFramework, QueryDisplayModes)
|
||||||
OpenTK.OpenGL.Examples.GLSL (Lesson01)
|
OpenTK.OpenGL.Examples.GLSL (Lesson01)
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
168
Source/Examples/OpenGL/Basic/DisplayLists/DisplayLists.cs
Normal file
168
Source/Examples/OpenGL/Basic/DisplayLists/DisplayLists.cs
Normal file
|
@ -0,0 +1,168 @@
|
||||||
|
#region --- License ---
|
||||||
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
|
* Coded by Stephen Apostolopoulos.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region --- Using Directives ---
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
using OpenTK.OpenGL;
|
||||||
|
|
||||||
|
#endregion --- Using Directives ---
|
||||||
|
|
||||||
|
namespace OpenTK.Examples.OpenGL.Basic.DisplayLists
|
||||||
|
{
|
||||||
|
public partial class DisplayLists : Framework
|
||||||
|
{
|
||||||
|
#region --- Variables ---
|
||||||
|
|
||||||
|
List<DisplayList> lists = new List<DisplayList>();
|
||||||
|
|
||||||
|
#endregion --- Variables ---
|
||||||
|
|
||||||
|
#region --- Methods ---
|
||||||
|
|
||||||
|
[STAThread]
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
new DisplayLists().Run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion --- Methods ---
|
||||||
|
|
||||||
|
#region --- Event Handlers ---
|
||||||
|
|
||||||
|
#region OnLoad
|
||||||
|
|
||||||
|
protected override void OnLoad(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnLoad(sender, e);
|
||||||
|
|
||||||
|
Text =
|
||||||
|
"DisplayLists example (" +
|
||||||
|
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);
|
||||||
|
|
||||||
|
// Build some display lists.
|
||||||
|
float c = 0;
|
||||||
|
const int numDisplayLists = 9;
|
||||||
|
for (int i = numDisplayLists; i > 0; i--)
|
||||||
|
{
|
||||||
|
DisplayList d = new DisplayList();
|
||||||
|
|
||||||
|
d.Begin();
|
||||||
|
|
||||||
|
GL.Color3d(
|
||||||
|
1.0,
|
||||||
|
c,
|
||||||
|
1 - c
|
||||||
|
);
|
||||||
|
|
||||||
|
GL.Begin(Enums.BeginMode.QUADS);
|
||||||
|
|
||||||
|
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();
|
||||||
|
|
||||||
|
d.End();
|
||||||
|
|
||||||
|
lists.Add(d);
|
||||||
|
|
||||||
|
c += 1 / (float)numDisplayLists;
|
||||||
|
}
|
||||||
|
|
||||||
|
OnResize(this, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region OnResize
|
||||||
|
|
||||||
|
protected override void OnResize(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
base.OnResize(sender, e);
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
GL.MatrixMode(Enums.MatrixMode.PROJECTION);
|
||||||
|
GL.LoadIdentity();
|
||||||
|
Glu.Perspective(45.0, ratio, 1.0, 64.0);
|
||||||
|
Glu.LookAt(
|
||||||
|
0.0, 0.0, 16.0,
|
||||||
|
0.0, 0.0, 0.0,
|
||||||
|
0.0, 1.0, 0.0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region OnPaint
|
||||||
|
|
||||||
|
protected override void OnPaint()
|
||||||
|
{
|
||||||
|
GL.MatrixMode(Enums.MatrixMode.MODELVIEW);
|
||||||
|
GL.LoadIdentity();
|
||||||
|
|
||||||
|
GL.Clear(Enums.ClearBufferMask.COLOR_BUFFER_BIT | Enums.ClearBufferMask.DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
|
double angle = 0.0;
|
||||||
|
foreach (DisplayList d in lists)
|
||||||
|
{
|
||||||
|
GL.LoadIdentity();
|
||||||
|
GL.Rotated(angle, 0.0, 0.0, 1.0);
|
||||||
|
GL.Translated(5.0, 0.0, 0.0);
|
||||||
|
|
||||||
|
d.Render();
|
||||||
|
angle += 360 / lists.Count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ActiveContext.SwapBuffers();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region OnKeyDown
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
#endregion --- Event Handlers ---
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,3 +1,9 @@
|
||||||
|
#region --- License ---
|
||||||
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
|
* Coded by Erik Ylvisaker and Stephen Apostolopoulos.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
@ -5,11 +11,25 @@ using OpenTK.OpenGL;
|
||||||
|
|
||||||
namespace Lesson01
|
namespace Lesson01
|
||||||
{
|
{
|
||||||
|
public class Cube : OpenTK.Framework
|
||||||
public class Cube : OpenTK.Frameworks.Framework
|
|
||||||
{
|
{
|
||||||
static float angle;
|
static float angle;
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
#region Load event handler
|
#region Load event handler
|
||||||
protected override void OnLoad(object sender, EventArgs e)
|
protected override void OnLoad(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -134,24 +154,11 @@ namespace Lesson01
|
||||||
GL.Color3f(0, 1, 1);
|
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.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();
|
GL.End();
|
||||||
}
|
}
|
||||||
#endregion
|
#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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,9 +1,11 @@
|
||||||
#region License
|
#region --- License ---
|
||||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
* See license.txt for license info
|
* Coded by Stephen Apostolopoulos.
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region --- Using Directives ---
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
@ -11,13 +13,17 @@ using System.Drawing;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using OpenTK;
|
|
||||||
using OpenTK.OpenGL;
|
using OpenTK.OpenGL;
|
||||||
|
|
||||||
|
#endregion --- Using Directives ---
|
||||||
|
|
||||||
namespace OpenTK.Examples.OpenGL.GLSL
|
namespace OpenTK.Examples.OpenGL.GLSL
|
||||||
{
|
{
|
||||||
public class Cube : OpenTK.Frameworks.Framework
|
public class Cube : Framework
|
||||||
{
|
{
|
||||||
|
#region --- Variables ---
|
||||||
|
|
||||||
#region Shaders
|
#region Shaders
|
||||||
|
|
||||||
string[] vertex_shader_source =
|
string[] vertex_shader_source =
|
||||||
|
@ -37,7 +43,73 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
||||||
|
|
||||||
static float angle;
|
static float angle;
|
||||||
|
|
||||||
#region Load event handler
|
#endregion --- Variables ---
|
||||||
|
|
||||||
|
#region --- Methods ---
|
||||||
|
|
||||||
|
#region Entry point
|
||||||
|
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
new Cube().Run();
|
||||||
|
}
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
|
#endregion --- Methods ---
|
||||||
|
|
||||||
|
#region --- Event Handlers ---
|
||||||
|
|
||||||
|
#region OnLoad
|
||||||
|
|
||||||
protected override void OnLoad(object sender, EventArgs e)
|
protected override void OnLoad(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnLoad(sender, e);
|
base.OnLoad(sender, e);
|
||||||
|
@ -88,16 +160,15 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
||||||
|
|
||||||
OnResize(sender, e);
|
OnResize(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Resize event handler
|
#region OnResize
|
||||||
|
|
||||||
protected override void OnResize(object sender, EventArgs e)
|
protected override void OnResize(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnResize(sender, e);
|
base.OnResize(sender, e);
|
||||||
|
|
||||||
// if (this.Context == null)
|
|
||||||
// return;
|
|
||||||
|
|
||||||
if (ClientSize.Height == 0)
|
if (ClientSize.Height == 0)
|
||||||
ClientSize = new System.Drawing.Size(ClientSize.Width, 1);
|
ClientSize = new System.Drawing.Size(ClientSize.Width, 1);
|
||||||
|
|
||||||
|
@ -105,18 +176,15 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
||||||
|
|
||||||
double ratio = 0.0;
|
double ratio = 0.0;
|
||||||
ratio = ClientSize.Width / (double)ClientSize.Height;
|
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.MatrixMode(Enums.MatrixMode.PROJECTION);
|
||||||
GL.LoadIdentity();
|
GL.LoadIdentity();
|
||||||
Glu.Perspective(45.0, ratio, 1.0, 64.0);
|
Glu.Perspective(45.0, ratio, 1.0, 64.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Paint event handler
|
#region OnPaint
|
||||||
|
|
||||||
protected override void OnPaint()
|
protected override void OnPaint()
|
||||||
{
|
{
|
||||||
|
@ -141,7 +209,7 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region KeyDown event handler
|
#region OnKeyDown
|
||||||
|
|
||||||
protected override void OnKeyDown(object sender, KeyEventArgs e)
|
protected override void OnKeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
|
@ -161,62 +229,6 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region DrawCube
|
#endregion --- Event Handlers ---
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#region License
|
#region --- License ---
|
||||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
* Contributions from Erik Ylvisaker
|
* Coded by Stephen Apostolopoulos and Erik Ylvisaker.
|
||||||
* See license.txt for license info
|
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -13,22 +12,29 @@ using System.Drawing;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using OpenTK.Platform.Windows;
|
using OpenTK.Platform.Windows;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
using OpenTK.OpenGL.Platform;
|
using OpenTK.OpenGL.Platform;
|
||||||
using OpenTK.OpenGL;
|
using OpenTK.OpenGL;
|
||||||
|
|
||||||
namespace OpenTK.Frameworks
|
namespace OpenTK
|
||||||
{
|
{
|
||||||
public class Framework : IDisposable
|
public class Framework : IDisposable
|
||||||
{
|
{
|
||||||
|
#region --- Private variables ---
|
||||||
|
|
||||||
private Form activeForm;
|
private Form activeForm;
|
||||||
private GLContext activeContext;
|
private GLContext activeContext;
|
||||||
private PlatformSpecific platform;
|
private PlatformSpecific platform;
|
||||||
|
|
||||||
private OpenGL.ColorDepth _color_depth;
|
private OpenGL.ColorDepth colorDepth;
|
||||||
private int _z_depth;
|
private int zDepth;
|
||||||
private int _stencil_depth;
|
private int stencilDepth;
|
||||||
|
|
||||||
private string text = "OpenTK Windows application";
|
private string text = "OpenTK application";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
Application.MessageLoopCallback MessageLoop;
|
||||||
|
|
||||||
#region --- Public Properties ---
|
#region --- Public Properties ---
|
||||||
|
|
||||||
|
@ -37,11 +43,13 @@ namespace OpenTK.Frameworks
|
||||||
get { return activeForm; }
|
get { return activeForm; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GLContext ActiveContext
|
public GLContext ActiveContext
|
||||||
{
|
{
|
||||||
get { return activeContext; }
|
get { return activeContext; }
|
||||||
private set { activeContext = value; }
|
private set { activeContext = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
get { return text; }
|
get { return text; }
|
||||||
|
@ -53,21 +61,25 @@ namespace OpenTK.Frameworks
|
||||||
activeForm.Text = value;
|
activeForm.Text = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Size ClientSize
|
public Size ClientSize
|
||||||
{
|
{
|
||||||
get { return ActiveForm.ClientSize; }
|
get { return ActiveForm.ClientSize; }
|
||||||
set { activeForm.ClientSize = value; }
|
set { activeForm.ClientSize = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Width
|
public int Width
|
||||||
{
|
{
|
||||||
get { return ClientSize.Width; }
|
get { return ClientSize.Width; }
|
||||||
set { ClientSize = new Size(value, ClientSize.Height); }
|
set { ClientSize = new Size(value, ClientSize.Height); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Height
|
public int Height
|
||||||
{
|
{
|
||||||
get { return ClientSize.Height; }
|
get { return ClientSize.Height; }
|
||||||
set { ClientSize = new Size(ClientSize.Width, value); }
|
set { ClientSize = new Size(ClientSize.Width, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsFullscreen
|
public bool IsFullscreen
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -78,18 +90,20 @@ namespace OpenTK.Frameworks
|
||||||
|
|
||||||
public OpenGL.ColorDepth ColorDepth
|
public OpenGL.ColorDepth ColorDepth
|
||||||
{
|
{
|
||||||
get { return _color_depth; }
|
get { return colorDepth; }
|
||||||
private set { _color_depth = value; }
|
private set { colorDepth = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int ZDepth
|
public int ZDepth
|
||||||
{
|
{
|
||||||
get { return _z_depth; }
|
get { return zDepth; }
|
||||||
set { _z_depth = value; }
|
set { zDepth = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public int StencilDepth
|
public int StencilDepth
|
||||||
{
|
{
|
||||||
get { return _stencil_depth; }
|
get { return stencilDepth; }
|
||||||
set { _stencil_depth = value; }
|
set { stencilDepth = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -97,11 +111,22 @@ namespace OpenTK.Frameworks
|
||||||
#region --- Creation and Destruction ---
|
#region --- Creation and Destruction ---
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructs a Framework object.
|
/// Constructs a Framework object with default (safe) parameters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Framework()
|
public Framework()
|
||||||
: this(null, 800, 600, new OpenTK.OpenGL.ColorDepth(8, 8, 8, 8), 16, 0, false)
|
: this(null, 640, 480, new OpenTK.OpenGL.ColorDepth(8, 8, 8, 8), 16, 0, false)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Construcs a Framework object with the given parameters.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="title">The Title of the Form.</param>
|
||||||
|
/// <param name="width">The Width of the Form.</param>
|
||||||
|
/// <param name="height">The Height of the Form.</param>
|
||||||
|
/// <param name="color">The ColorDepth of the OpenGL Context.</param>
|
||||||
|
/// <param name="depth">The ZDepth of the OpenGL Context.</param>
|
||||||
|
/// <param name="stencil">The StencilDepth of the OpenGL Context.</param>
|
||||||
|
/// <param name="fullscreen">The Fullscreen property of the Form.</param>
|
||||||
public Framework(string title, int width, int height, OpenTK.OpenGL.ColorDepth color,
|
public Framework(string title, int width, int height, OpenTK.OpenGL.ColorDepth color,
|
||||||
int depth, int stencil, bool fullscreen)
|
int depth, int stencil, bool fullscreen)
|
||||||
{
|
{
|
||||||
|
@ -132,6 +157,7 @@ namespace OpenTK.Frameworks
|
||||||
activeContext.Dispose();
|
activeContext.Dispose();
|
||||||
activeContext = null;
|
activeContext = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activeForm != null)
|
if (activeForm != null)
|
||||||
{
|
{
|
||||||
activeForm.Dispose();
|
activeForm.Dispose();
|
||||||
|
@ -161,6 +187,10 @@ namespace OpenTK.Frameworks
|
||||||
else
|
else
|
||||||
CreateWindowedDisplay(width, height);
|
CreateWindowedDisplay(width, height);
|
||||||
|
|
||||||
|
//Application.Idle += this.OnIdle;
|
||||||
|
|
||||||
|
//MessageLoop = new Application.MessageLoopCallback(MainLoop);
|
||||||
|
//Application.RegisterMessageLoop(MessageLoop);
|
||||||
|
|
||||||
System.Console.WriteLine("Done Initializing.");
|
System.Console.WriteLine("Done Initializing.");
|
||||||
}
|
}
|
||||||
|
@ -177,9 +207,12 @@ namespace OpenTK.Frameworks
|
||||||
|
|
||||||
AttachEvents(activeForm);
|
AttachEvents(activeForm);
|
||||||
|
|
||||||
activeForm.Show();
|
|
||||||
|
|
||||||
activeForm.ClientSize = new Size(width, height);
|
activeForm.ClientSize = new Size(width, height);
|
||||||
|
|
||||||
|
activeForm.TopMost = true;
|
||||||
|
activeForm.Enabled = true;
|
||||||
|
|
||||||
|
activeForm.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreateFullScreenDisplay(int width, int height)
|
private void CreateFullScreenDisplay(int width, int height)
|
||||||
|
@ -194,93 +227,119 @@ namespace OpenTK.Frameworks
|
||||||
|
|
||||||
AttachEvents(activeForm);
|
AttachEvents(activeForm);
|
||||||
|
|
||||||
activeForm.Show();
|
activeForm.FormBorderStyle = FormBorderStyle.None;
|
||||||
|
|
||||||
activeForm.ClientSize = new Size(width, height);
|
activeForm.ClientSize = new Size(width, height);
|
||||||
activeForm.Location = Point.Empty;
|
activeForm.Location = Point.Empty;
|
||||||
|
|
||||||
activeContext.SetFullScreen(width, height, ColorDepth);
|
activeForm.TopMost = true;
|
||||||
|
activeForm.Enabled = true;
|
||||||
|
|
||||||
|
activeForm.Show();
|
||||||
|
|
||||||
|
activeContext.SetFullScreen(width, height, ColorDepth);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AttachEvents(Form frm)
|
private void AttachEvents(Form frm)
|
||||||
{
|
{
|
||||||
frm.Load += new EventHandler(OnLoad);
|
frm.Load += this.OnLoad;
|
||||||
frm.Resize += new EventHandler(OnResize);
|
frm.Resize += this.OnResize;
|
||||||
frm.Paint += new PaintEventHandler(OnPaint);
|
frm.Paint += this.OnPaint;
|
||||||
frm.KeyDown += new KeyEventHandler(OnKeyDown);
|
frm.KeyDown += this.OnKeyDown;
|
||||||
frm.KeyUp += new KeyEventHandler(OnKeyUp);
|
frm.KeyUp += this.OnKeyUp;
|
||||||
frm.KeyPress += new KeyPressEventHandler(OnKeyPress);
|
frm.KeyPress += this.OnKeyPress;
|
||||||
frm.Click += new EventHandler(OnClick);
|
frm.Click += this.OnClick;
|
||||||
frm.MouseDown += new MouseEventHandler(OnMouseDown);
|
frm.MouseDown += this.OnMouseDown;
|
||||||
frm.MouseEnter += new EventHandler(OnMouseEnter);
|
frm.MouseEnter += this.OnMouseEnter;
|
||||||
frm.MouseHover += new EventHandler(OnMouseHover);
|
frm.MouseHover += this.OnMouseHover;
|
||||||
frm.MouseLeave += new EventHandler(OnMouseLeave);
|
frm.MouseLeave += this.OnMouseLeave;
|
||||||
frm.MouseMove += new MouseEventHandler(OnMouseMove);
|
frm.MouseMove += this.OnMouseMove;
|
||||||
frm.MouseUp += new MouseEventHandler(OnMouseUp);
|
frm.MouseUp += this.OnMouseUp;
|
||||||
frm.MouseWheel += new MouseEventHandler(OnMouseWheel);
|
frm.MouseWheel += this.OnMouseWheel;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Events
|
#region --- Events ---
|
||||||
|
|
||||||
|
virtual protected void OnIdle(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
while (ActiveForm != null && platform.IsIdle())
|
||||||
|
{
|
||||||
|
if (!ActiveForm.Focused)
|
||||||
|
{
|
||||||
|
Thread.Sleep(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.OnPaint();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual protected void OnMouseWheel(object sender, MouseEventArgs e)
|
virtual protected void OnMouseWheel(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
if (MouseWheel != null)
|
if (MouseWheel != null)
|
||||||
MouseWheel(sender, e);
|
MouseWheel(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnMouseUp(object sender, MouseEventArgs e)
|
virtual protected void OnMouseUp(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
if (MouseUp != null)
|
if (MouseUp != null)
|
||||||
MouseUp(sender, e);
|
MouseUp(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnMouseMove(object sender, MouseEventArgs e)
|
virtual protected void OnMouseMove(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
if (MouseMove != null)
|
if (MouseMove != null)
|
||||||
MouseMove(sender, e);
|
MouseMove(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnMouseLeave(object sender, EventArgs e)
|
virtual protected void OnMouseLeave(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (MouseLeave != null)
|
if (MouseLeave != null)
|
||||||
MouseLeave(sender, e);
|
MouseLeave(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnMouseHover(object sender, EventArgs e)
|
virtual protected void OnMouseHover(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (MouseHover != null)
|
if (MouseHover != null)
|
||||||
MouseHover(sender, e);
|
MouseHover(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnMouseEnter(object sender, EventArgs e)
|
virtual protected void OnMouseEnter(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (MouseEnter != null)
|
if (MouseEnter != null)
|
||||||
MouseEnter(sender, e);
|
MouseEnter(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnMouseDown(object sender, MouseEventArgs e)
|
virtual protected void OnMouseDown(object sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
if (MouseDown != null)
|
if (MouseDown != null)
|
||||||
MouseDown(sender, e);
|
MouseDown(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnClick(object sender, EventArgs e)
|
virtual protected void OnClick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (Click != null)
|
if (Click != null)
|
||||||
Click(sender, e);
|
Click(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnKeyPress(object sender, KeyPressEventArgs e)
|
virtual protected void OnKeyPress(object sender, KeyPressEventArgs e)
|
||||||
{
|
{
|
||||||
if (KeyPress != null)
|
if (KeyPress != null)
|
||||||
KeyPress(sender, e);
|
KeyPress(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnKeyUp(object sender, KeyEventArgs e)
|
virtual protected void OnKeyUp(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (KeyUp != null)
|
if (KeyUp != null)
|
||||||
KeyUp(sender, e);
|
KeyUp(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnKeyDown(object sender, KeyEventArgs e)
|
virtual protected void OnKeyDown(object sender, KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (KeyDown != null)
|
if (KeyDown != null)
|
||||||
KeyDown(sender, e);
|
KeyDown(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPaint(object sender, PaintEventArgs e)
|
private void OnPaint(object sender, PaintEventArgs e)
|
||||||
{
|
{
|
||||||
OnPaint();
|
OnPaint();
|
||||||
|
@ -288,6 +347,7 @@ namespace OpenTK.Frameworks
|
||||||
if (Paint != null)
|
if (Paint != null)
|
||||||
Paint(sender, e);
|
Paint(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnPaint()
|
virtual protected void OnPaint()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -297,6 +357,7 @@ namespace OpenTK.Frameworks
|
||||||
if (Resize != null)
|
if (Resize != null)
|
||||||
Resize(sender, e);
|
Resize(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual protected void OnLoad(object sender, EventArgs e)
|
virtual protected void OnLoad(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (Load != null)
|
if (Load != null)
|
||||||
|
@ -322,7 +383,7 @@ namespace OpenTK.Frameworks
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Window Management
|
#region --- Window Management ---
|
||||||
|
|
||||||
private void DisposeForm()
|
private void DisposeForm()
|
||||||
{
|
{
|
||||||
|
@ -330,7 +391,7 @@ namespace OpenTK.Frameworks
|
||||||
activeContext.Dispose();
|
activeContext.Dispose();
|
||||||
if (activeForm != null)
|
if (activeForm != null)
|
||||||
activeForm.Dispose();
|
activeForm.Dispose();
|
||||||
|
|
||||||
activeContext = null;
|
activeContext = null;
|
||||||
activeForm = null;
|
activeForm = null;
|
||||||
}
|
}
|
||||||
|
@ -356,22 +417,29 @@ namespace OpenTK.Frameworks
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Render Loop
|
#region --- Main Loop ---
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enters the Framework's main loop, updating state and rendering.
|
||||||
|
/// </summary>
|
||||||
public void Run()
|
public void Run()
|
||||||
{
|
{
|
||||||
|
// TODO: Find a better main loop. This is evil! (Probably a custom main loop or something based on the Idle event).
|
||||||
while (ActiveForm != null && ActiveForm.IsDisposed == false)
|
while (ActiveForm != null && ActiveForm.IsDisposed == false)
|
||||||
{
|
{
|
||||||
OnPaint(this, null);
|
OnPaint(this, null);
|
||||||
|
|
||||||
if (platform.IsIdle() == false)
|
if (platform.IsIdle() == false)
|
||||||
Application.DoEvents();
|
Application.DoEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Old Code
|
||||||
|
|
||||||
/*
|
/*
|
||||||
public partial class Framework : Form, IDisposable
|
public partial class Framework : Form, IDisposable
|
||||||
{
|
{
|
||||||
|
@ -621,4 +689,6 @@ namespace OpenTK.Frameworks
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
* */
|
* */
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,22 +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.Drawing;
|
|
||||||
|
|
||||||
namespace OpenTK.Frameworks
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
48
Source/Framework/FullScreenForm.Designer.cs
generated
48
Source/Framework/FullScreenForm.Designer.cs
generated
|
@ -1,48 +0,0 @@
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -17,8 +17,6 @@ namespace OpenTK
|
||||||
//this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); // Buffer Control
|
//this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); // Buffer Control
|
||||||
//this.SetStyle(ControlStyles.ResizeRedraw, true); // Redraw On Resize
|
//this.SetStyle(ControlStyles.ResizeRedraw, true); // Redraw On Resize
|
||||||
this.SetStyle(ControlStyles.UserPaint, true); // We'll Handle Painting Ourselves
|
this.SetStyle(ControlStyles.UserPaint, true); // We'll Handle Painting Ourselves
|
||||||
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,120 +0,0 @@
|
||||||
<?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>
|
|
|
@ -35,5 +35,10 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual bool ProcessEvents()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
47
Source/Framework/WindowedForm.Designer.cs
generated
47
Source/Framework/WindowedForm.Designer.cs
generated
|
@ -1,47 +0,0 @@
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -17,8 +17,6 @@ namespace OpenTK
|
||||||
//this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); // Buffer Control
|
//this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); // Buffer Control
|
||||||
//this.SetStyle(ControlStyles.ResizeRedraw, true); // Redraw On Resize
|
//this.SetStyle(ControlStyles.ResizeRedraw, true); // Redraw On Resize
|
||||||
this.SetStyle(ControlStyles.UserPaint, true); // We'll Handle Painting Ourselves
|
this.SetStyle(ControlStyles.UserPaint, true); // We'll Handle Painting Ourselves
|
||||||
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,120 +0,0 @@
|
||||||
<?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>
|
|
|
@ -13,5 +13,12 @@ namespace OpenTK
|
||||||
WinApi.Message msg;
|
WinApi.Message msg;
|
||||||
return !WinApi.PeekMessage(out msg, IntPtr.Zero, 0, 0, 0);
|
return !WinApi.PeekMessage(out msg, IntPtr.Zero, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool ProcessEvents()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
return base.ProcessEvents();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
#region License
|
#region --- License ---
|
||||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
* See license.txt for license info
|
* Coded by Stephen Apostolopoulos.
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#region License
|
#region --- License ---
|
||||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
* Contributions from Erik Ylvisaker
|
* Coded by Stephen Apostolopoulos and Erik Ylvisaker.
|
||||||
* See license.txt for license info
|
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#region License
|
#region --- License ---
|
||||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
* Contributions from Erik Ylvisaker
|
* Coded by Stephen Apostolopoulos and Erik Ylvisaker.
|
||||||
* See license.txt for license info
|
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#region License
|
#region --- License ---
|
||||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
* Contributions from Erik Ylvisaker
|
* Coded by Stephen Apostolopoulos and Erik Ylvisaker.
|
||||||
* See license.txt for license info
|
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#region License
|
#region --- License ---
|
||||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
* See license.txt for license info
|
* Coded by Stephen Apostolopoulos.
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -78,6 +78,5 @@ namespace OpenTK.OpenGL
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
#region --- License ---
|
||||||
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
|
* Coded by Stephen Apostolopoulos.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -27,7 +33,7 @@ namespace OpenTK.OpenGL
|
||||||
|
|
||||||
private static Delegate MacOSGetAddress(string function_string, Type function_type)
|
private static Delegate MacOSGetAddress(string function_string, Type function_type)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException("THis platform is not supported yet. Sorry for the inconvenience.");
|
throw new NotImplementedException("This platform is not supported yet. Sorry for the inconvenience.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
#region --- License ---
|
||||||
* See license.txt for license info
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
|
* Coded by Stephen Apostolopoulos.
|
||||||
*/
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#region License
|
#region --- License ---
|
||||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
* Contributions from Erik Ylvisaker
|
* Coded by Stephen Apostolopoulos and Erik Ylvisaker.
|
||||||
* See license.txt for license info
|
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<dllmap dll="opengl32.dll" target="libGL.so.1" />
|
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
|
||||||
<dllmap dll="glu32.dll" target="libGLU.so.1" />
|
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
|
||||||
</configuration>
|
</configuration>
|
|
@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("0.3.4.0")]
|
[assembly: AssemblyVersion("0.3.4.1")]
|
||||||
[assembly: AssemblyFileVersion("0.3.4.0")]
|
[assembly: AssemblyFileVersion("0.3.4.1")]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#region License
|
#region --- License ---
|
||||||
/* Copyright (c) 2006 Stephen Apostolopoulos
|
/* This source file is released under the MIT license. See License.txt for more information.
|
||||||
* See license.txt for license info
|
* Coded by Stephen Apostolopoulos.
|
||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
60
Todo.txt
60
Todo.txt
|
@ -1,16 +1,44 @@
|
||||||
Todo:
|
Generic Todos:
|
||||||
+ + + [In progress] Restore the Extensions.
|
|
||||||
+ + + Fully implement Framework class.
|
+ Check if resources are correctly cleaned.
|
||||||
+ + + [In progress] Correct the Dispose methods to correctly clean resources (they should also call GC.SupressFinalize(true))
|
|
||||||
+ + + Add the CLS compliant attribute to the GL class.
|
|
||||||
+ + Document projects (source and manuals).
|
OpenTK.OpenGL todos:
|
||||||
+ + [In progress] Add more constructors to the Context classes.
|
|
||||||
+ [In progress] Add more examples.
|
(High level)
|
||||||
+ Find out what is needed for the MacOS platform (how to do function loading and window management without X11).
|
+ VertexBufferObject class.
|
||||||
+ Add full bindings for glu, wgl, glx and agl (probably generated automatically).
|
+ Error class.
|
||||||
+ Add the Math module.
|
+ Device class.
|
||||||
+ Research and add the Input module.
|
+ OpenGL function overloads.
|
||||||
+ Review and add the Timer module.
|
|
||||||
+ Review and add the OpenAL module.
|
(Low level)
|
||||||
+ [In progress] Clean up the code.
|
+ Restore the Extensions.
|
||||||
+ Add more platform bindings.
|
+ Mark the GL class as CLS compliant.
|
||||||
|
+ Inline XML documentation.
|
||||||
|
+ Add support for the MacOS X platform.
|
||||||
|
+ Add complete Wgl, Glx, Agl and Glu bindings.
|
||||||
|
|
||||||
|
Context class:
|
||||||
|
+ Add more constructors.
|
||||||
|
+ Add support for the MacOS X platform.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
+ Homogenize the example layout.
|
||||||
|
+ Add comments were needed.
|
||||||
|
|
||||||
|
|
||||||
|
OpenTK.Math todos:
|
||||||
|
+ Start implementing the Math module.
|
||||||
|
|
||||||
|
|
||||||
|
OpenTK.Input todos:
|
||||||
|
+ Start researching the Input module.
|
||||||
|
|
||||||
|
|
||||||
|
OpenTK.Timer todos:
|
||||||
|
+ Start researching the Timer module.
|
||||||
|
|
||||||
|
|
||||||
|
OpenTK.OpenAL todos:
|
||||||
|
+ Start researching the OpenAL module.
|
||||||
|
+ Take a look at the OpenALDotNet wrapper.
|
|
@ -1,3 +1,10 @@
|
||||||
|
OpenTK 0.3.5 -> 0.3.6
|
||||||
|
+ OpenTK.OpenGL (High level)
|
||||||
|
+ Added the DisplayList class.
|
||||||
|
+ OpenTK.Examples.OpenGL
|
||||||
|
+ Added the Basic.DisplayLists example.
|
||||||
|
|
||||||
|
|
||||||
OpenTK 0.3.4 -> 0.3.5
|
OpenTK 0.3.4 -> 0.3.5
|
||||||
+ Thanks to Erik Ylvisaker's hard work, OpenTK now works under both Windows and X11.
|
+ Thanks to Erik Ylvisaker's hard work, OpenTK now works under both Windows and X11.
|
||||||
+ The GLContext class now contains all needed code for mode switching.
|
+ The GLContext class now contains all needed code for mode switching.
|
||||||
|
|
31
prebuild.xml
31
prebuild.xml
|
@ -164,6 +164,34 @@
|
||||||
<Reference name="System"/>
|
<Reference name="System"/>
|
||||||
<Reference name="System.Drawing"/>
|
<Reference name="System.Drawing"/>
|
||||||
<Reference name="System.Windows.Forms"/>
|
<Reference name="System.Windows.Forms"/>
|
||||||
|
<Reference name="System.Data"/>
|
||||||
|
|
||||||
|
<Files>
|
||||||
|
<Match path="." pattern="*.cs" recurse="true"/>
|
||||||
|
</Files>
|
||||||
|
|
||||||
|
</Project>
|
||||||
|
|
||||||
|
<Project name="OpenTK.Examples.OpenGL.Basic.DisplayLists" path=".\Source\Examples\OpenGL\Basic\DisplayLists" 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"/>
|
||||||
|
<Reference name="System.Data"/>
|
||||||
|
|
||||||
<Files>
|
<Files>
|
||||||
<Match path="." pattern="*.cs" recurse="true"/>
|
<Match path="." pattern="*.cs" recurse="true"/>
|
||||||
|
@ -190,6 +218,7 @@
|
||||||
<Reference name="System"/>
|
<Reference name="System"/>
|
||||||
<Reference name="System.Drawing"/>
|
<Reference name="System.Drawing"/>
|
||||||
<Reference name="System.Windows.Forms"/>
|
<Reference name="System.Windows.Forms"/>
|
||||||
|
<Reference name="System.Data"/>
|
||||||
|
|
||||||
<Files>
|
<Files>
|
||||||
<Match path="." pattern="*.cs" recurse="true"/>
|
<Match path="." pattern="*.cs" recurse="true"/>
|
||||||
|
@ -216,6 +245,7 @@
|
||||||
<Reference name="System"/>
|
<Reference name="System"/>
|
||||||
<Reference name="System.Drawing"/>
|
<Reference name="System.Drawing"/>
|
||||||
<Reference name="System.Windows.Forms"/>
|
<Reference name="System.Windows.Forms"/>
|
||||||
|
<Reference name="System.Data"/>
|
||||||
|
|
||||||
<Files>
|
<Files>
|
||||||
<Match path="." pattern="*.cs" recurse="true"/>
|
<Match path="." pattern="*.cs" recurse="true"/>
|
||||||
|
@ -242,6 +272,7 @@
|
||||||
<Reference name="System"/>
|
<Reference name="System"/>
|
||||||
<Reference name="System.Drawing"/>
|
<Reference name="System.Drawing"/>
|
||||||
<Reference name="System.Windows.Forms"/>
|
<Reference name="System.Windows.Forms"/>
|
||||||
|
<Reference name="System.Data"/>
|
||||||
|
|
||||||
<Files>
|
<Files>
|
||||||
<Match path="." pattern="*.cs" recurse="true"/>
|
<Match path="." pattern="*.cs" recurse="true"/>
|
||||||
|
|
Loading…
Reference in a new issue