mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
4b585e75d9
Martin Fiedler To be precise, this is about *desktop OpenGL* on X11. For OpenGL ES, EGL is already used (as it's the only way to get an OpenGL ES context), as Sylvain noted above. To shine some light on why this is needed: In 99% of all cases, using GLX on X11 is fine, even though it's effectively deprecated in favor of EGL [1]. However, there's at least one use case that *requires* the OpenGL context being created with EGL instead of GLX, and that's DRM_PRIME interoperability: The function glEGLImageTargetTexture2DOES simply doesn't work with GLX. (Currently, Mesa actually crashes when trying that.) Some example code: https://gist.github.com/kajott/d1b29c613be30893c855621edd1f212e Runs on Intel and open-source AMD drivers just fine (others unconfirmed), but with #define USE_EGL 0 (i.e. forcing it to GLX), it crashes. The same happens when using SDL for window and context creation. The good news is that most of the pieces for EGL support on X11 are already in place: SDL_egl.c is pretty complete (and used for desktop OpenGL on Wayland, for example), and SDL_x11opengl.c has the aforementioned OpenGL-ES-on-EGL support. However, when it comes to desktop OpenGL, it's hardcoded to fall back to GLX. I'm not advocating to make EGL the default for desktop OpenGL on X11; don't fix what ain't broken. But something like an SDL_HINT_VIDEO_X11_FORCE_EGL would be very appreciated to make use cases like the above work with SDL. [1] source: Eric Anholt, major Linux graphics stack developer, 7 years ago already - see last paragraph of https://www.phoronix.com/scan.php?page=news_item&px=MTE3MTI |
||
---|---|---|
.. | ||
begin_code.h | ||
close_code.h | ||
SDL_assert.h | ||
SDL_atomic.h | ||
SDL_audio.h | ||
SDL_bits.h | ||
SDL_blendmode.h | ||
SDL_clipboard.h | ||
SDL_config_android.h | ||
SDL_config_iphoneos.h | ||
SDL_config_macosx.h | ||
SDL_config_minimal.h | ||
SDL_config_os2.h | ||
SDL_config_pandora.h | ||
SDL_config_psp.h | ||
SDL_config_windows.h | ||
SDL_config_winrt.h | ||
SDL_config_wiz.h | ||
SDL_config.h | ||
SDL_config.h.cmake | ||
SDL_config.h.in | ||
SDL_copying.h | ||
SDL_cpuinfo.h | ||
SDL_egl.h | ||
SDL_endian.h | ||
SDL_error.h | ||
SDL_events.h | ||
SDL_filesystem.h | ||
SDL_gamecontroller.h | ||
SDL_gesture.h | ||
SDL_haptic.h | ||
SDL_hints.h | ||
SDL_joystick.h | ||
SDL_keyboard.h | ||
SDL_keycode.h | ||
SDL_loadso.h | ||
SDL_log.h | ||
SDL_main.h | ||
SDL_messagebox.h | ||
SDL_metal.h | ||
SDL_mouse.h | ||
SDL_mutex.h | ||
SDL_name.h | ||
SDL_opengl_glext.h | ||
SDL_opengl.h | ||
SDL_opengles2_gl2.h | ||
SDL_opengles2_gl2ext.h | ||
SDL_opengles2_gl2platform.h | ||
SDL_opengles2_khrplatform.h | ||
SDL_opengles2.h | ||
SDL_opengles.h | ||
SDL_pixels.h | ||
SDL_platform.h | ||
SDL_power.h | ||
SDL_quit.h | ||
SDL_rect.h | ||
SDL_render.h | ||
SDL_revision.h | ||
SDL_rwops.h | ||
SDL_scancode.h | ||
SDL_sensor.h | ||
SDL_shape.h | ||
SDL_stdinc.h | ||
SDL_surface.h | ||
SDL_system.h | ||
SDL_syswm.h | ||
SDL_test_assert.h | ||
SDL_test_common.h | ||
SDL_test_compare.h | ||
SDL_test_crc32.h | ||
SDL_test_font.h | ||
SDL_test_fuzzer.h | ||
SDL_test_harness.h | ||
SDL_test_images.h | ||
SDL_test_log.h | ||
SDL_test_md5.h | ||
SDL_test_memory.h | ||
SDL_test_random.h | ||
SDL_test.h | ||
SDL_thread.h | ||
SDL_timer.h | ||
SDL_touch.h | ||
SDL_types.h | ||
SDL_version.h | ||
SDL_video.h | ||
SDL_vulkan.h | ||
SDL.h |