Dingoonity.org

GCW Zero => Development => Topic started by: David Knight on February 27, 2015, 09:39:14 am

Title: NeedsDownscaling with opengl es in SDL2.0?
Post by: David Knight on February 27, 2015, 09:39:14 am
I'm building an app which requires downscaling for the gcw0 from 640x480 to 320x340. It works fine with IPU downscaling in SDL 1.2 but crashes with opengl es in SDL 2.0. As a test, with resolution changed to 320x240 it works fine.

I suspect I'm running into this issue:
Ah, a small note. As SDL2 does not support X11-less Linux devices, we had to write our own SDL2 backend, and it's hardcoded to 320x240. So SDL2 apps can only use 320x240.

I'm adding a software scaler but is this likely to be fixed in future?
Title: Re: NeedsDownscaling with opengl es in SDL2.0?
Post by: Senor Quack on February 27, 2015, 07:28:57 pm
If it's using GLES as a backend, there's no need to add any software scaling, because a device with OpenGL drivers automatically works as a hardware scaler. You keep your viewport set at 320x240, and as long as you're setting your projection matrix correctly, it will downscale any conceivable resolution to whatever your viewport is. In this case, it is likely using an orthographic projection matrix. So, if it is not displaying correctly when the resoluton is set to 320x240 (only displaying one quadrant of the screen), that means something is wrong in the values its using setting up the projection matrix. It's probably somehow assuming you're still at a 640x480 viewport.