This site is no longer active and is available for archival purposes only. Registration and login is disabled.

OpenGL and 2D-only rendering

OpenGL and 2D-only rendering

Postby totoch » Oct 6, 2010 @ 2:53am


I am currently moving on from the Software Rendering delivered with EdgeLib to use OpenGL for my project.
I used the code delivered with the samples to define EGL_USEGL, included GL/GL.h (I tried using both the implementation of OpenGL for Windows in Microsoft SDKs and NVidia's OpenGL SDK, both give the same results).
i also #pragma commented plugingl.lib and opengl.lib.
All has been set with Visual Studio and the code to include and use OpenGL properly in my project.
Also, I modified my code to UploadTexture() all the surfaces created with ecd->dsp (ClassEDisplay).
I also used Perspective2D before rendering, I blit using ecd->dsp (not the ecd->dsp->buffer anymore).
Well, everything renders well as usual, but I really am not sure my program is using OpenGL rendering instead of Edgelib's internal software rendering. Here is why :
- I tried modifying the values given to Perspective2D instead of the screen's real mensurations, even with funky values. Doesn't change anything.
- More importantly, SetShading(EFX_COLORKEY | EFX_OPACITY, opacity); or any other flavor of SetShading doesn't change anything to the rendering I always used to have. I need to do that, because when rendering RGBA surfaces with BltFast, I can't give an opacity to it.
- All the other OpenGL functions like glClear, etc. don't affect nothing.

My questions are :
- Is there any way to make sure it is OpenGL that used instead of EdgeLib's internal renderer ? To know what is actually real renderer my program uses ?
- Is there any way to flip RGBA surfaces (that, as far as I'm concerned, can only be blitted with the BltFast method) now that I use OpenGL ?

More importantly, I would like to know if you could be nice enough to make us a little tutorial about using OpenGL for the 2D-only games, treating of E2DSurface(RGBA) Loading and Blitting ? I think it would benefit a lot people and would be greatly appreciated.

Thank you in advance for the answer, and maybe the tutorial. That would be great!
pm Member
Posts: 20
Joined: Sep 20, 2009 @ 10:27pm

Re: OpenGL and 2D-only rendering

Postby edge » Oct 7, 2010 @ 8:10pm

Dear Totoch,

1) To see if OpenGL is really enabled, try glClearColor and glClear (and remove the other calls) in OnNextFrame.
2) You can use display->BltFx for flipping and rotating RGBA surfaces.

Can you also try to run one of the EDGELIB OpenGL samples and build them directly from the project which is delivered with the SDK?

BTW, expanding/updating the tutorials is on our "to do" list.

EDGELIB: Cross-platform mobile development at your fingertips
User avatar
pm Member
Posts: 1180
Joined: Aug 22, 2005 @ 3:42pm
Location: The Netherlands

Re: OpenGL and 2D-only rendering

Postby totoch » Oct 8, 2010 @ 4:05am

I managed to fix it, using your advice.
I don't know why but removing the call to include "resource.h" fixed it... Well, I don't even use icons so I guess it's not really indispensable for me.

Thank you ! And impatient to see the new tutorials !
pm Member
Posts: 20
Joined: Sep 20, 2009 @ 10:27pm

Return to EDGELIB


Forum Description

Powerful and affordable C++ middleware solution covering true multi-platform 2D, 3D and network features for Apple iPhone, Windows Mobile, Symbian S60, UIQ, Linux and Windows desktop.



Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum