PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

openGL questions

Hi, I've started doing some research on using OpenGL for 2d only, but I'm unclear on some basic points:

1. If I were to install an OpenGL implemntation library, link to the Edge wrapper library, and open the display in OpenGL, would Edge drawing functions get hardware accelerated? For example, would E2DSurface.Blt() be processed by graphics hardware instead of software?

2. If I were to use an OpenGL implementation (probably PowerVR) on a device that didn't support it, would it be possible to have the program fall back to Edge or OpenGL software rendering?

3. I'm already very happy overall with the performance of Edge. Does OpenGL necessarily offer a performance benefit? In particular, would an OpenGL software fallback be any faster/slower than the default Edge drawing?

4. One of my end goals is to have my display surface stretched 150% to fit my screen. I've done it in software using Blt with a scale parameter, but it isn't fast as I would like, and doesn't do any resampling. Can fast scaling with resampling be done in OpenGL?

Sorry for the newbie questions, just want to make sure I'm understanding things correctly before committing to going forward with this!
Hi,

When using EDGELIB with OpenGL, you should use the correct functions. One important difference is that there is no backbuffer, blitting will be done through ClassEDisplay. When OpenGL is disabled, this will get processed through the backbuffer internally so you can maintain an OpenGL and non-OpenGL version with one codebase.

For Windows Mobile, OpenGL is not supported very well. For each implementation (PowerVR, NVidia and software non-OpenGL) you need to make a seperate build.

Make sure to upload your surface to OpenGL before blitting them to ClassEDisplay (a good place to upload them is just after creating them at load time).

OpenGL can greatly increase performance (and is even required on some platforms to get acceptable speed such as iPhone) when doing a lot of blitting. However, when software OpenGL is used things can become very slow. You can also scale through OpenGL using ClassEDisplay :: Blt.
pocketjoris · 02 Apr 2009, 14:32 UTC
Is this maybe why display->buffer.FillRect() doesn't work with opengl?

Is there any other way to do a fillRect?
Hi Joris,

You need to call FillRect through ClassEDisplay, there is no backbuffer in OpenGL. Be sure to use the E_RGBA macro for the color parameter.