Using SDL2: Difference between revisions

From Pyra Wiki
Jump to navigation Jump to search
(Created page with "By default, SDL2 will use MESA llvm-pipe rendering which is slow. There's 2 options to enable SGX rendering depending on the profile the apps use. == Default profile == These...")
 
No edit summary
 
Line 15: Line 15:
And since a full GL context is known by SDL2, it will try to use it by default. To force SDL to pick the GLES context nonetheless at run time use:
And since a full GL context is known by SDL2, it will try to use it by default. To force SDL to pick the GLES context nonetheless at run time use:
: export SDL_OPENGL_ES_DRIVER=1 SDL_VIDEO_EGL_DRIVER=/opt/omap5-sgx-ddk-um-linux/lib/libEGL.so.1
: export SDL_OPENGL_ES_DRIVER=1 SDL_VIDEO_EGL_DRIVER=/opt/omap5-sgx-ddk-um-linux/lib/libEGL.so.1
Doing these 2 steps allow to use and run [https://pandorawiki.org/GLES#Example_on_how_to_use_GLES2_with_SDL2_on_the_Pandora ptitSeb SDL2 example] correctly.

Latest revision as of 15:02, 27 June 2021

By default, SDL2 will use MESA llvm-pipe rendering which is slow. There's 2 options to enable SGX rendering depending on the profile the apps use.

Default profile

These apps expect a full OpenGL context which the pyra doesnt have natively. Luckyly, gl4es exist to correct this issue. To use it, just set this variable before starting the app:

export SDL_OPENGL_LIBRARY=/usr/lib/arm-linux-gnueabihf/gl4es/libGL.so.1

GLES profile

Theses apps can use the SGX directly.

While compiling them, you should set :

export CFLAGS="-I/opt/omap5-sgx-ddk-um-linux/include" LD_FLAGS="-L/opt/omap5-sgx-ddk-um-linux/lib"

And since a full GL context is known by SDL2, it will try to use it by default. To force SDL to pick the GLES context nonetheless at run time use:

export SDL_OPENGL_ES_DRIVER=1 SDL_VIDEO_EGL_DRIVER=/opt/omap5-sgx-ddk-um-linux/lib/libEGL.so.1

Doing these 2 steps allow to use and run ptitSeb SDL2 example correctly.