adoptware / pinball

Emilia Pinball : A Libre pinball simulator for GNU Linux
https://purl.org/rzr/pinball
GNU General Public License v2.0
30 stars 15 forks source link

Add OpenGL ES support #23

Closed caramelli closed 3 years ago

caramelli commented 3 years ago

This change adds a basic OpenGL ES support.

Nicolas Caramelli

caramelli commented 3 years ago

I removed cleanup changes as suggested. I'd rather let you make those cleanup changes. Before merging, can you first test it on your side? I'm curious about the performance you get.

rzr commented 3 years ago

Thx I tried that patch on my desktop with nvidia card but only fonts are displaying, maybe my base is dirty, I'll try again on Pi.

Other suggestion may I suggest to try to relocate for of your opengl #ifdef to OpenGLRenderer class (or a newer one like OpenGLESRenderer to preserve the desktop one).

You can start by create a Renderer::setFrustum() that will remove glFrustum from TextureUtils

what do you think ?

Refactoring can be done afterward. also to you prefer me to indent the files before or after merge ?

caramelli commented 3 years ago

The specificity related to OpenGL ES 1.1 CM seems really minor to justify abstracting this. But depending on what you plan to refactor in the future, feel free to do what's best for you.

If I'm not wrong, the indentation is consistent with the code already there. But I agree that the indentation is not always perfect (this is prior to my PR): yes, it would be nice to have a separate commit to fix it.

caramelli commented 3 years ago

For SDL_GL_GetAttribute( SDL_GL_DOUBLEBUFFER, &value ), this is an issue in SDL2 (this does not happen when building SDL2 without OpenGL desktop support). Maybe I'll send a fix to the SDL2 project for this. I'm not sure that it's really useful to print this information, but I'm leaving it for the OpenGL desktop if you'd prefer to keep it.

Nicolas Caramelli