OpenGL and 2D-only rendering
Posted: Oct 6, 2010 @ 2:53am
Hello,
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!
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!