mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-13 10:24:39 +00:00
SDL: Make sure SDL_GL_SetSwapInterval() is only called on the GL path
This commit is contained in:
parent
62656b6e6f
commit
41b1165dcd
@ -299,6 +299,13 @@ void EGL_Close() {
|
||||
|
||||
#endif // USING_EGL
|
||||
|
||||
bool SDLGLGraphicsContext::InitFromRenderThread() {
|
||||
bool retval = GraphicsContext::InitFromRenderThread();
|
||||
// HACK: Ensure that the swap interval is set after context creation (needed for kmsdrm)
|
||||
SDL_GL_SetSwapInterval(1);
|
||||
return retval;
|
||||
}
|
||||
|
||||
// Returns 0 on success.
|
||||
int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int w, int h, int mode, std::string *error_message) {
|
||||
struct GLVersionPair {
|
||||
@ -435,6 +442,7 @@ int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int w, int h,
|
||||
INFO_LOG(Log::G3D, "SDL SwapInterval: %d", interval);
|
||||
SDL_GL_SetSwapInterval(interval);
|
||||
});
|
||||
|
||||
window_ = window;
|
||||
return 0;
|
||||
}
|
||||
|
@ -16,6 +16,8 @@ public:
|
||||
// Returns 0 on success.
|
||||
int Init(SDL_Window *&window, int x, int y, int w, int h, int mode, std::string *error_message);
|
||||
|
||||
bool InitFromRenderThread() override;
|
||||
|
||||
void Shutdown() override {}
|
||||
void ShutdownFromRenderThread() override;
|
||||
|
||||
|
@ -1402,9 +1402,6 @@ int main(int argc, char *argv[]) {
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
#endif
|
||||
|
||||
// Ensure that the swap interval is set after context creation (needed for kmsdrm)
|
||||
SDL_GL_SetSwapInterval(1);
|
||||
|
||||
// Avoid the IME popup when holding keys. This doesn't affect all versions of SDL.
|
||||
// TODO: Enable it in text input fields
|
||||
SDL_StopTextInput();
|
||||
|
Loading…
x
Reference in New Issue
Block a user