VERSIÓ 1.5.15:
- [FIX] Els shaders funcionen correctament al canviar zoom o fullscreen
This commit is contained in:
1 parent
7aebcfe055
commit
8ae82936dc
2 files changed
+7
-7
No files matched your search
@@ -29,7 +29,7 @@ namespace backend
|
||||
SDL_Point win_size = {640, 480};
|
||||
SDL_FPoint tex_size = {320, 240};
|
||||
bool can_use_opengl = false;
|
||||
bool using_opengl = false;
|
||||
bool enabled = false;
|
||||
const char *vShaderSource = nullptr;
|
||||
const char *fShaderSource = nullptr;
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace backend
|
||||
{
|
||||
programId = 0;
|
||||
can_use_opengl = false;
|
||||
using_opengl = false;
|
||||
//using_opengl = false;
|
||||
}
|
||||
|
||||
void reinit()
|
||||
@@ -210,12 +210,12 @@ namespace backend
|
||||
fShaderSource = fshader;
|
||||
programId = 0;
|
||||
can_use_opengl = false;
|
||||
using_opengl = false;
|
||||
//using_opengl = false;
|
||||
reinit();
|
||||
}
|
||||
|
||||
void enable() { if (can_use_opengl) using_opengl = true; }
|
||||
void disable() { using_opengl = false; }
|
||||
void enable() { enabled = true; }
|
||||
void disable() { enabled = false; }
|
||||
|
||||
void render()
|
||||
{
|
||||
@@ -225,7 +225,7 @@ namespace backend
|
||||
SDL_RenderClear(backend::video::renderer);
|
||||
SDL_FlushRenderer(backend::video::renderer);
|
||||
|
||||
if (using_opengl)
|
||||
if (can_use_opengl && enabled)
|
||||
{
|
||||
GLint oldProgramId;
|
||||
if (programId != 0)
|
||||
|
||||
Reference in new issue
Block a user