开发者

Create an OpenGL ES 2.0 context on a "standard" Linux system

I'm writing a game engine using opengl 3.3/SDL/glew/Linux (Ubuntu 11.04). I want to keep the possibility to deploy on mobile开发者_JS百科 (OpenGL ES 2). This means that I have to stay somewhat OpenGL ES 2.0 compatible. Therefore my question is: Is it possible to create an OpenGL ES 2.0 context using SDL/(existing patch on SDL).


You don't need a GL ES 2.0 context on PC, you can use OpenGL 4.1, which has the GL_ARB_es2_compatibility, which adds the OpenGL ES functions that weren't in OpenGL, making them API compatible.


Instead of using a nonofficial/patched version of SDL 1.2 you could simply use SDL 1.3.

Quoting myself on another question:

I suggest you download and setup the Khronos OpenGL ES 2.0 SDKs for POWERVR SGX PC Emulation package (Unfortunately you have to register to be able to download). This allows you to get everything up and running on a desktop computer which will make your life a lot easier when it comes to debugging. You can then use C/C++ to develop your OpenGL ES 2.0 applications.

If I'm not mistaken my Android phone (Samsung Galaxy S) also uses this OpenGL implementation.

Instead of using the Khronos SDK you could also use the OpenGL ES 2.0 libraries from the Mesa3D Project (Ubuntu has them in the repository). They work fine but I can't recommend them because I already ran into a situation where the results differed from the Khronos SDK implementation and my Android device.

EDIT: You also have to create a Window and an OpenGL rendering context in order to actually use OpenGL. For that I can recommend SDL (1.3) which also has an official port for Android. I tested it on Android and Ubuntu with the mentioned SDK. It allows me to use the same code for both.


Rather than the PowerVR SDK that requires a registration, you can use the ARM Mali equivalent that is an open download. Here it is: http://www.malideveloper.com/opengl-es-20-emulator.php. They can run on a Mesa software path if you don't have OpenGL 2.0 hardware underneath.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜