diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index f3ba4cc6d4..5b5dc56eed 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -3024,4 +3024,28 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() return rtns; } +#pragma GCC error "Unimplemented. Either disable threaded texture decoding, implent those methods or switch to SDL2." + +void* LLWindowSDL::createSharedContext() +{ + LL_WARNS() << "Not available" << LL_ENDL; + return nullptr; +} + +void LLWindowSDL::makeContextCurrent(void* contextPtr) +{ + LL_WARNS() << "Not available" << LL_ENDL; + LL_PROFILER_GPU_CONTEXT; +} + +void LLWindowSDL::destroySharedContext(void* contextPtr) +{ + LL_WARNS() << "Not available" << LL_ENDL; +} + +void LLWindowSDL::toggleVSync(bool enable_vsync) +{ + LL_WARNS() << "Not available" << LL_ENDL; +} + #endif // LL_SDL diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index c2d49fd251..da6da0f4d8 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -151,7 +151,11 @@ public: static Window get_SDL_XWindowID(void); static Display* get_SDL_Display(void); #endif // LL_X11 - + void* createSharedContext() override; + void makeContextCurrent(void* context) override; + void destroySharedContext(void* context) override; + void toggleVSync(bool enable_vsync) override; + protected: LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, int x, int y, int width, int height, U32 flags, diff --git a/indra/llwindow/llwindowsdl2.cpp b/indra/llwindow/llwindowsdl2.cpp index b5e350f863..bf93216ff8 100644 --- a/indra/llwindow/llwindowsdl2.cpp +++ b/indra/llwindow/llwindowsdl2.cpp @@ -78,7 +78,10 @@ static bool ATIbug = false; // be only one object of this class at any time. Currently this is true. static LLWindowSDL *gWindowImplementation = NULL; - +// extern "C" Bool XineramaIsActive (Display *dpy) +// { +// return 0; +// } void maybe_lock_display(void) { if (gWindowImplementation && gWindowImplementation->Lock_Display) { @@ -2560,4 +2563,25 @@ std::vector LLWindowSDL::getDynamicFallbackFontList() return rtns; } + +void* LLWindowSDL::createSharedContext() +{ + return SDL_GL_CreateContext(mWindow); +} + +void LLWindowSDL::makeContextCurrent(void* contextPtr) +{ + LL_PROFILER_GPU_CONTEXT; + SDL_GL_MakeCurrent( mWindow, contextPtr ); +} + +void LLWindowSDL::destroySharedContext(void* contextPtr) +{ + SDL_GL_DeleteContext( contextPtr ); +} + +void LLWindowSDL::toggleVSync(bool enable_vsync) +{ +} + #endif // LL_SDL diff --git a/indra/llwindow/llwindowsdl2.h b/indra/llwindow/llwindowsdl2.h index e60827644d..42c6a0d325 100644 --- a/indra/llwindow/llwindowsdl2.h +++ b/indra/llwindow/llwindowsdl2.h @@ -148,6 +148,11 @@ public: static Display* get_SDL_Display(void); #endif // LL_X11 + void* createSharedContext() override; + void makeContextCurrent(void* context) override; + void destroySharedContext(void* context) override; + void toggleVSync(bool enable_vsync) override; + protected: LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, int x, int y, int width, int height, U32 flags,