Getting Started With Opengl Es


mud2005

Still Fresh
Joined
May 6, 2008
Messages
4
Hi, I am trying to write Battleship for the pandora. I have experience with 3D graphics only using java and jmonkeyengine. So far ive got a text version of the game with AI finished in c++. I downloaded the opengl es SDK and looking over the code I have some questions, all the training course examples run in a 640x480 window how do I change it to 800x480? also Im not quite sure how to incorporate the text version with the graphics, do I need seperate threads to keep cpu and gpu calls seperate? The examples all extend the PVRShell class and have 5 functions in common, InitApplication(); InitView(); ReleaseView(); QuitApplication(); and RenderScene(); which leaves me wondering where I put my game code? sry for newb questions :unsure: im just learning c++

edit: I think the resolution problem is a bug, the -qaf option works but the -fullscreen and -width and stuff dont work I always get a 640x480 window, Im using Ubuntu 8.04
 
If you have not already looked here I would recomend this site.

http://www.zeuscmd.com/tutorials/opengles/index.php

It goes through all the basics just like NeHe does with normal OGL

Once you have a grasp of how ES differs from plain OGL you can pretty much use the NeHe tutorials

http://nehe.gamedev.net/

Here are some good books (amazon links only because that was what was on opengl.org)

http://www.amazon.com/exec/obidos/ASIN/032...795/khongrou-20

http://www.amazon.com/exec/obidos/ASIN/032...828/khongrou-20

http://www.amazon.com/OpenGL-ES-Game-Devel...7894&sr=8-3

http://www.amazon.com/Mobile-3D-Graphics-K...894&sr=8-13
 
Be aware that OpenGL ES 2.0 (What the pandora has) is _very_ different to OpenGL ES 1.x and is totally not backwards compatible! If you're learning from scratch, I'd go strait for OpenGL ES 2.0.

Having said that, I suspect the pandora will support both 1.x and 2.0 - but I could be wrong.
 
warmi said:
mud2005 said:
cool, thanks for the links Im going to get an opengl es book ASAP!
Wait for this one: http://www.amazon.com/exec/obidos/ASIN/032...795/khongrou-20

OpenGL ES 2.0 differs a lot from the regular OpenGL ( no fixed-function pipeline, and missing a lot of OpenGL methods )

This depends on what you're coding for. If you're using OpenGL 2.0, you probably shouldn't be using fixed function operations in the first place... ;) However, I concur with the assessment on the book- you're really going to want it in hand for doing things.
 
Last edited by a moderator:
warmi said:
Wait for this one: http://www.amazon.com/exec/obidos/ASIN/032...795/khongrou-20

OpenGL ES 2.0 differs a lot from the regular OpenGL ( no fixed-function pipeline, and missing a lot of OpenGL methods )


Woohoo, my copy showed up today! :)

It looks like a great book. I don't think it gets too far into detail for any specific topic being 394 pages (not including index) but it shows you all the function calls, what to pass in and what the parameters mean. Plus it offers tips on optimization and preventing visual mistakes in the rendering. Seems perfect for a 3D novice like myself.

P.S. Pandora does support ES 1.1 and 2.0 so as far as I know you can work with whatever you are comfortable with. I know for a fact TI demos for OMAP2 run on OMAP3 and those are 1.1.
 
Last edited by a moderator:
Wait, you mean we only have some stripped down version of OpenGL? so we'd have to go and change things in games that use "normal" OpenGL to make a port? ??? :blink:
 
CC_machine: I wouldn't call it stripped own, but different. Its been developed for embedded systems (OpenGL ES) - the most critical thing which comes to my mind is that the fixed function pipeline was removed, but I haven't tried ES yet so I can't say for sure.
 
CC_machine said:
Wait, you mean we only have some stripped down version of OpenGL? so we'd have to go and change things in games that use "normal" OpenGL to make a port? ??? :blink:

Yup. But that's not news. I believe that is one reason why sindbad was looking at Gallium3d Sgx Drivers.
 
Last edited by a moderator:
mud2005 said:
Hi, I am trying to write Battleship for the pandora. I have experience with 3D graphics only using java and jmonkeyengine. So far ive got a text version of the game with AI finished in c++. I downloaded the opengl es SDK and looking over the code I have some questions, all the training course examples run in a 640x480 window how do I change it to 800x480? also Im not quite sure how to incorporate the text version with the graphics, do I need seperate threads to keep cpu and gpu calls seperate? The examples all extend the PVRShell class and have 5 functions in common, InitApplication(); InitView(); ReleaseView(); QuitApplication(); and RenderScene(); which leaves me wondering where I put my game code? sry for newb questions :unsure: im just learning c++

edit: I think the resolution problem is a bug, the -qaf option works but the -fullscreen and -width and stuff dont work I always get a 640x480 window, Im using Ubuntu 8.04
The ideal place to ask questions or report problems with the PowerVR SDK is this: http://www.imgtec.com/forum/

For the window size, have a look at the initialisation code in Shell\OS\LinuxX11\PVRShellOS.cpp.
RenderScene is called once per frame, so that is where your main game code should be called from. Use InitApplication and QuitApplication for initialisation and cleanup, InitView/ReleaseView are only meant for graphics resources creation and initialisation (they're called when the graphics context is lost/re-created).
 
Last edited by a moderator:
For anyone who's interested...

I've added OpenGL ES 2.0 support in Qt/X11. The "final" commit was on Friday, so if you download & build the nightly snapshots you should get it.

I've tested it pretty well against the ImgTec emulation libraries. To build, make sure the ImgTec libraries are in your library & include path and do the following...

./configure -arch i386 -xplatform linux-g++-32 -opengl es2
make
sudo make install


If you're not on amd64, you can probably just configure with:
./configure -opengl es2

At the moment you should get a fully functional QGLWidget. To develop, follow the docs for QGLWidget.

Generally, compile & link your shaders in initializeGl(), setup your PMV matrix uniforms in resizeGL() and do all your rendering in paintGL(). By default - it will try to select the EGL config with the highest number of multi-samples. Override that behavior by passing your own QGLFormat to the QGLWidget constructor.

Qt might be an option if you fancy it. It's not the only option of course, but I thought I'd mention it.

I'm currently working on a paint engine for GL ES 2.0, along with some helper classes for shaders. I doubt it will make it into 4.5.0 though. :-( I will need to test cross-compiling Qt/X11 as I think it broke since I fixed it last time. ;-)
 
Tom Cooksey said:
For anyone who's interested...

I've added OpenGL ES 2.0 support in Qt/X11. The "final" commit was on Friday, so if you download & build the nightly snapshots you should get it.

I've tested it pretty well against the ImgTec emulation libraries. To build, make sure the ImgTec libraries are in your library & include path and do the following...

./configure -arch i386 -xplatform linux-g++-32 -opengl es2
make
sudo make install
If you're not on amd64, you can probably just configure with:
./configure -opengl es2

At the moment you should get a fully functional QGLWidget. To develop, follow the docs for QGLWidget.

Generally, compile & link your shaders in initializeGl(), setup your PMV matrix uniforms in resizeGL() and do all your rendering in paintGL(). By default - it will try to select the EGL config with the highest number of multi-samples. Override that behavior by passing your own QGLFormat to the QGLWidget constructor.

Qt might be an option if you fancy it. It's not the only option of course, but I thought I'd mention it.

I'm currently working on a paint engine for GL ES 2.0, along with some helper classes for shaders. I doubt it will make it into 4.5.0 though. :-( I will need to test cross-compiling Qt/X11 as I think it broke since I fixed it last time. ;-)



thanks Tom :)
 
Last edited by a moderator:
Back
Top