mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
SDL: Make sure SDL_GL_SetSwapInterval() is only called on the GL path
This commit is contained in:
parent
62656b6e6f
commit
41b1165dcd
3 changed files with 10 additions and 3 deletions
|
@ -299,6 +299,13 @@ void EGL_Close() {
|
||||||
|
|
||||||
#endif // USING_EGL
|
#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.
|
// Returns 0 on success.
|
||||||
int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int w, int h, int mode, std::string *error_message) {
|
int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int w, int h, int mode, std::string *error_message) {
|
||||||
struct GLVersionPair {
|
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);
|
INFO_LOG(Log::G3D, "SDL SwapInterval: %d", interval);
|
||||||
SDL_GL_SetSwapInterval(interval);
|
SDL_GL_SetSwapInterval(interval);
|
||||||
});
|
});
|
||||||
|
|
||||||
window_ = window;
|
window_ = window;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,8 @@ public:
|
||||||
// Returns 0 on success.
|
// Returns 0 on success.
|
||||||
int Init(SDL_Window *&window, int x, int y, int w, int h, int mode, std::string *error_message);
|
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 Shutdown() override {}
|
||||||
void ShutdownFromRenderThread() override;
|
void ShutdownFromRenderThread() override;
|
||||||
|
|
||||||
|
|
|
@ -1402,9 +1402,6 @@ int main(int argc, char *argv[]) {
|
||||||
SDL_ShowCursor(SDL_DISABLE);
|
SDL_ShowCursor(SDL_DISABLE);
|
||||||
#endif
|
#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.
|
// Avoid the IME popup when holding keys. This doesn't affect all versions of SDL.
|
||||||
// TODO: Enable it in text input fields
|
// TODO: Enable it in text input fields
|
||||||
SDL_StopTextInput();
|
SDL_StopTextInput();
|
||||||
|
|
Loading…
Add table
Reference in a new issue