OpenGL Advances

SDL/OpenGL Graphics Manager in action

I have advanced in many things this week. And the OpenGL Graphics Manager can now display the ScummVM start menu (There are still some little issues to fix).

I started the week merging from trunk, so I can make sure that my changes are fully compatible with the actual development. But, I had to merge manually some files, and also to revise all merged code (There were some merging errors, and ton of conflicts).

I also fixed lots of errors on the GL manager, there were lots of segfaults thanks to bad memory allocation, I was reserving less than I should, and some problems with non power of two textures.

x2 Scale Factor

Now, the Overlay and Cursor are working. The overlay was simpler to implement, as it uses a 16 bit rgba pixel format, but the cursor was complicated because it is needed to convert the cursor from a paletted surface to a rgba one, because OpenGL does not support nicely paletted textures.

I have worked too on scaling and resizing the ScummVM window. With OpenGL a texture scaling is pretty easy, though it can complicate because resizing the window causes problems with the OpenGL context, and I also had some hard time for adjusting the mouse coordinates to the current scaling.

Resized x1 Window

After many tries, and fixes, now the graphics manager supports x1, x2, and x3 scale factors (Hotkeys: Ctrl+Alt+(Plus/Minus)), which will resize the overlay size, and it also supports the window to be resized from the borders to any size. Resizing from the borders won’t modify the overlay or game screen size, so it they will be stretched to fit into the window.

However, I still need to implement a feature for maintaining the aspect ratio while resizing the window, so black borders will be added around the screen instead of breaking the aspect ratio.

Finally, I implemented fullscreen support. Had some bad time debugging it, because thanks to some segfaults raising when ScummVM was in fullscreen, not allowing me to change to Visual Studio. Still, I could find the problem revising the code, and now fullscreen works well. But, I need to do a better testing of fullscreen and also scaling on linux, I have made most tests on a virtual machine and the virtual machine does not handle OpenGL and fullscreen well.

My plan for this week is to implement aspect ratio support and game screen drawing. This 2 things are the last biggest things I need to work on, and only some small functions, documentation and some code cleanup will be left.