Browse Source

Platform: hint SDL what GLES library we want to use.

pull/317/head
Vladimír Vondruš 7 years ago
parent
commit
d7d65db884
  1. 8
      doc/changelog.dox
  2. 6
      src/Magnum/Platform/Sdl2Application.cpp
  3. 11
      src/Magnum/Platform/Sdl2Application.h

8
doc/changelog.dox

@ -46,6 +46,14 @@ See also:
recognizes also uppercase file extensions (see
[mosra/magnum#312](https://github.com/mosra/magnum/pull/312))
@subsubsection changelog-latest-changes-platform Platform libraries
- On OpenGL ES builds, @ref Platform::Sdl2Application now tells SDL whether
to use a system GL driver or a dedicated GLES driver based on whether
@ref MAGNUM_TARGET_DESKTOP_GLES is defined. This allows for a smoother
experience for example when using ANGLE on Windows. See
@ref Platform-Sdl2Application-usage-gles for more information.
@subsubsection changelog-latest-changes-trade Trade library
- The @ref Trade::AnyImageImporter "AnyImageImporter",

6
src/Magnum/Platform/Sdl2Application.cpp

@ -97,6 +97,12 @@ Sdl2Application::Sdl2Application(const Arguments& arguments, NoCreateT):
#ifdef SDL_HINT_NO_SIGNAL_HANDLERS
SDL_SetHint(SDL_HINT_NO_SIGNAL_HANDLERS, "1");
#endif
/* Available since 2.0.6, uses dedicated OpenGL ES drivers by default and a
desktop GLES context only if MAGNUM_TARGET_DESKTOP_GLES is defined as
well. */
#if !defined(MAGNUM_TARGET_DESKTOP_GLES) && defined(SDL_HINT_OPENGL_ES_DRIVER)
SDL_SetHint(SDL_HINT_OPENGL_ES_DRIVER, "1");
#endif
/* Available since 2.0.8, disables compositor bypass on X11, which causes
flickering on KWin as the compositor gets shut down on every startup */
#ifdef SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR

11
src/Magnum/Platform/Sdl2Application.h

@ -305,6 +305,17 @@ If you enable @ref Configuration::WindowFlag::Resizable, the canvas will be
resized when size of the canvas changes and you get @ref viewportEvent(). If
the flag is not enabled, no canvas resizing is performed.
@subsection Platform-Sdl2Application-usage-gles OpenGL ES specifics
For OpenGL ES, SDL2 defaults to a "desktop GLES" context of the system driver.
Because Magnum has the opposite default behavior, if @ref MAGNUM_TARGET_GLES is
not defined and SDL >= 2.0.6 is used, @ref Sdl2Application sets the
`SDL_HINT_OPENGL_ES_DRIVER` hint to 1, forcing it to load symbols from a
dedicated libGLES library instead, making SDL and Magnum consistently use the
same OpenGL entrypoints. This change also allows @ref platforms-gl-es-angle "ANGLE"
to be used on Windows simply by placing the corresponding `libEGL.dll` and
`libGLESv2.dll` files next to the application executable.
@section Platform-Sdl2Application-dpi DPI awareness
On displays that match the platform default DPI (96 or 72),

Loading…
Cancel
Save