|
|
@ -37,16 +37,24 @@ public: |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void MakeCurrent() override { |
|
|
void MakeCurrent() override { |
|
|
SDL_GL_MakeCurrent(window, context); |
|
|
|
|
|
|
|
|
if (is_current) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
is_current = SDL_GL_MakeCurrent(window, context) == 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void DoneCurrent() override { |
|
|
void DoneCurrent() override { |
|
|
|
|
|
if (!is_current) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
SDL_GL_MakeCurrent(window, nullptr); |
|
|
SDL_GL_MakeCurrent(window, nullptr); |
|
|
|
|
|
is_current = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
SDL_Window* window; |
|
|
SDL_Window* window; |
|
|
SDL_GLContext context; |
|
|
SDL_GLContext context; |
|
|
|
|
|
bool is_current = false; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
bool EmuWindow_SDL2_GL::SupportsRequiredGLExtensions() { |
|
|
bool EmuWindow_SDL2_GL::SupportsRequiredGLExtensions() { |
|
|
|