Added usage example for new xml specs

This commit is contained in:
Stefanos A. 2013-11-07 17:18:12 +01:00
parent b6610001ea
commit 7d74c37d2a
3 changed files with 15 additions and 6 deletions

View file

@ -3,8 +3,12 @@
This is a simple tool to convert C headers to XML files. It works using simple pattern matching - it does not actually parse the header files. For this reason, it will work with only a few, specific header files: ES and CL at this point.
[Example]
[Examples]
To download and convert the new XML API registry from Khronos:
Convert.exe -p:gl -v:4.4 -t:xml -o:../../../Source/Bind/Specifications/GL2/signatures.xml https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/api/gl.xml
To download and convert the old .spec files from Khronos:
Convert.exe -p:gl -v:4.3 -t:spec -o:../../../Source/Bind/Specifications/GL2/signatures.xml https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/oldspecs/gl.spec https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/oldspecs/enum.spec https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/oldspecs/enumext.spec
The line above will download the latest .spec files from the public Khronos repository and update signatures.xml for the binding generator.

View file

@ -85,6 +85,8 @@ namespace Examples
public static void Main(string[] args)
{
Trace.Listeners.Add(new ConsoleTraceListener());
LaunchExample(typeof(Examples.Tests.GameWindowStates).FullName);
return;
if (args.Length > 0)
{

View file

@ -10,6 +10,7 @@ using System.Drawing;
using System.Threading;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input;
@ -28,7 +29,8 @@ namespace Examples.Tests
KeyboardState keyboard, keyboard_old;
public GameWindowStates()
: base(800, 600)
: base(800, 600, GraphicsMode.Default, "Test", GameWindowFlags.Default,
DisplayDevice.GetDisplay(DisplayIndex.Second), 3, 0, GraphicsContextFlags.Embedded)
{
VSync = VSyncMode.On;
Keyboard.KeyRepeat = true;
@ -152,7 +154,7 @@ namespace Examples.Tests
}
}
static int DrawJoysticks(Graphics gfx, IList<JoystickDevice> joysticks, int line)
static void DrawJoysticks(Graphics gfx, IList<JoystickDevice> joysticks, int line)
{
float space = gfx.MeasureString(" ", TextFont).Width;
@ -181,8 +183,6 @@ namespace Examples.Tests
line++;
}
return line;
}
protected override void OnUpdateFrame(FrameEventArgs e)
@ -209,6 +209,8 @@ namespace Examples.Tests
gfx.Clear(Color.Black);
gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
DrawString(gfx, Context.GraphicsMode.ToString(), line++);
DrawString(gfx, String.Format("[1 - 4]: change WindowState (current: {0}).", this.WindowState), line++);
DrawString(gfx, String.Format("[5 - 7]: change WindowBorder (current: {0}).", this.WindowBorder), line++);
@ -223,7 +225,8 @@ namespace Examples.Tests
DrawString(gfx, String.Format("Window.ClientRectangle: {0}", ClientRectangle), line++);
DrawKeyboard(gfx, keyboard, line++);
DrawMouse(gfx, mouse, line++);
line = DrawJoysticks(gfx, Joysticks, line++);
DrawJoysticks(gfx, Joysticks, line++);
}
}