the Fiddler's picture

OpenTK gains support for OpenGL ES 1.0, 1.1 and 2.0

OpenGL ES is a subset of the OpenGL API used in embedded devices. It is used by Apple's iPhone, Google's Android, Nokia's Maemo, the Sony Playstation 3, the Pandora handheld and other devices.

OpenTK now offers experimental support for OpenGL ES profiles 1.0, 1.1 and 2.0, which roughly translate to OpenGL 1.3, 1.5 and 2.0 respectively. This includes inline documentation but excludes strongly-typed enums, which will be added at a later time. There is also no support for constructing contexts through EGL, however it should be possible to use an external GL ES context in conjuction with OpenTK. Finally, the bindings are untested - please file any bugs you encounter.

If you are interested in helping out, testing or porting (esp. to iPhone and Android), make a post!


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Heiko's picture

I'm currently playing around with OpenTK for the iPhone. It looks great, but I really miss those strongly-typed enums (one of great advantages of OpenTK over similar products)...
Do you know when they will be implemented?

the Fiddler's picture

Inertia has done most of the research necessary for ES 2.0, but unless someone volunteers to translate the necessary enums into XML we probably won't have strong types ready for the 1.0 release. The main issue is that none of the core developers is using OpenGL|ES right now, so other issues tend to take precedence.

The actual XML is very simple:

<enum name="GetIntegerPName">
  <token name="BlendEquation" value="0x8009" />
  <token name="BlendEquationRGB" value="0x8009" />
  <token name="BlendEquationAlpha" value="0x883d" />
  ...
</enum>
 
<function name="GetInteger" extension="Core">
  <param name="pname"><type>GetIntegerPName</type></param>
</function>

Realistically, if everyone that encountered a non-strongly-typed ES function would volunteer a few minutes to post the necessary XML, OpenGL|ES would become strongly-typed by the end of this month.

GetIntegerPName and the rest of the enums are already available:

All that's left is their XML definition.

Inertia's picture

I will make the necessary changes in formatting, but we need some volunteers who either write some small example applications from scratch or port existing GL examples to ES. They don't have to be groundshaking, but should run without causing any errors and test the most fundamental parts of ES (VBO, FBO, GLSL).

Heiko's picture

Thanks for your answer. I'd like to lean more about updating those XML definitions.

In "Bind/Specifications/ES10/signatures.xml" a found (for example):

<function name="DrawArrays" extension="Core" profile="" category="1.0" version="1.0">
    <returns type="void" />
    <param type="GLenum" name="mode" flow="in" />
    <param type="GLint" name="first" flow="in" />
    <param type="GLsizei" name="count" flow="in" />
</function>

Is all it takes to make the first parameter use the strongly-typed enum a change like the following?

<function name="DrawArrays" extension="Core" profile="" category="1.0" version="1.0">
    <returns type="void" />
    <param type="GLenum" name="mode" flow="in"><type>BeginMode</type></param>
    <param type="GLint" name="first" flow="in" />
    <param type="GLsizei" name="count" flow="in" />
</function>

(The "BeginMode"-Enum is already defined in the same file, but the tokens are all upper-case)

the Fiddler's picture

Yes, with one caveat: the signatures.xml file is auto-generated and will be overwritten whenever the specs or our converter tool changes. Updated signatures should go to the overrides.xml file.

Inertia has pretty much completed the XML overrides for the 2.0 spec. We still have the 1.1 and 1.0 specs to do (the latter is not very useful nowadays, but the former is).

I'll post some more concrete documentation on the generation process over the next few days.

Inertia's picture

If you intend to work on ES 1.1 (and the extension pack?) my recommendation is using the ES 2.0 cleanup as a basis to start with. This will be alot more efficient than starting from scratch (for example the texture, VBO and fragment ops parts are already done and you could simply delete unsupported tokens and the FBO/GLSL related stuff ), so your work would be limited to cleaning up the fixed-func parts of ES 1.1

3KyNoX's picture

Are we able to make games using OpenTK for iPhone / Android / WinCE currently ?

the Fiddler's picture

Novell is offering a commercial solution for Android and iPhone , called MonoTouch, which includes OpenTK bindings. (I am not affiliated with Novell).

There is no support for WinCE at this point. A port is feasible but I lack the necessary hardware.

Support for Windows Phone 7 is impossible, as it does not offer OpenGL ES.

3KyNoX's picture

Thanks for answer The Fiddler. What is the OpenTK future major steps ?

Also, do you plan to natively include Android / Iphone support and - or DX11 / D3D ?

OpenTK starts to interesting me for a C++ 3d engine I'm making, cross-platform support and OpenGL4.1 is definitely what I search.

If while using C#, performance and speed is great, OpenTK will be definitely my choice.