mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 06:25:32 +00:00
Directory structure updates (more to come)
Updated OpenTK.OpenGL.Bind (0.7.7) Split GL enums, core and extensions to different files. Extension support is missing for the time being. Updated the framework implementation and namespace.
This commit is contained in:
parent
261df17632
commit
17b411e2ec
|
@ -23,7 +23,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Specifications", "Specifica
|
|||
Specifications\glxenumext.spec = Specifications\glxenumext.spec
|
||||
Specifications\glxext.spec = Specifications\glxext.spec
|
||||
Specifications\try.spec = Specifications\try.spec
|
||||
Specifications\TypeMap.txt = Specifications\TypeMap.txt
|
||||
Specifications\wgl.spec = Specifications\wgl.spec
|
||||
Specifications\wgl.tm = Specifications\wgl.tm
|
||||
Specifications\wglenum.spec = Specifications\wglenum.spec
|
||||
|
@ -49,8 +48,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenGL", "OpenGL", "{2F3FEA
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.OpenGL", "Source\OpenGL\OpenGL\OpenTK.OpenGL.csproj", "{836876D1-0C8D-4240-BEE4-859D9D3D46CB}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{FDFA00B6-FA81-4658-86E1-F312EFB42E1C} = {FDFA00B6-FA81-4658-86E1-F312EFB42E1C}
|
||||
{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}"
|
||||
|
@ -65,7 +64,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.Platform.X", "Source
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{508EF114-8C2A-470D-89FE-5AC15B336B4C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Framework", "Source\Framework\Framework.csproj", "{26B55626-4EAB-4CAE-82FE-93CD6564D9EA}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenTK.Framework", "Source\Framework\OpenTK.Framework.csproj", "{26B55626-4EAB-4CAE-82FE-93CD6564D9EA}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
|
|
@ -11,7 +11,7 @@ using OpenTK.OpenGL;
|
|||
|
||||
namespace OpenTK.Examples.OpenGL.GLSL
|
||||
{
|
||||
public partial class Cube : Framework
|
||||
public partial class Cube : OpenTK.Frameworks.Framework
|
||||
{
|
||||
#region Shaders
|
||||
string[] vertex_shader_source =
|
||||
|
@ -88,6 +88,9 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
|||
{
|
||||
base.OnResize(e);
|
||||
|
||||
// if (this.Context == null)
|
||||
// return;
|
||||
|
||||
if (ClientSize.Height == 0)
|
||||
ClientSize = new System.Drawing.Size(ClientSize.Width, 1);
|
||||
|
||||
|
@ -126,7 +129,7 @@ namespace OpenTK.Examples.OpenGL.GLSL
|
|||
DrawCube();
|
||||
|
||||
Context.SwapBuffers();
|
||||
//this.Invalidate();
|
||||
this.Invalidate();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -5,16 +5,23 @@
|
|||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{46980D11-67FA-4B33-903F-BC9D8A4FE60F}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>OpenTK.Examples.OpenGL.GLSL</RootNamespace>
|
||||
<AssemblyName>GLSL.Lesson01</AssemblyName>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<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>
|
||||
<DebugType>Full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\..\..\Binaries\Debug\Examples\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
|
@ -63,9 +70,9 @@
|
|||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\Framework\Framework.csproj">
|
||||
<ProjectReference Include="..\..\..\..\Framework\OpenTK.Framework.csproj">
|
||||
<Project>{26B55626-4EAB-4CAE-82FE-93CD6564D9EA}</Project>
|
||||
<Name>Framework %28Projects\OpenTK\Framework\Framework%29</Name>
|
||||
<Name>OpenTK.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\OpenGL\OpenGL\OpenTK.OpenGL.csproj">
|
||||
<Project>{836876D1-0C8D-4240-BEE4-859D9D3D46CB}</Project>
|
||||
|
@ -76,5 +83,5 @@
|
|||
<Name>OpenTK.Platform.Windows</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||
</Project>
|
|
@ -15,40 +15,111 @@ using System.Runtime.InteropServices;
|
|||
using OpenTK.OpenGL.Platform;
|
||||
using OpenTK.OpenGL;
|
||||
|
||||
namespace OpenTK
|
||||
namespace OpenTK.Frameworks
|
||||
{
|
||||
public class Framework : Form, IDisposable
|
||||
public partial class Framework : Form, IDisposable
|
||||
{
|
||||
#region Public properties
|
||||
|
||||
#region Context
|
||||
|
||||
private GLContext _context;
|
||||
|
||||
public GLContext Context
|
||||
{
|
||||
get { return _context; }
|
||||
set { _context = value; }
|
||||
protected set { _context = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
delegate bool IsIdleDelegate();
|
||||
IsIdleDelegate IsIdle;
|
||||
#region Fullscreen property
|
||||
|
||||
private bool _fullscreen;
|
||||
|
||||
public bool Fullscreen
|
||||
{
|
||||
get { return _fullscreen; }
|
||||
set { _fullscreen = Implementation.ToggleFullscreen(_fullscreen); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DesktopResolution property
|
||||
|
||||
private Size _desktop_resolution;
|
||||
|
||||
public Size DesktopResolution
|
||||
{
|
||||
get { return _desktop_resolution; }
|
||||
protected set { _desktop_resolution = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DesktopRefreshRate property
|
||||
|
||||
private float _desktop_refresh_rate;
|
||||
|
||||
public float DesktopRefreshRate
|
||||
{
|
||||
get { return _desktop_refresh_rate; }
|
||||
protected set { _desktop_refresh_rate = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
FrameworkImplementation Implementation;
|
||||
|
||||
#region Constructors
|
||||
|
||||
public Framework()
|
||||
{
|
||||
Open(null, 640, 480, 8, 8, 8, 8, 16, 0, false);
|
||||
Setup(null, 640, 480, 8, 8, 8, 8, 16, 0, false);
|
||||
}
|
||||
|
||||
public Framework(string title, int width, int height, int red, int green, int blue, int alpha, int depth, int stencil, bool fullscreen)
|
||||
{
|
||||
Open(title, width, height, red, green, blue, alpha, depth, stencil, fullscreen);
|
||||
Setup(title, width, height, red, green, blue, alpha, depth, stencil, fullscreen);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void Open(string title, int width, int height, int red, int green, int blue, int alpha, int depth, int stencil, bool fullscreen)
|
||||
public void Setup(string title, int width, int height, int red, int green, int blue, int alpha, int depth, int stencil, bool fullscreen)
|
||||
{
|
||||
Application.Idle += new EventHandler(OnIdle);
|
||||
// Set platform.
|
||||
try
|
||||
{
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT || Environment.OSVersion.Platform == PlatformID.Win32Windows)
|
||||
{
|
||||
Implementation = new WindowsImplementation(this);
|
||||
}
|
||||
else if (Environment.OSVersion.Platform == PlatformID.Unix)
|
||||
{
|
||||
Implementation = new X11Implementation();
|
||||
}
|
||||
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());
|
||||
throw e;
|
||||
}
|
||||
|
||||
Implementation.Setup();
|
||||
this.HandleCreated += new EventHandler(Implementation.OnHandleCreated);
|
||||
|
||||
//Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms");
|
||||
//if (xplatui != null)
|
||||
//{
|
||||
// Context = GLContext.Create(this, 8, 8, 8, 8, 16, 0);
|
||||
// //Context.MakeCurrent();
|
||||
//}
|
||||
|
||||
Context = GLContext.Create(this, red, green, blue, alpha, depth, stencil);
|
||||
|
||||
|
@ -60,85 +131,15 @@ namespace OpenTK
|
|||
//this.SetStyle(ControlStyles.ResizeRedraw, true); // Redraw On Resize
|
||||
this.SetStyle(ControlStyles.UserPaint, true); // We'll Handle Painting Ourselves
|
||||
|
||||
try
|
||||
{
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT ||
|
||||
Environment.OSVersion.Platform == PlatformID.Win32Windows)
|
||||
{
|
||||
IsIdle = new IsIdleDelegate(WindowsIsIdle);
|
||||
WindowsOpen(title, width, height, red, green, blue, alpha, depth, stencil, fullscreen);
|
||||
}
|
||||
else if (Environment.OSVersion.Platform == PlatformID.Unix)
|
||||
{
|
||||
IsIdle = new IsIdleDelegate(XIsIdle);
|
||||
}
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
#region Open functions
|
||||
|
||||
public void WindowsOpen(string title, int width, int height, int red, int green, int blue, int alpha, int depth, int stencil, bool fullscreen)
|
||||
{
|
||||
if (title == null)
|
||||
title = "OpenTK Windows application";
|
||||
this.Text = title;
|
||||
|
||||
if (fullscreen)
|
||||
{
|
||||
Api.DeviceMode ScreenSettings = new Api.DeviceMode(); // Device Mode
|
||||
ScreenSettings.Size = (short)Marshal.SizeOf(ScreenSettings); // Size Of The Devmode Structure
|
||||
ScreenSettings.PelsWidth = width; // Selected Screen Width
|
||||
ScreenSettings.PelsHeight = height; // Selected Screen Height
|
||||
ScreenSettings.BitsPerPel = red + green + blue + alpha; // Selected Bits Per Pixel
|
||||
ScreenSettings.Fields = Api.Constants.DM_BITSPERPEL | Api.Constants.DM_PELSWIDTH | Api.Constants.DM_PELSHEIGHT;
|
||||
|
||||
// Try To Set Selected Mode And Get Results. NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
|
||||
if (Api.ChangeDisplaySettings(ref ScreenSettings, Api.Constants.CDS_FULLSCREEN) == Api.Constants.DISP_CHANGE_SUCCESSFUL)
|
||||
{
|
||||
this.FormBorderStyle = FormBorderStyle.None;
|
||||
this.StartPosition = FormStartPosition.Manual;
|
||||
this.Location = new System.Drawing.Point(0, 0);
|
||||
this.Region = new Region(new Rectangle(0, 0, width, height));
|
||||
this.Capture = true;
|
||||
this.SetTopLevel(true);
|
||||
Cursor.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Handle failure.
|
||||
}
|
||||
}
|
||||
|
||||
this.Size = new Size(width, height);
|
||||
|
||||
Application.Idle += new EventHandler(OnIdle);
|
||||
}
|
||||
|
||||
public void XOpen(string title, int width, int height, int red, int green, int blue, int alpha, int depth, int stencil, bool fullscreen)
|
||||
{
|
||||
Context = GLContext.Create(this, red, green, blue, alpha, depth, stencil);
|
||||
|
||||
if (title == null)
|
||||
title = "OpenTK X application";
|
||||
this.Text = title;
|
||||
|
||||
this.Size = new Size(width, height);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
//override protected void WndProc(ref Message m)
|
||||
//{
|
||||
// base.WndProc(ref m);
|
||||
// //OnPaint(null);
|
||||
//}
|
||||
|
||||
#region Event Handlers
|
||||
|
||||
/// <summary>
|
||||
|
@ -146,9 +147,9 @@ namespace OpenTK
|
|||
/// </summary>
|
||||
/// <param name="sender">Not used.</param>
|
||||
/// <param name="e">Not used.</param>
|
||||
private void OnIdle(object sender, EventArgs e)
|
||||
protected void OnIdle(object sender, EventArgs args)
|
||||
{
|
||||
while (IsIdle())
|
||||
while (Implementation.IsIdle())
|
||||
{
|
||||
if (ActiveForm != this)
|
||||
Thread.Sleep(100);
|
||||
|
@ -156,21 +157,6 @@ namespace OpenTK
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if there all pending messages have been processed.
|
||||
/// </summary>
|
||||
/// <returns>Returns true if there are no messages left, false otherwise.</returns>
|
||||
private bool WindowsIsIdle()
|
||||
{
|
||||
Api.Message msg;
|
||||
return !OpenTK.Platform.Windows.Api.PeekMessage(out msg, IntPtr.Zero, 0, 0, 0);
|
||||
}
|
||||
|
||||
private bool XIsIdle()
|
||||
{
|
||||
throw new NotImplementedException("IsIdle handler not implemented yet!");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IDisposable Members
|
||||
|
|
19
Source/Framework/FrameworkImplementation.cs
Normal file
19
Source/Framework/FrameworkImplementation.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace OpenTK.Frameworks
|
||||
{
|
||||
public partial class Framework
|
||||
{
|
||||
internal abstract class FrameworkImplementation
|
||||
{
|
||||
abstract public void OnHandleCreated(object sender, EventArgs args);
|
||||
abstract public bool IsIdle();
|
||||
abstract public void Setup();
|
||||
//abstract public void CloseWindow();
|
||||
abstract public bool ToggleFullscreen(bool fullscreen);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,8 +7,10 @@
|
|||
<ProjectGuid>{26B55626-4EAB-4CAE-82FE-93CD6564D9EA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Framework</RootNamespace>
|
||||
<AssemblyName>Framework</AssemblyName>
|
||||
<RootNamespace>OpenTK</RootNamespace>
|
||||
<AssemblyName>OpenTK.Framework</AssemblyName>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -38,7 +40,16 @@
|
|||
<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>
|
||||
<Compile Include="X11Implementation.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenGL\OpenGL\OpenTK.OpenGL.csproj">
|
||||
|
@ -54,6 +65,9 @@
|
|||
<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.
|
|
@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
|||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("0.3.1.0")]
|
||||
[assembly: AssemblyFileVersion("0.3.1.0")]
|
||||
|
|
85
Source/Framework/WindowsImplementation.cs
Normal file
85
Source/Framework/WindowsImplementation.cs
Normal file
|
@ -0,0 +1,85 @@
|
|||
#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;
|
||||
// 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()
|
||||
{
|
||||
}
|
||||
|
||||
public override bool ToggleFullscreen(bool fullscreen)
|
||||
{
|
||||
if (fullscreen)
|
||||
{
|
||||
Api.DeviceMode ScreenSettings = new Api.DeviceMode(); // Device Mode
|
||||
ScreenSettings.Size = (short)Marshal.SizeOf(ScreenSettings); // Size Of The Devmode Structure
|
||||
ScreenSettings.PelsWidth = 640;// width; // Selected Screen Width
|
||||
ScreenSettings.PelsHeight = 480;// height; // Selected Screen Height
|
||||
ScreenSettings.BitsPerPel = 32;// red + green + blue + alpha; // Selected Bits Per Pixel
|
||||
ScreenSettings.Fields = Api.Constants.DM_BITSPERPEL | Api.Constants.DM_PELSWIDTH | Api.Constants.DM_PELSHEIGHT;
|
||||
|
||||
// Try To Set Selected Mode And Get Results. NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
|
||||
if (Api.ChangeDisplaySettings(ref ScreenSettings, Api.Constants.CDS_FULLSCREEN) == Api.Constants.DISP_CHANGE_SUCCESSFUL)
|
||||
{
|
||||
framework.FormBorderStyle = FormBorderStyle.None;
|
||||
framework.StartPosition = FormStartPosition.Manual;
|
||||
framework.Location = new System.Drawing.Point(0, 0);
|
||||
//this.Region = new Region(new Rectangle(0, 0, width, height));
|
||||
framework.Capture = true;
|
||||
framework.SetTopLevel(true);
|
||||
Cursor.Hide();
|
||||
|
||||
return !fullscreen;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Handle failure.
|
||||
}
|
||||
}
|
||||
|
||||
return fullscreen;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
53
Source/Framework/X11Implementation.cs
Normal file
53
Source/Framework/X11Implementation.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
#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 ToggleFullscreen(bool fullscreen)
|
||||
{
|
||||
throw new Exception("The method or operation is not implemented.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +1,18 @@
|
|||
OpenTK.OpenGL.Bind 0.7.6
|
||||
OpenTK.OpenGL.Bind 0.7.7
|
||||
|
||||
0.7.6 -> 0.7.7
|
||||
+ Several bugfixes regarding bugs from the latest (0.7.6) code synchronisation between Tao.GlBindGen and OpenTK.OpenGL.Bind
|
||||
+ Split the Enums, Core OpenGL and Extension OpenGL functions into different files. This speeds up the Visual Studio IDE a lot.
|
||||
+ The Extension functions have been removed from the OpenTK.OpenGL.GL class. They will be added back on a later version, probably as OpenTK.OpenGL.GL.Extensions. No need to clatter up the code API with thousands of mostly useless extensions.
|
||||
+ Applications load much faster now.
|
||||
+ Killed the Context class generation. It added a lot of complexity for little gain (what, cleaner OOP internal structure? Oh, please!) This move frees up the Context classes which can now be updated without dragging around several thousand function initialisations.
|
||||
+ OpenTK.OpenGL.GL is self-contained now. Delegates are initialised statically, calling the platform specific *GetAddress functions where needed (they are contained in the GL class, too - but not auto-generated).
|
||||
+ Revamped the WriteSpecs class. Its methods are now completely modular (enum, core and extension writers have been split).
|
||||
+ This still needs some refactoring to reduce code copy-paste and allow for future wgl / glx binding generation.
|
||||
|
||||
|
||||
0.7.5.2 -> 0.7.6
|
||||
+ Added NeedWrapper and WrapperType properties to each parameter (needed for more fince grained control on wrapper generation).
|
||||
+ Added NeedWrapper and WrapperType properties to each parameter (needed for more fine grained control on wrapper generation).
|
||||
+ Added Function, Parameter, ParameterCollection (deep) copy constructors. This allows simpler code in many places (since we can now create new Functions without fear of affecting the old ones, for example).
|
||||
+ Merged the ParameterCollection.cs with Parameter.cs
|
||||
+ Added the FunctionBody class which contains the contents of a function as a list of strings. It is mainly intended for wrappers (allows cleaner code, too).
|
|
@ -1,5 +1,6 @@
|
|||
OpenTK.OpenGL.Bind 0.7.6 todos:
|
||||
OpenTK.OpenGL.Bind 0.7.7 todos:
|
||||
|
||||
+ Add the binding generation for extensions.
|
||||
+ Clean up the reader.
|
||||
+ Add more settings to Settings.cs (the name of the files to read).
|
||||
+ Comment the code.
|
|
@ -96,10 +96,10 @@ namespace OpenTK.OpenGL.Bind
|
|||
|
||||
SpecWriter.WriteSpecs(Settings.OutputPath, Settings.GLClass, functions, wrappers, enums);
|
||||
|
||||
ContextWriter.WriteMainContext(Settings.OutputPath, "GLContext", Settings.GLClass, functions);
|
||||
ContextWriter.WriteDerivedContext(Settings.OutputPath, "WindowsContext", Settings.GLClass, functions, "1.0", "1.1");
|
||||
ContextWriter.WriteDerivedContext(Settings.OutputPath, "WindowsVistaContext", Settings.GLClass, functions, "1.0", "1.1", "1.2", "1.3", "1.4");
|
||||
ContextWriter.WriteDerivedContext(Settings.OutputPath, "X11Context", Settings.GLClass, functions, "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "2.0");
|
||||
//ContextWriter.WriteMainContext(Settings.OutputPath, "GLContext", Settings.GLClass, functions);
|
||||
//ContextWriter.WriteDerivedContext(Settings.OutputPath, "WindowsContext", Settings.GLClass, functions, "1.0", "1.1");
|
||||
//ContextWriter.WriteDerivedContext(Settings.OutputPath, "WindowsVistaContext", Settings.GLClass, functions, "1.0", "1.1", "1.2", "1.3", "1.4");
|
||||
//ContextWriter.WriteDerivedContext(Settings.OutputPath, "X11Context", Settings.GLClass, functions, "1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "2.0");
|
||||
|
||||
// GLX binding generation.
|
||||
//Translation.GLXTypes = SpecReader.ReadTypeMap("glx.tm"); // Works semi-ok.
|
||||
|
|
|
@ -54,12 +54,11 @@
|
|||
<Compile Include="Structures\Function.cs" />
|
||||
<Compile Include="Structures\Parameter.cs" />
|
||||
<Compile Include="TranslateSpecs.cs" />
|
||||
<Compile Include="WriteContexts.cs" />
|
||||
<Compile Include="WriteSpecs.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="changelog.txt" />
|
||||
<Content Include="todo.txt" />
|
||||
<Content Include="Documentation\changelog.txt" />
|
||||
<Content Include="Documentation\todo.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
|||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.7.6.0")]
|
||||
[assembly: AssemblyFileVersion("0.7.6.0")]
|
||||
[assembly: AssemblyVersion("0.7.7.0")]
|
||||
[assembly: AssemblyFileVersion("0.7.7.0")]
|
||||
|
|
|
@ -128,6 +128,7 @@ namespace OpenTK.OpenGL.Bind
|
|||
#endregion
|
||||
|
||||
#region Read enum specs
|
||||
|
||||
public static Hashtable ReadEnumSpecs(string file)
|
||||
{
|
||||
Hashtable enums = new Hashtable();
|
||||
|
@ -235,6 +236,7 @@ namespace OpenTK.OpenGL.Bind
|
|||
|
||||
return enums;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Read type map
|
||||
|
|
|
@ -9,6 +9,8 @@ using System.Text;
|
|||
|
||||
namespace OpenTK.OpenGL.Bind
|
||||
{
|
||||
#region Constant class
|
||||
|
||||
/// <summary>
|
||||
/// Represents an opengl constant in C# format. Both the constant name and value
|
||||
/// can be retrieved or set. The value can be either a number, another constant
|
||||
|
@ -76,18 +78,20 @@ namespace OpenTK.OpenGL.Bind
|
|||
|
||||
#endregion
|
||||
|
||||
#region Helper functions
|
||||
#region public string ToString()
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string that represents the full constant declaration without decorations
|
||||
/// (eg const uint GL_XXX_YYY = 0xDEADBEEF).
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
new public string ToString()
|
||||
override public string ToString()
|
||||
{
|
||||
return Name + " = " + Value;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ using System.Text;
|
|||
|
||||
namespace OpenTK.OpenGL.Bind
|
||||
{
|
||||
#region class Enum
|
||||
|
||||
public class Enum
|
||||
{
|
||||
string _name;
|
||||
|
@ -42,4 +44,6 @@ namespace OpenTK.OpenGL.Bind
|
|||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ using System.Text;
|
|||
|
||||
namespace OpenTK.OpenGL.Bind
|
||||
{
|
||||
#region class Function
|
||||
|
||||
/// <summary>
|
||||
/// Represents an opengl function.
|
||||
/// The return value, function name, function parameters and opengl version can be retrieved or set.
|
||||
|
@ -219,6 +221,10 @@ namespace OpenTK.OpenGL.Bind
|
|||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region class FunctionBody : List<string>
|
||||
|
||||
public class FunctionBody : List<string>
|
||||
{
|
||||
public FunctionBody()
|
||||
|
@ -255,4 +261,6 @@ namespace OpenTK.OpenGL.Bind
|
|||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ using System.Runtime.InteropServices;
|
|||
|
||||
namespace OpenTK.OpenGL.Bind
|
||||
{
|
||||
#region Parameter class
|
||||
|
||||
/// <summary>
|
||||
/// Represents a single parameter of an opengl function.
|
||||
/// </summary>
|
||||
|
@ -24,6 +26,10 @@ namespace OpenTK.OpenGL.Bind
|
|||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new parameter from the parameters passed (deep copy).
|
||||
/// </summary>
|
||||
/// <param name="p">The parameter to copy from.</param>
|
||||
public Parameter(Parameter p)
|
||||
{
|
||||
if (p == null)
|
||||
|
@ -190,14 +196,7 @@ namespace OpenTK.OpenGL.Bind
|
|||
//if (Flow == FlowDirection.Out && !Array && !(Type == "IntPtr"))
|
||||
// sb.Append("out ");
|
||||
|
||||
//if (Unchecked)
|
||||
// sb.Append("unchecked(");
|
||||
|
||||
sb.Append(Type);
|
||||
|
||||
//if (Unchecked)
|
||||
// sb.Append(")");
|
||||
|
||||
if (Array)
|
||||
sb.Append("[]");
|
||||
|
||||
|
@ -209,8 +208,13 @@ namespace OpenTK.OpenGL.Bind
|
|||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ParameterCollection class
|
||||
|
||||
/// <summary>
|
||||
/// Holds the parameter list of an opengl function.
|
||||
/// </summary>
|
||||
public class ParameterCollection : List<Parameter>
|
||||
{
|
||||
#region Constructors
|
||||
|
@ -229,6 +233,12 @@ namespace OpenTK.OpenGL.Bind
|
|||
|
||||
#endregion
|
||||
|
||||
#region override public string ToString()
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns>The parameter list of an opengl function in the form ( [parameters] )</returns>
|
||||
override public string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
@ -256,6 +266,10 @@ namespace OpenTK.OpenGL.Bind
|
|||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public ParameterCollection ReplaceAll(Parameter, Parameter)
|
||||
|
||||
/// <summary>
|
||||
/// Replaces all parameters that match the old_param with the new_param.
|
||||
/// </summary>
|
||||
|
@ -291,6 +305,10 @@ namespace OpenTK.OpenGL.Bind
|
|||
return pc;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region public ParameterCollection Replace(Parameter, Parameter)
|
||||
|
||||
/// <summary>
|
||||
/// Replaces the first parameter that matches old_param with new_param.
|
||||
/// </summary>
|
||||
|
@ -326,6 +344,8 @@ namespace OpenTK.OpenGL.Bind
|
|||
|
||||
return pc;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -11,19 +11,17 @@ using System.Collections;
|
|||
namespace OpenTK.OpenGL.Bind
|
||||
{
|
||||
#region WrapperTypes enum
|
||||
|
||||
public enum WrapperTypes
|
||||
{
|
||||
None,
|
||||
VoidPointerIn,
|
||||
VoidPointerOut,
|
||||
VoidPointer,
|
||||
ArrayOut,
|
||||
ArrayIn,
|
||||
VoidArray,
|
||||
Array,
|
||||
UShortMaskParameter,
|
||||
UncheckedParameter,
|
||||
ReturnsString,
|
||||
ReturnsVoidPointer,
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
static class Translation
|
||||
|
@ -222,23 +220,22 @@ namespace OpenTK.OpenGL.Bind
|
|||
{
|
||||
string s;
|
||||
|
||||
// Map parameters.
|
||||
foreach (Parameter p in f.Parameters)
|
||||
foreach (Parameter p in f.Parameters) // Translate each parameter of the function, and check for needed wrappers.
|
||||
{
|
||||
#region Default name translation
|
||||
#region Translate parameter name
|
||||
|
||||
if (parameter_names.TryGetValue(p.Name, out s))
|
||||
p.Name = s;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Default type translation
|
||||
#region Translate parameter type
|
||||
|
||||
if (p.Type.Contains("Boolean"))
|
||||
{
|
||||
p.Type = "GLboolean";
|
||||
}
|
||||
else if (enums.ContainsKey(p.Type))
|
||||
//if (p.Type.Contains("Boolean"))
|
||||
//{
|
||||
// p.Type = "GLboolean";
|
||||
//}
|
||||
if (enums.ContainsKey(p.Type))
|
||||
{
|
||||
p.Type = "Enums." + p.Type;
|
||||
}
|
||||
|
@ -250,51 +247,47 @@ namespace OpenTK.OpenGL.Bind
|
|||
else if (GLTypes.TryGetValue(p.Type, out s))
|
||||
p.Type = s;
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Wrapper translations
|
||||
#region Check for needed wrappers
|
||||
|
||||
if (p.Type.Contains("ushort") && f.Name.Contains("LineStipple"))
|
||||
if (p.Type.Contains("ushort") && f.Name.Contains("LineStipple")) // glLineStipple needs wrapper to allow for unchecked mask values.
|
||||
{
|
||||
//f.NeedsWrapper = true;
|
||||
//f.WrapperType = WrapperTypes.UShortMaskParameter;
|
||||
p.NeedsWrapper = true;
|
||||
p.WrapperType = WrapperTypes.UShortMaskParameter;
|
||||
p.WrapperType = WrapperTypes.UncheckedParameter;
|
||||
p.Unchecked = true;
|
||||
}
|
||||
else if (p.Array && p.Type.Contains("string"))
|
||||
else if (p.Array && p.Type.Contains("string")) // string parameters do not need special wrappers.
|
||||
{
|
||||
p.NeedsWrapper = false;
|
||||
p.WrapperType = WrapperTypes.None;
|
||||
}
|
||||
else if (p.Array && p.Type.Contains("char"))
|
||||
else if (p.Array && p.Type.Contains("char")) // GLchar[] parameters should become (in) string or (out) StringBuilder
|
||||
{
|
||||
if (p.Flow == Parameter.FlowDirection.Out)
|
||||
p.Type = "StringBuilder";
|
||||
else
|
||||
p.Type = "string";
|
||||
p.Array = false;
|
||||
//f.Nee
|
||||
}
|
||||
else if (p.Array)
|
||||
else if (p.Array) // All other array parameters need wrappers (around IntPtr).
|
||||
{
|
||||
//f.NeedsWrapper = true;
|
||||
p.NeedsWrapper = true;
|
||||
|
||||
if (p.Type.Contains("void"))
|
||||
p.WrapperType = WrapperTypes.VoidPointer;
|
||||
p.WrapperType = WrapperTypes.VoidArray;
|
||||
else
|
||||
p.WrapperType = WrapperTypes.Array;
|
||||
|
||||
p.Type = "IntPtr";
|
||||
p.Array = false;
|
||||
p.Flow = Parameter.FlowDirection.Undefined;
|
||||
p.Array = false; // We do not want an array of IntPtrs (IntPtr[]) - it is the IntPtr that points to the array.
|
||||
p.Flow = Parameter.FlowDirection.Undefined; // The same wrapper works for either in or out parameters.
|
||||
}
|
||||
|
||||
if (p.NeedsWrapper)
|
||||
if (p.NeedsWrapper) // If there is at least 1 parameter that needs wrappers, mark the funcction for wrapping.
|
||||
{
|
||||
f.NeedsWrapper = true;
|
||||
//f.WrapperType = WrapperTypes.Array;
|
||||
f.WrapperType = p.WrapperType;
|
||||
}
|
||||
|
||||
|
@ -315,7 +308,7 @@ namespace OpenTK.OpenGL.Bind
|
|||
{
|
||||
if (f.NeedsWrapper)
|
||||
{
|
||||
if (f.WrapperType == WrapperTypes.UShortMaskParameter)
|
||||
if (f.WrapperType == WrapperTypes.UncheckedParameter)
|
||||
{
|
||||
w = new Function(f);
|
||||
w.Name = w.Name.TrimEnd('_');
|
||||
|
|
|
@ -14,38 +14,48 @@ namespace OpenTK.OpenGL.Bind
|
|||
{
|
||||
static partial class SpecWriter
|
||||
{
|
||||
#region WriteSpecs
|
||||
#region Write specs
|
||||
|
||||
public static void WriteSpecs(string output_path, string class_name, List<Function> functions, List<Function> wrappers, Hashtable enums)
|
||||
{
|
||||
string filename = Path.Combine(output_path, class_name + ".cs");
|
||||
WriteEnumSpecs(output_path, class_name, enums);
|
||||
WriteCoreFunctionSpecs(output_path, class_name, functions, wrappers);
|
||||
WriteExtensionFunctionSpecs(output_path, class_name, functions, wrappers);
|
||||
}
|
||||
|
||||
if (!Directory.Exists(Settings.OutputPath))
|
||||
Directory.CreateDirectory(Settings.OutputPath);
|
||||
#endregion
|
||||
|
||||
#region Write extension function specs
|
||||
|
||||
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");
|
||||
|
||||
if (!Directory.Exists(output_path))
|
||||
Directory.CreateDirectory(output_path);
|
||||
|
||||
StreamWriter sw = new StreamWriter(filename, false);
|
||||
|
||||
Console.WriteLine("Writing {0} class to {1}", class_name, filename);
|
||||
|
||||
WriteLicense(sw);
|
||||
WriteUsingDirectives(sw);
|
||||
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine("using System.Runtime.InteropServices;");
|
||||
sw.WriteLine("using System.Text;");
|
||||
sw.WriteLine();
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
|
||||
WriteTypes(sw);
|
||||
WriteEnums(sw, enums);
|
||||
|
||||
sw.WriteLine(" public static partial class {0}", class_name);
|
||||
sw.WriteLine(" static public partial class {0}", class_name);
|
||||
sw.WriteLine(" {");
|
||||
sw.WriteLine(" static public class Extensions");
|
||||
sw.WriteLine(" {");
|
||||
|
||||
WriteFunctionSignatures(sw, functions);
|
||||
WriteDllImports(sw, functions);
|
||||
WriteFunctions(sw, functions);
|
||||
WriteWrappers(sw, wrappers);
|
||||
WriteExtensionFunctionSignatures(sw, functions);
|
||||
WriteExtensionFunctions(sw, functions);
|
||||
WriteExtensionWrappers(sw, wrappers);
|
||||
|
||||
sw.WriteLine(" }");
|
||||
sw.WriteLine(" }");
|
||||
sw.WriteLine("}");
|
||||
sw.WriteLine();
|
||||
|
@ -53,17 +63,108 @@ namespace OpenTK.OpenGL.Bind
|
|||
sw.Flush();
|
||||
sw.Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region WriteLicense
|
||||
#region Write core function specs
|
||||
|
||||
private static void WriteCoreFunctionSpecs(string output_path, string class_name, List<Function> functions, List<Function> wrappers)
|
||||
{
|
||||
string filename = Path.Combine(output_path, class_name + ".cs");
|
||||
|
||||
if (!Directory.Exists(output_path))
|
||||
Directory.CreateDirectory(output_path);
|
||||
|
||||
StreamWriter sw = new StreamWriter(filename, false);
|
||||
|
||||
Console.WriteLine("Writing {0} class to {1}", class_name, filename);
|
||||
|
||||
WriteLicense(sw);
|
||||
WriteUsingDirectives(sw);
|
||||
|
||||
WriteTypes(sw);
|
||||
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
sw.WriteLine(" static public partial class {0}", class_name);
|
||||
sw.WriteLine(" {");
|
||||
|
||||
sw.WriteLine(" static public void Init()");
|
||||
sw.WriteLine(" {");
|
||||
sw.WriteLine(" }");
|
||||
|
||||
WriteCoreFunctionSignatures(sw, functions);
|
||||
WriteDllImports(sw, functions);
|
||||
WriteCoreFunctions(sw, functions);
|
||||
WriteCoreWrappers(sw, wrappers);
|
||||
WriteCoreConstructor(sw, class_name, functions);
|
||||
|
||||
sw.WriteLine(" }");
|
||||
|
||||
sw.WriteLine("}");
|
||||
sw.WriteLine();
|
||||
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write enum specs
|
||||
|
||||
private static void WriteEnumSpecs(string output_path, string class_name, Hashtable enums)
|
||||
{
|
||||
string filename = Path.Combine(output_path, class_name + "Enums.cs");
|
||||
|
||||
if (!Directory.Exists(output_path))
|
||||
Directory.CreateDirectory(output_path);
|
||||
|
||||
StreamWriter sw = new StreamWriter(filename, false);
|
||||
|
||||
Console.WriteLine("Writing {0} class to {1}", class_name, filename);
|
||||
|
||||
WriteLicense(sw);
|
||||
WriteUsingDirectives(sw);
|
||||
|
||||
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
|
||||
sw.WriteLine("{");
|
||||
|
||||
WriteTypes(sw);
|
||||
WriteEnums(sw, enums);
|
||||
|
||||
sw.WriteLine("}");
|
||||
sw.WriteLine();
|
||||
|
||||
sw.Flush();
|
||||
sw.Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write license
|
||||
|
||||
public static void WriteLicense(StreamWriter sw)
|
||||
{
|
||||
sw.WriteLine("#region License");
|
||||
sw.WriteLine("//Copyright (c) 2006 Stephen Apostolopoulos");
|
||||
sw.WriteLine("//THIS FILE IS AUTOMATICALLY GENERATED");
|
||||
sw.WriteLine("//DO NOT EDIT BY HAND!!");
|
||||
sw.WriteLine("//See license.txt for license info");
|
||||
sw.WriteLine("#endregion");
|
||||
sw.WriteLine();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write using directivers
|
||||
|
||||
private static void WriteUsingDirectives(StreamWriter sw)
|
||||
{
|
||||
sw.WriteLine("using System;");
|
||||
sw.WriteLine("using System.Runtime.InteropServices;");
|
||||
sw.WriteLine("using System.Text;");
|
||||
sw.WriteLine();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write types
|
||||
|
@ -84,23 +185,13 @@ namespace OpenTK.OpenGL.Bind
|
|||
#endregion
|
||||
|
||||
#region Write enums
|
||||
|
||||
private static void WriteEnums(StreamWriter sw, Hashtable enums)
|
||||
{
|
||||
sw.WriteLine(" #region Enums");
|
||||
sw.WriteLine(" public struct Enums");
|
||||
sw.WriteLine(" {");
|
||||
|
||||
#region Missing constants
|
||||
|
||||
sw.WriteLine(" #region Missing Constants");
|
||||
sw.WriteLine();
|
||||
|
||||
sw.WriteLine();
|
||||
sw.WriteLine(" #endregion");
|
||||
sw.WriteLine();
|
||||
|
||||
#endregion
|
||||
|
||||
foreach (Enum e in enums.Values)
|
||||
{
|
||||
sw.WriteLine(e.ToString());
|
||||
|
@ -110,10 +201,12 @@ namespace OpenTK.OpenGL.Bind
|
|||
sw.WriteLine(" #endregion");
|
||||
sw.WriteLine();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write function signatures
|
||||
private static void WriteFunctionSignatures(StreamWriter sw, List<Function> functions)
|
||||
#region Write core function signatures
|
||||
|
||||
private static void WriteCoreFunctionSignatures(StreamWriter sw, List<Function> functions)
|
||||
{
|
||||
sw.WriteLine(" #region Function signatures");
|
||||
sw.WriteLine();
|
||||
|
@ -122,6 +215,8 @@ namespace OpenTK.OpenGL.Bind
|
|||
|
||||
foreach (Function f in functions)
|
||||
{
|
||||
if (f.Extension)
|
||||
continue;
|
||||
sw.WriteLine(" public delegate {0};", f.ToString());
|
||||
}
|
||||
|
||||
|
@ -129,9 +224,11 @@ namespace OpenTK.OpenGL.Bind
|
|||
sw.WriteLine(" #endregion");
|
||||
sw.WriteLine();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write dll imports
|
||||
#region Write core dll imports
|
||||
|
||||
private static void WriteDllImports(StreamWriter sw, List<Function> functions)
|
||||
{
|
||||
sw.WriteLine(" #region Imports");
|
||||
|
@ -152,18 +249,21 @@ namespace OpenTK.OpenGL.Bind
|
|||
sw.WriteLine(" #endregion");
|
||||
sw.WriteLine();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write functions
|
||||
#region Write core functions
|
||||
|
||||
private static void WriteFunctions(StreamWriter sw, List<Function> functions)
|
||||
private static void WriteCoreFunctions(StreamWriter sw, List<Function> functions)
|
||||
{
|
||||
sw.WriteLine(" #region Function initialisation");
|
||||
sw.WriteLine(" #region Static Functions (and static initialisation)");
|
||||
sw.WriteLine();
|
||||
|
||||
foreach (Function f in functions)
|
||||
{
|
||||
sw.WriteLine(" public static Delegates.{0} {0};", f.Name);
|
||||
if (f.Extension)
|
||||
continue;
|
||||
sw.WriteLine(" public static Delegates.{0} {0} = new Delegates.{0}(Imports.{0});", f.Name);
|
||||
}
|
||||
|
||||
sw.WriteLine();
|
||||
|
@ -173,9 +273,163 @@ namespace OpenTK.OpenGL.Bind
|
|||
|
||||
#endregion
|
||||
|
||||
#region Write wrappers
|
||||
#region Write core wrappers
|
||||
|
||||
public static void WriteWrappers(StreamWriter sw, List<Function> wrappers)
|
||||
public static void WriteCoreWrappers(StreamWriter sw, List<Function> wrappers)
|
||||
{
|
||||
sw.WriteLine(" #region Wrappers");
|
||||
sw.WriteLine();
|
||||
|
||||
if (wrappers != null)
|
||||
{
|
||||
foreach (Function f in wrappers)
|
||||
{
|
||||
if (f.Extension)
|
||||
continue;
|
||||
|
||||
sw.WriteLine(" #region {0}{1}", f.Name, f.Parameters.ToString());
|
||||
sw.WriteLine();
|
||||
|
||||
sw.WriteLine(" public static");
|
||||
sw.WriteLine(f.ToString(" "));
|
||||
|
||||
sw.WriteLine(" #endregion");
|
||||
sw.WriteLine();
|
||||
}
|
||||
}
|
||||
|
||||
sw.WriteLine(" #endregion");
|
||||
sw.WriteLine();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write core constructor
|
||||
|
||||
private static void WriteCoreConstructor(StreamWriter sw, string class_name, List<Function> functions)
|
||||
{
|
||||
sw.WriteLine(" #region static Constructor");
|
||||
sw.WriteLine();
|
||||
sw.WriteLine(" static {0}()", class_name);
|
||||
sw.WriteLine(" {");
|
||||
|
||||
List<String> import_list = new List<string>();
|
||||
|
||||
#region Older Windows Core
|
||||
|
||||
// Load core for older windows versions.
|
||||
sw.WriteLine(" if (Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version.Major < 6 || Environment.OSVersion.Platform == PlatformID.Win32Windows)");
|
||||
sw.WriteLine(" {");
|
||||
sw.WriteLine(" #region Older Windows Core");
|
||||
import_list.Add("1.2");
|
||||
import_list.Add("1.3");
|
||||
import_list.Add("1.4");
|
||||
import_list.Add("1.5");
|
||||
import_list.Add("2.0");
|
||||
import_list.Add("2.1");
|
||||
foreach (Function f in functions)
|
||||
{
|
||||
if (!f.Extension)
|
||||
if (import_list.Contains(f.Version))
|
||||
sw.WriteLine(" {0} = (Delegates.{0})WindowsGetAddress(\"{1}\", typeof(Delegates.{0}));", f.Name, "gl"+ f.Name.TrimEnd('_'));
|
||||
}
|
||||
sw.WriteLine(" #endregion Older Windows Core");
|
||||
sw.WriteLine(" }");
|
||||
|
||||
#endregion
|
||||
|
||||
#region Windows Vista Core
|
||||
|
||||
// Load core for windows vista.
|
||||
sw.WriteLine(" else if (Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version.Major >= 6)");
|
||||
sw.WriteLine(" {");
|
||||
sw.WriteLine(" #region Windows Vista Core");
|
||||
import_list.Remove("1.2");
|
||||
import_list.Remove("1.3");
|
||||
import_list.Remove("1.4");
|
||||
foreach (Function f in functions)
|
||||
{
|
||||
if (!f.Extension)
|
||||
if (import_list.Contains(f.Version))
|
||||
sw.WriteLine(" {0} = (Delegates.{0})WindowsGetAddress(\"{1}\", typeof(Delegates.{0}));", f.Name, "gl" + f.Name.TrimEnd('_'));
|
||||
}
|
||||
sw.WriteLine(" #endregion Windows Vista Core");
|
||||
sw.WriteLine(" }");
|
||||
|
||||
#endregion
|
||||
|
||||
#region X11 Core
|
||||
|
||||
// Load core for windows X11.
|
||||
sw.WriteLine(" else if (Environment.OSVersion.Platform == PlatformID.Unix)");
|
||||
sw.WriteLine(" {");
|
||||
sw.WriteLine(" #region X11 Core");
|
||||
import_list.Remove("1.5");
|
||||
import_list.Remove("1.6");
|
||||
import_list.Remove("2.0");
|
||||
import_list.Remove("2.1");
|
||||
foreach (Function f in functions)
|
||||
{
|
||||
if (!f.Extension)
|
||||
if (import_list.Contains(f.Version))
|
||||
sw.WriteLine(" {0} = (Delegates.{0})WindowsGetAddress(\"{1}\", typeof(Delegates.{0}));", f.Name, "gl" + f.Name.TrimEnd('_'));
|
||||
}
|
||||
sw.WriteLine(" #endregion X11 Core");
|
||||
sw.WriteLine(" }");
|
||||
|
||||
#endregion
|
||||
|
||||
sw.WriteLine(" }");
|
||||
sw.WriteLine(" #endregion static Constructor");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write extension function signatures
|
||||
|
||||
private static void WriteExtensionFunctionSignatures(StreamWriter sw, List<Function> functions)
|
||||
{
|
||||
sw.WriteLine(" #region Function signatures");
|
||||
sw.WriteLine();
|
||||
sw.WriteLine(" public static class Delegates");
|
||||
sw.WriteLine(" {");
|
||||
|
||||
foreach (Function f in functions)
|
||||
{
|
||||
if (f.Extension)
|
||||
sw.WriteLine(" public delegate {0};", f.ToString());
|
||||
}
|
||||
|
||||
sw.WriteLine(" }");
|
||||
sw.WriteLine(" #endregion");
|
||||
sw.WriteLine();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write extension functions
|
||||
|
||||
private static void WriteExtensionFunctions(StreamWriter sw, List<Function> functions)
|
||||
{
|
||||
sw.WriteLine(" #region Static Functions (and static initialisation)");
|
||||
sw.WriteLine();
|
||||
|
||||
foreach (Function f in functions)
|
||||
{
|
||||
if (f.Extension)
|
||||
sw.WriteLine(" public static Delegates.{0} {0} = new Delegates.{0}(Imports.{0});", f.Name);
|
||||
}
|
||||
|
||||
sw.WriteLine();
|
||||
sw.WriteLine(" #endregion");
|
||||
sw.WriteLine();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Write extension wrappers
|
||||
|
||||
public static void WriteExtensionWrappers(StreamWriter sw, List<Function> wrappers)
|
||||
{
|
||||
sw.WriteLine(" #region Wrappers");
|
||||
sw.WriteLine();
|
||||
|
@ -184,6 +438,9 @@ namespace OpenTK.OpenGL.Bind
|
|||
{
|
||||
foreach (Function w in wrappers)
|
||||
{
|
||||
if (!w.Extension)
|
||||
continue;
|
||||
|
||||
sw.WriteLine(" #region {0}{1}", w.Name, w.Parameters.ToString());
|
||||
sw.WriteLine();
|
||||
|
||||
|
@ -199,5 +456,6 @@ namespace OpenTK.OpenGL.Bind
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
5231
Source/OpenGL/OpenGL/Bindings/GLEnums.cs
Normal file
5231
Source/OpenGL/OpenGL/Bindings/GLEnums.cs
Normal file
File diff suppressed because it is too large
Load diff
42776
Source/OpenGL/OpenGL/Bindings/GLExtensions.cs
Normal file
42776
Source/OpenGL/OpenGL/Bindings/GLExtensions.cs
Normal file
File diff suppressed because it is too large
Load diff
|
@ -38,10 +38,10 @@ namespace OpenTK.OpenGL
|
|||
{
|
||||
return new WindowsContext(c, red, green, blue, alpha, 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.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, red, green, blue, alpha, depth, stencil);
|
||||
|
|
|
@ -89,7 +89,8 @@ namespace OpenTK.OpenGL.Platform
|
|||
|
||||
MakeCurrent();
|
||||
|
||||
Load();
|
||||
//GL.Init();
|
||||
//new GL();
|
||||
|
||||
//if (load_extensions)
|
||||
// LoadExtensions();
|
||||
|
|
|
@ -87,7 +87,8 @@ namespace OpenTK.OpenGL.Platform
|
|||
|
||||
MakeCurrent();
|
||||
|
||||
Load();
|
||||
//GL.Init();
|
||||
//new GL();
|
||||
|
||||
//if (load_extensions)
|
||||
// LoadExtensions();
|
||||
|
|
|
@ -15,30 +15,55 @@ namespace OpenTK.OpenGL.Platform
|
|||
{
|
||||
public partial class X11Context : OpenTK.OpenGL.GLContext
|
||||
{
|
||||
int drawable;
|
||||
IntPtr context;
|
||||
IntPtr display;
|
||||
const string _dll_name = "opengl.so";
|
||||
//private IntPtr drawable;
|
||||
private IntPtr Handle;
|
||||
private IntPtr GLXVisualInfo;
|
||||
private IntPtr context;
|
||||
private IntPtr display;
|
||||
const string _dll_name = "libGL.so.1";
|
||||
|
||||
public X11Context(Control c, int red, int green, int blue, int alpha, int depth, int stencil)
|
||||
{
|
||||
//drawable = c.Handle.ToInt32();
|
||||
display = Api.OpenDisplay("OpenTK X11 trial");
|
||||
Api.VisualInfo visual = Glx.ChooseVisual(display, 0, new int[] { });
|
||||
context = Glx.CreateContext(display, visual, IntPtr.Zero, true);
|
||||
//Api.Free(new IntPtr(visual));
|
||||
drawable = c.Handle.ToInt32();
|
||||
Glx.MakeCurrent(drawable, context);
|
||||
Type 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);
|
||||
|
||||
//context = Glx.CreateContext(
|
||||
//X11Context
|
||||
Handle = c.Handle;
|
||||
|
||||
//throw new Exception("The method or operation is not implemented.");
|
||||
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,
|
||||
0
|
||||
};
|
||||
GLXVisualInfo = Glx.ChooseVisual(display, ScreenNo, dblBuf);
|
||||
|
||||
Api.VisualInfo xVisualInfo = (Api.VisualInfo)Marshal.PtrToStructure(GLXVisualInfo, typeof(Api.VisualInfo));
|
||||
IntPtr visual = xVisualInfo.visual;
|
||||
IntPtr colormap = Api.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);
|
||||
|
||||
context = Glx.CreateContext(display, GLXVisualInfo, IntPtr.Zero, true);
|
||||
|
||||
MakeCurrent();
|
||||
|
||||
//GL.Init();
|
||||
//new GL();
|
||||
}
|
||||
}
|
||||
|
||||
public override void SwapBuffers()
|
||||
{
|
||||
Glx.SwapBuffers(drawable);
|
||||
Glx.SwapBuffers(display, Handle);
|
||||
}
|
||||
|
||||
public override Delegate GetAddress(string function_string, Type function_type)
|
||||
|
@ -52,7 +77,7 @@ namespace OpenTK.OpenGL.Platform
|
|||
|
||||
public override void MakeCurrent()
|
||||
{
|
||||
Glx.MakeCurrent(drawable, context);
|
||||
Glx.MakeCurrent(display, Handle, context);
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
|
|
33
Source/OpenGL/OpenGL/GL.cs
Normal file
33
Source/OpenGL/OpenGL/GL.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace OpenTK.OpenGL
|
||||
{
|
||||
public static partial class GL
|
||||
{
|
||||
private static Delegate WindowsGetAddress(string function_string, Type function_type)
|
||||
{
|
||||
IntPtr address = Wgl.GetProcAddress(function_string);
|
||||
if (address == IntPtr.Zero)
|
||||
return null;
|
||||
else
|
||||
return Marshal.GetDelegateForFunctionPointer(address, function_type);
|
||||
}
|
||||
|
||||
private static Delegate X11GetAddress(string function_string, Type function_type)
|
||||
{
|
||||
IntPtr address = Glx.GetProcAddress(function_string);
|
||||
if (address == IntPtr.Zero)
|
||||
return null;
|
||||
else
|
||||
return Marshal.GetDelegateForFunctionPointer(address, 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.");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ namespace OpenTK.OpenGL
|
|||
{
|
||||
#region GLU functions
|
||||
|
||||
private const string GLUDLLName = "GLU32.DLL";
|
||||
private const string GLUDLLName = "glu32.dll";
|
||||
|
||||
[DllImport(GLUDLLName, EntryPoint = "gluOrtho2D")]
|
||||
private static extern IntPtr ErrorString_(int errCode);
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace OpenTK.OpenGL
|
|||
/// </summary>
|
||||
public class Glx
|
||||
{
|
||||
const string _dll_name = "libgl";
|
||||
const string _dll_name = "libGL.so.1";
|
||||
|
||||
#region Enums
|
||||
|
||||
|
@ -267,45 +267,42 @@ namespace OpenTK.OpenGL
|
|||
#region GLX functions
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "glXCreateContext")]
|
||||
public static extern IntPtr CreateContext(IntPtr dpy, Api.VisualInfo vis, IntPtr shareList, bool direct);
|
||||
public static extern IntPtr CreateContext(IntPtr dpy, IntPtr vis, IntPtr shareList, bool direct);
|
||||
//public static extern IntPtr CreateContext(IntPtr dpy, Api.VisualInfo vis, IntPtr shareList, bool direct);
|
||||
//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);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "glXMakeCurrent")]
|
||||
public static extern void MakeCurrent(Int32 drawable, IntPtr context);
|
||||
public static extern void MakeCurrent(IntPtr display, IntPtr drawable, IntPtr context);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "glXSwapBuffers")]
|
||||
public static extern void SwapBuffers(Int32 drawable);
|
||||
public static extern void SwapBuffers(IntPtr display, IntPtr drawable);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "glXGetProcAddress")]
|
||||
public static extern IntPtr GetProcAddress([MarshalAs(UnmanagedType.LPTStr)] string procName);
|
||||
|
||||
[DllImport(_dll_name, EntryPoint = "glXChooseVisual")]
|
||||
public static extern OpenTK.Platform.X.Api.VisualInfo ChooseVisual(IntPtr dpy, int screen, [MarshalAs(UnmanagedType.LPArray)]int[] attriblist);
|
||||
extern public static IntPtr ChooseVisual_(IntPtr dpy, int screen, IntPtr attriblist);
|
||||
|
||||
//public static ChooseVisual()
|
||||
#endregion
|
||||
|
||||
#region Wrappers
|
||||
|
||||
//[DllImport("opengl32.dll", EntryPoint = "glCreateWindow")]
|
||||
//public static extern void CreateWindow(Int32 config, Int32 window, Int32 glxwindow);
|
||||
//[DllImport("opengl32.dll", EntryPoint = "glDestroyWindow")]
|
||||
//public static extern void DestroyWindow(Int32 glxwindow);
|
||||
//[DllImport("opengl32.dll", EntryPoint = "glCreatePixmap")]
|
||||
//public static extern void CreatePixmap(Int32 config, Int32 pixmap, Int32 glxpixmap);
|
||||
//[DllImport("opengl32.dll", EntryPoint = "glDestroyPixmap")]
|
||||
//public static extern void DestroyPixmap(Int32 glxpixmap);
|
||||
//[DllImport("opengl32.dll", EntryPoint = "glCreateNewContext")]
|
||||
//public static extern void CreateNewContext(Int32 config, Int32 render_type, Int32 share_list, Int32 direct);
|
||||
//[DllImport("opengl32.dll", EntryPoint = "glQueryContext")]
|
||||
//public static extern void QueryContext();
|
||||
//[DllImport("opengl32.dll", EntryPoint = "glMakeContextCurrent")]
|
||||
//public static extern void MakeContextCurrent(Int32 drawable, Int32 readdrawable, Int32 context);
|
||||
//[DllImport("opengl32.dll", EntryPoint = "glCreatePbuffer")]
|
||||
//public static extern void CreatePbuffer(Int32 config, Int32 pbuffer);
|
||||
//[DllImport("opengl32.dll", EntryPoint = "glDestroyPbuffer")]
|
||||
//public static extern void DestroyPbuffer(Int32 pbuffer);
|
||||
public static IntPtr ChooseVisual(IntPtr dpy, int screen, int[] attriblist)
|
||||
{
|
||||
GCHandle h0 = GCHandle.Alloc(attriblist, GCHandleType.Pinned);
|
||||
|
||||
try
|
||||
{
|
||||
return ChooseVisual_(dpy, screen, h0.AddrOfPinnedObject());
|
||||
}
|
||||
finally
|
||||
{
|
||||
h0.Free();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -9,10 +9,19 @@
|
|||
<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>
|
||||
<DebugType>Full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\Binaries\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
|
@ -43,15 +52,13 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Bindings\GLContextLoad.cs" />
|
||||
<Compile Include="Bindings\GL.cs" />
|
||||
<Compile Include="Bindings\WindowsContextLoad.cs" />
|
||||
<Compile Include="Bindings\WindowsVistaContextLoad.cs" />
|
||||
<Compile Include="Bindings\X11ContextLoad.cs" />
|
||||
<Compile Include="Bindings\GLEnums.cs" />
|
||||
<Compile Include="Contexts\WindowsBaseContext.cs" />
|
||||
<Compile Include="Contexts\WindowsVistaContext.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GL.cs" />
|
||||
<Compile Include="Glu.cs" />
|
||||
<Compile Include="Contexts\GLContext.cs" />
|
||||
<Compile Include="Contexts\WindowsContext.cs" />
|
||||
|
@ -70,5 +77,8 @@
|
|||
<Name>OpenTK.Platform.X</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<Folder Include="Documentation\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
|
||||
</Project>
|
|
@ -22,20 +22,19 @@ namespace OpenTK.Platform.X
|
|||
public const int QueuedAfterFlush = 2;
|
||||
}
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct VisualInfo
|
||||
{
|
||||
IntPtr visual;
|
||||
int visualid;
|
||||
int screen;
|
||||
uint depth;
|
||||
int @class;
|
||||
ulong red_mask;
|
||||
ulong green_mask;
|
||||
ulong blue_mask;
|
||||
int colormap_size;
|
||||
int bits_per_rgb;
|
||||
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
|
||||
|
@ -49,6 +48,9 @@ namespace OpenTK.Platform.X
|
|||
|
||||
//
|
||||
|
||||
[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);
|
||||
|
||||
|
|
|
@ -1,289 +0,0 @@
|
|||
#AccumOp,*,*, GLenum,*,*
|
||||
#AlphaFunction,*,*, GLenum,*,*
|
||||
#AttribMask,*,*, GLbitfield,*,*
|
||||
#BeginMode,*,*, GLenum,*,*
|
||||
#BinormalPointerTypeEXT,*,*, GLenum,*,*
|
||||
!BlendEquationMode,*,*, GLenum,*,*
|
||||
#BlendEquationModeEXT,*,*, GLenum,*,*
|
||||
!BlendFuncSeparateParameterEXT,*,*, GLenum,*,*
|
||||
#BlendingFactorDest,*,*, GLenum,*,*
|
||||
#BlendingFactorSrc,*,*, GLenum,*,*
|
||||
#Boolean,*,*, GLboolean,*,*
|
||||
#BooleanPointer,*,*, GLboolean*,*,*
|
||||
#Char,*,*, GLchar,*,*
|
||||
#CharPointer,*,*, GLchar*,*,*
|
||||
#CheckedFloat32,*,*, GLfloat,*,*
|
||||
#CheckedInt32,*,*, GLint,*,*
|
||||
!ClampColorTargetARB,*,*, GLenum,*,*
|
||||
!ClampColorModeARB,*,*, GLenum,*,*
|
||||
#ClampedColorF,*,*, GLclampf,*,*
|
||||
#ClampedFloat32,*,*, GLclampf,*,*
|
||||
#ClampedFloat64,*,*, GLclampd,*,*
|
||||
#ClampedStencilValue,*,*, GLint,*,*
|
||||
#ClearBufferMask,*,*, GLbitfield,*,*
|
||||
#ClientAttribMask,*,*, GLbitfield,*,*
|
||||
#ClipPlaneName,*,*, GLenum,*,*
|
||||
#ColorB,*,*, GLbyte,*,*
|
||||
#ColorD,*,*, GLdouble,*,*
|
||||
#ColorF,*,*, GLfloat,*,*
|
||||
#ColorI,*,*, GLint,*,*
|
||||
#ColorIndexValueD,*,*, GLdouble,*,*
|
||||
#ColorIndexValueF,*,*, GLfloat,*,*
|
||||
#ColorIndexValueI,*,*, GLint,*,*
|
||||
#ColorIndexValueS,*,*, GLshort,*,*
|
||||
#ColorIndexValueUB,*,*, GLubyte,*,*
|
||||
#ColorMaterialParameter,*,*, GLenum,*,*
|
||||
#ColorPointerType,*,*, GLenum,*,*
|
||||
#ColorS,*,*, GLshort,*,*
|
||||
!ColorTableParameterPName,*,*, GLenum,*,*
|
||||
#ColorTableParameterPNameSGI,*,*, GLenum,*,*
|
||||
!ColorTableTarget,*,*, GLenum,*,*
|
||||
#ColorTableTargetSGI,*,*, GLenum,*,*
|
||||
#ColorUB,*,*, GLubyte,*,*
|
||||
#ColorUI,*,*, GLuint,*,*
|
||||
#ColorUS,*,*, GLushort,*,*
|
||||
#CombinerBiasNV,*,*, GLenum,*,*
|
||||
#CombinerComponentUsageNV,*,*, GLenum,*,*
|
||||
#CombinerMappingNV,*,*, GLenum,*,*
|
||||
#CombinerParameterNV,*,*, GLenum,*,*
|
||||
#CombinerPortionNV,*,*, GLenum,*,*
|
||||
#CombinerRegisterNV,*,*, GLenum,*,*
|
||||
#CombinerScaleNV,*,*, GLenum,*,*
|
||||
#CombinerStageNV,*,*, GLenum,*,*
|
||||
#CombinerVariableNV,*,*, GLenum,*,*
|
||||
#CompressedTextureARB,*,*, GLvoid,*,*
|
||||
#ControlPointNV,*,*, GLvoid,*,*
|
||||
#ControlPointTypeNV,*,*, GLenum,*,*
|
||||
!ConvolutionParameter,*,*, GLenum,*,*
|
||||
#ConvolutionParameterEXT,*,*, GLenum,*,*
|
||||
!ConvolutionTarget,*,*, GLenum,*,*
|
||||
#ConvolutionTargetEXT,*,*, GLenum,*,*
|
||||
#CoordD,*,*, GLdouble,*,*
|
||||
#CoordF,*,*, GLfloat,*,*
|
||||
#CoordI,*,*, GLint,*,*
|
||||
#CoordS,*,*, GLshort,*,*
|
||||
#CullFaceMode,*,*, GLenum,*,*
|
||||
!CullParameterEXT,*,*, GLenum,*,*
|
||||
#DepthFunction,*,*, GLenum,*,*
|
||||
#DrawBufferMode,*,*, GLenum,*,*
|
||||
!DrawElementsType,*,*, GLenum,*,*
|
||||
#ElementPointerTypeATI,*,*, GLenum,*,*
|
||||
#EnableCap,*,*, GLenum,*,*
|
||||
#ErrorCode,*,*, GLenum,*,*
|
||||
#EvalMapsModeNV,*,*, GLenum,*,*
|
||||
#EvalTargetNV,*,*, GLenum,*,*
|
||||
#FeedbackElement,*,*, GLfloat,*,*
|
||||
#FeedbackType,*,*, GLenum,*,*
|
||||
#FenceNV,*,*, GLuint,*,*
|
||||
#FenceConditionNV,*,*, GLenum,*,*
|
||||
#FenceParameterNameNV,*,*, GLenum,*,*
|
||||
#FfdMaskSGIX,*,*, GLbitfield,*,*
|
||||
#FfdTargetSGIX,*,*, GLenum,*,*
|
||||
#Float32,*,*, GLfloat,*,*
|
||||
#Float32Pointer,*,*, GLfloat*,*,*
|
||||
#Float64,*,*, GLdouble,*,*
|
||||
#Float64Pointer,*,*, GLdouble*,*,*
|
||||
#FogParameter,*,*, GLenum,*,*
|
||||
!FogPointerTypeEXT,*,*, GLenum,*,*
|
||||
!FogPointerTypeIBM,*,*, GLenum,*,*
|
||||
#FragmentLightModelParameterSGIX,*,*,GLenum,*,*
|
||||
#FragmentLightNameSGIX,*,*, GLenum,*,*
|
||||
#FragmentLightParameterSGIX,*,*, GLenum,*,*
|
||||
#FrontFaceDirection,*,*, GLenum,*,*
|
||||
FunctionPointer,*,*, _GLfuncptr,*,*
|
||||
#GetColorTableParameterPName,*,*, GLenum,*,*
|
||||
#GetColorTableParameterPNameSGI,*,*, GLenum,*,*
|
||||
!GetConvolutionParameterPName,*,*, GLenum,*,*
|
||||
!GetHistogramParameterPName,*,*, GLenum,*,*
|
||||
#GetHistogramParameterPNameEXT,*,*, GLenum,*,*
|
||||
#GetMapQuery,*,*, GLenum,*,*
|
||||
!GetMinmaxParameterPName,*,*, GLenum,*,*
|
||||
#GetMinmaxParameterPNameEXT,*,*, GLenum,*,*
|
||||
#GetPName,*,*, GLenum,*,*
|
||||
#GetPointervPName,*,*, GLenum,*,*
|
||||
#GetTextureParameter,*,*, GLenum,*,*
|
||||
#HintMode,*,*, GLenum,*,*
|
||||
#HintTarget,*,*, GLenum,*,*
|
||||
!HintTargetPGI,*,*, GLenum,*,*
|
||||
!HistogramTarget,*,*, GLenum,*,*
|
||||
#HistogramTargetEXT,*,*, GLenum,*,*
|
||||
#IglooFunctionSelectSGIX,*,*, GLenum,*,*
|
||||
IglooParameterSGIX,*,*, GLvoid,*,*
|
||||
!ImageTransformPNameHP,*,*, GLenum,*,*
|
||||
!ImageTransformTargetHP,*,*, GLenum,*,*
|
||||
!IndexFunctionEXT,*,*, GLenum,*,*
|
||||
!IndexMaterialParameterEXT,*,*, GLenum,*,*
|
||||
#IndexPointerType,*,*, GLenum,*,*
|
||||
#Int16,*,*, GLshort,*,*
|
||||
#Int32,*,*, GLint,*,*
|
||||
#Int8,*,*, GLbyte,*,*
|
||||
#InterleavedArrayFormat,*,*, GLenum,*,*
|
||||
#LightEnvParameterSGIX,*,*, GLenum,*,*
|
||||
#LightModelParameter,*,*, GLenum,*,*
|
||||
#LightName,*,*, GLenum,*,*
|
||||
#LightParameter,*,*, GLenum,*,*
|
||||
#LightTextureModeEXT,*,*, GLenum,*,*
|
||||
#LightTexturePNameEXT,*,*, GLenum,*,*
|
||||
#LineStipple,*,*, GLushort,*,*
|
||||
#List,*,*, GLuint,*,*
|
||||
#ListMode,*,*, GLenum,*,*
|
||||
#ListNameType,*,*, GLenum,*,*
|
||||
#ListParameterName,*,*, GLenum,*,*
|
||||
#LogicOp,*,*, GLenum,*,*
|
||||
#MapAttribParameterNV,*,*, GLenum,*,*
|
||||
#MapParameterNV,*,*, GLenum,*,*
|
||||
#MapTarget,*,*, GLenum,*,*
|
||||
#MapTargetNV,*,*, GLenum,*,*
|
||||
#MapTypeNV,*,*, GLenum,*,*
|
||||
#MaskedColorIndexValueF,*,*, GLfloat,*,*
|
||||
#MaskedColorIndexValueI,*,*, GLuint,*,*
|
||||
#MaskedStencilValue,*,*, GLuint,*,*
|
||||
#MaterialFace,*,*, GLenum,*,*
|
||||
#MaterialParameter,*,*, GLenum,*,*
|
||||
!MatrixIndexPointerTypeARB,*,*, GLenum,*,*
|
||||
#MatrixMode,*,*, GLenum,*,*
|
||||
#MatrixTransformNV,*,*, GLenum,*,*
|
||||
#MeshMode1,*,*, GLenum,*,*
|
||||
#MeshMode2,*,*, GLenum,*,*
|
||||
!MinmaxTarget,*,*, GLenum,*,*
|
||||
#MinmaxTargetEXT,*,*, GLenum,*,*
|
||||
#NormalPointerType,*,*, GLenum,*,*
|
||||
#NurbsCallback,*,*, GLenum,*,*
|
||||
NurbsObj,*,*, GLUnurbs*,*,*
|
||||
#NurbsProperty,*,*, GLenum,*,*
|
||||
#NurbsTrim,*,*, GLenum,*,*
|
||||
#OcclusionQueryParameterNameNV,*,*, GLenum,*,*
|
||||
#PixelCopyType,*,*, GLenum,*,*
|
||||
#PixelFormat,*,*, GLenum,*,*
|
||||
#PixelInternalFormat,*,*, GLenum,*,*
|
||||
#PixelMap,*,*, GLenum,*,*
|
||||
#PixelStoreParameter,*,*, GLenum,*,*
|
||||
#PixelTexGenModeSGIX,*,*, GLenum,*,*
|
||||
#PixelTexGenParameterNameSGIS,*,*, GLenum,*,*
|
||||
#PixelTransferParameter,*,*, GLenum,*,*
|
||||
#PixelTransformPNameEXT,*,*, GLenum,*,*
|
||||
#PixelTransformTargetEXT,*,*, GLenum,*,*
|
||||
#PixelType,*,*, GLenum,*,*
|
||||
!PointParameterNameARB,*,*, GLenum,*,*
|
||||
#PolygonMode,*,*, GLenum,*,*
|
||||
ProgramNV,*,*, GLuint,*,*
|
||||
ProgramCharacterNV,*,*, GLubyte,*,*
|
||||
#ProgramParameterNV,*,*, GLenum,*,*
|
||||
#QuadricCallback,*,*, GLenum,*,*
|
||||
#QuadricDrawStyle,*,*, GLenum,*,*
|
||||
#QuadricNormal,*,*, GLenum,*,*
|
||||
QuadricObj,*,*, GLUquadric*,*,*
|
||||
#QuadricOrientation,*,*, GLenum,*,*
|
||||
#ReadBufferMode,*,*, GLenum,*,*
|
||||
#RenderingMode,*,*, GLenum,*,*
|
||||
ReplacementCodeSUN,*,*, GLuint,*,*
|
||||
#ReplacementCodeTypeSUN,*,*, GLenum,*,*
|
||||
#SamplePassARB,*,*, GLenum,*,*
|
||||
#SamplePatternEXT,*,*, GLenum,*,*
|
||||
#SamplePatternSGIS,*,*, GLenum,*,*
|
||||
#SecondaryColorPointerTypeIBM,*,*, GLenum,*,*
|
||||
#SelectName,*,*, GLuint,*,*
|
||||
!SeparableTarget,*,*, GLenum,*,*
|
||||
#SeparableTargetEXT,*,*, GLenum,*,*
|
||||
#ShadingModel,*,*, GLenum,*,*
|
||||
#SizeI,*,*, GLsizei,*,*
|
||||
#SpriteParameterNameSGIX,*,*, GLenum,*,*
|
||||
#StencilFunction,*,*, GLenum,*,*
|
||||
!StencilFaceDirection,*,*, GLenum,*,*
|
||||
#StencilOp,*,*, GLenum,*,*
|
||||
#StencilValue,*,*, GLint,*,*
|
||||
#String,*,*, GLstring,*,*
|
||||
#StringName,*,*, GLenum,*,*
|
||||
#TangentPointerTypeEXT,*,*, GLenum,*,*
|
||||
#TessCallback,*,*, GLenum,*,*
|
||||
#TessContour,*,*, GLenum,*,*
|
||||
#TessProperty,*,*, GLenum,*,*
|
||||
TesselatorObj,*,*, GLUtesselator*,*,*
|
||||
#TexCoordPointerType,*,*, GLenum,*,*
|
||||
#Texture,*,*, GLuint,*,*
|
||||
#TextureComponentCount,*,*, GLint,*,*
|
||||
#TextureCoordName,*,*, GLenum,*,*
|
||||
#TextureEnvParameter,*,*, GLenum,*,*
|
||||
#TextureEnvTarget,*,*, GLenum,*,*
|
||||
!TextureFilterSGIS,*,*, GLenum,*,*
|
||||
#TextureGenParameter,*,*, GLenum,*,*
|
||||
#TextureNormalModeEXT,*,*, GLenum,*,*
|
||||
#TextureParameterName,*,*, GLenum,*,*
|
||||
#TextureTarget,*,*, GLenum,*,*
|
||||
!TextureUnit,*,*, GLenum,*,*
|
||||
#UInt16,*,*, GLushort,*,*
|
||||
#UInt32,*,*, GLuint,*,*
|
||||
#UInt8,*,*, GLubyte,*,*
|
||||
#VertexAttribEnumNV,*,*, GLenum,*,*
|
||||
#VertexAttribPointerTypeNV,*,*, GLenum,*,*
|
||||
#VertexPointerType,*,*, GLenum,*,*
|
||||
#VertexWeightPointerTypeEXT,*,*, GLenum,*,*
|
||||
#Void,*,*, GLvoid,*,*
|
||||
VoidPointer,*,*, GLvoid*,*,*
|
||||
#ConstVoidPointer,*,*, GLvoid* const,*,*
|
||||
!WeightPointerTypeARB,*,*, GLenum,*,*
|
||||
#WinCoord,*,*, GLint,*,*
|
||||
#void,*,*, *,*,*
|
||||
#ArrayObjectPNameATI,*,*, GLenum,*,*
|
||||
#ArrayObjectUsageATI,*,*, GLenum,*,*,
|
||||
ConstFloat32,*,*, GLfloat,*,*
|
||||
ConstInt32,*,*, GLint,*,*
|
||||
ConstUInt32,*,*, GLuint,*,*
|
||||
ConstVoid,*,*, GLvoid,*,*
|
||||
#DataTypeEXT,*,*, GLenum,*,*
|
||||
#FragmentOpATI,*,*, GLenum,*,*
|
||||
#GetTexBumpParameterATI,*,*, GLenum,*,*
|
||||
#GetVariantValueEXT,*,*, GLenum,*,*
|
||||
#ParameterRangeEXT,*,*, GLenum,*,*
|
||||
#PreserveModeATI,*,*, GLenum,*,*
|
||||
!ProgramFormatARB,*,*, GLenum,*,*
|
||||
!ProgramTargetARB,*,*, GLenum,*,*
|
||||
!ProgramPropertyARB,*,*, GLenum,*,*
|
||||
!ProgramStringPropertyARB,*,*, GLenum,*,*
|
||||
#ScalarType,*,*, GLenum,*,*
|
||||
#SwizzleOpATI,*,*, GLenum,*,*
|
||||
#TexBumpParameterATI,*,*, GLenum,*,*
|
||||
#VariantCapEXT,*,*, GLenum,*,*
|
||||
!VertexAttribPointerPropertyARB,*,*, GLenum,*,*
|
||||
!VertexAttribPointerTypeARB,*,*, GLenum,*,*
|
||||
!VertexAttribPropertyARB,*,*, GLenum,*,*
|
||||
#VertexShaderCoordOutEXT,*,*, GLenum,*,*
|
||||
#VertexShaderOpEXT,*,*, GLenum,*,*
|
||||
#VertexShaderParameterEXT,*,*, GLenum,*,*
|
||||
#VertexShaderStorageTypeEXT,*,*, GLenum,*,*
|
||||
#VertexShaderTextureUnitParameter,*,*, GLenum,*,*
|
||||
#VertexShaderWriteMaskEXT,*,*, GLenum,*,*
|
||||
#VertexStreamATI,*,*, GLenum,*,*
|
||||
#PNTrianglesPNameATI,*,*, GLenum,*,*
|
||||
|
||||
# ARB_vertex_buffer_object types and core equivalents for new types
|
||||
VertexBufferOffset,*,*, GLintptr,*,*
|
||||
#VertexBufferSize,*,*, GLsizeiptr,*,*
|
||||
!VertexBufferAccessARB,*,*, GLenum,*,*
|
||||
#VertexBufferOffsetARB,*,*, GLintptrARB,*,*
|
||||
!VertexBufferPNameARB,*,*, GLenum,*,*
|
||||
!VertexBufferPointerNameARB,*,*, GLenum,*,*
|
||||
VertexBufferSizeARB,*,*, GLsizeiptrARB,*,*
|
||||
!VertexBufferTargetARB,*,*, GLenum,*,*
|
||||
!VertexBufferUsageARB,*,*, GLenum,*,*
|
||||
|
||||
# APPLE_fence
|
||||
#ObjectTypeAPPLE,*,*, GLenum,*,*
|
||||
|
||||
# APPLE_vertex_array_range
|
||||
#VertexArrayPNameAPPLE,*,*, GLenum,*,*
|
||||
|
||||
# ATI_draw_buffers
|
||||
!DrawBufferModeATI,*,*, GLenum,*,*
|
||||
|
||||
# NV_half
|
||||
#Half16NV,*,*, GLhalfNV,*,*
|
||||
|
||||
# NV_pixel_data_range
|
||||
#PixelDataRangeTargetNV,*,*, GLenum,*,*
|
||||
|
||||
# Generic types for as-yet-unspecified enums
|
||||
!GLenum,*,*, GLenum,*,*
|
||||
#handleARB,*,*, GLhandleARB,*,*
|
||||
#charARB,*,*, GLcharARB,*,*
|
||||
#charPointerARB,*,*, GLcharARB*,*,*
|
|
@ -1,3 +1,14 @@
|
|||
OpenTK 0.3.6
|
||||
|
||||
|
||||
OpenTK 0.3.5 -> 0.3.6
|
||||
+ Updates to OpenTK.OpenGL.Bind (see that changelog for more info).
|
||||
+ Revamped GL class (is self contained)
|
||||
+ Revamped GLContext class (it is no longer bound to the GL class initialisation).
|
||||
+ Directory structure updates (Documentation folder for each project, plus main Documentation folder)
|
||||
+ Framework updates (cleaner implementation, new namespace).
|
||||
|
||||
|
||||
OpenTK 0.3.4 -> 0.3.5
|
||||
+ Major update to OpenTK.OpenGL.Bind (cleaner code, new functions, comments and many new wrappers).
|
||||
+ Updated the spec files for opengl 2.1.
|
||||
|
@ -16,6 +27,7 @@ OpenTK 0.3.4 -> 0.3.5
|
|||
+ The Framework now resides in its own project directory.
|
||||
+ Revamped the GLContext class hierarchy. WindowsContext and WindowsVistaContext now both inherit from WindowsBaseContext. This allows for less code-duplication (and thus less bugs).
|
||||
|
||||
|
||||
OpenTK 0.3.3 -> 0.3.4
|
||||
+ Corrected the crash error in Release mode (it was caused by trying to Marshal the System.Windows.Forms.Message struct to PeekMessage - adding my own Message struct corrected the issue).
|
||||
+ Corrected the call to glShaderSource GLSL.Lesson01. Now the correct number is passed to the count parameter, while the null parameter was changed to IntPtr.Zero (Mono now no longers fails in this call).
|
||||
|
@ -23,18 +35,21 @@ OpenTK 0.3.3 -> 0.3.4
|
|||
+ OpenTK.OpenGL.Bind 0.7.5.1 -> 0.7.5.2 (see Bind changelog for more information)
|
||||
+ Full Mono support under windows.
|
||||
|
||||
|
||||
OpenTK 0.3.2 -> 0.3.3
|
||||
+ OpenTK.OpenGL.Bind 0.7.5 -> 0.7.5.1 (see Bind changelog for more information)
|
||||
+ Added the GLForm class which sets the base for cross-platform screen, context and keyboard handling.
|
||||
+ Can now change between fullscreen and windowed modes.
|
||||
+ Temporarily removed all examples except for GLSL.Lesson01, which has been updated to use the new GLForm class.
|
||||
|
||||
|
||||
OpenTK 0.3.1 -> 0.3.2
|
||||
+ OpenTK.OpenGL.Glu: Eliminated the temporary IntPtr variable in the GetString and ErrorString functions.
|
||||
+ Specifications.cs_types.txt: Changed types in order to be CLS compliant.
|
||||
+ OpenTK.OpenGL.Bind 0.7.4 -> 0.7.5
|
||||
+ Added the GLSL.Lesson01 example.
|
||||
|
||||
|
||||
OpenTK 0.3.0 -> 0.3.1
|
||||
+ Updated the binding generator to version 0.7.4, based on the work done for Tao.
|
||||
+ Updated the Context load functions. Now Context loads all functions are extensions, and the derived classes override this behavior as needed.
|
||||
|
|
7
todo.txt
7
todo.txt
|
@ -1,13 +1,16 @@
|
|||
Todo:
|
||||
+ + + Update directory structure (specs shouldn't reside in the top directory)
|
||||
+ + + Fully implement Framework class.
|
||||
+ + + Correct the Dispose methods to correctly clean resources (they should also call GC.SupressFinalize(true))
|
||||
+ + + Add basic GLX bindings (in progress)
|
||||
+ + + Add basic X bindings (in progress)
|
||||
+ + + Add context creation support for X (needs testing)
|
||||
+ + + Add context creation support for X (needs fixing)
|
||||
+ + + Test X support.
|
||||
+ + + Add the CLS compliant attribute to the GL class.
|
||||
+ + + Clean up the build system for windows .Net, and add build system for linux Mono and windows Mono.
|
||||
+ + Add docs to each project.
|
||||
+ + Add cross-platform way for defining the Application.Idle handler (needs testing)
|
||||
+ + Add more constructors to the Context classes.
|
||||
+ + Add more Framework constructors.
|
||||
+ + Add comments and documentation (faqs, pitfalls, best practices).
|
||||
+ + Add a cross-platform build system (probably NAnt?)
|
||||
+ Add more examples.
|
||||
|
|
Loading…
Reference in a new issue