mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Fixed bug 3355 - false "Invalid renderer" after creating an "opengles2" renderer.
Call SDL_GL_GetDrawableSize() directly because we may be in the initialization path and SDL_GetRendererOutputSize() will fail because the renderer magic isn't set up yet.
This commit is contained in:
parent
741aaf4c80
commit
662f966cd9
@ -592,7 +592,6 @@ static int
|
|||||||
GL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
|
GL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
|
||||||
{
|
{
|
||||||
SDL_GL_GetDrawableSize(renderer->window, w, h);
|
SDL_GL_GetDrawableSize(renderer->window, w, h);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1020,7 +1019,7 @@ GL_UpdateViewport(SDL_Renderer * renderer)
|
|||||||
} else {
|
} else {
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
SDL_GetRendererOutputSize(renderer, &w, &h);
|
SDL_GL_GetDrawableSize(renderer, &w, &h);
|
||||||
data->glViewport(renderer->viewport.x, (h - renderer->viewport.y - renderer->viewport.h),
|
data->glViewport(renderer->viewport.x, (h - renderer->viewport.y - renderer->viewport.h),
|
||||||
renderer->viewport.w, renderer->viewport.h);
|
renderer->viewport.w, renderer->viewport.h);
|
||||||
}
|
}
|
||||||
@ -1058,7 +1057,7 @@ GL_UpdateClipRect(SDL_Renderer * renderer)
|
|||||||
} else {
|
} else {
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
SDL_GetRendererOutputSize(renderer, &w, &h);
|
SDL_GL_GetDrawableSize(renderer, &w, &h);
|
||||||
data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h);
|
data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -672,7 +672,7 @@ GLES_UpdateViewport(SDL_Renderer * renderer)
|
|||||||
} else {
|
} else {
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
SDL_GetRendererOutputSize(renderer, &w, &h);
|
SDL_GL_GetDrawableSize(renderer, &w, &h);
|
||||||
data->glViewport(renderer->viewport.x, (h - renderer->viewport.y - renderer->viewport.h),
|
data->glViewport(renderer->viewport.x, (h - renderer->viewport.y - renderer->viewport.h),
|
||||||
renderer->viewport.w, renderer->viewport.h);
|
renderer->viewport.w, renderer->viewport.h);
|
||||||
}
|
}
|
||||||
@ -715,7 +715,7 @@ GLES_UpdateClipRect(SDL_Renderer * renderer)
|
|||||||
} else {
|
} else {
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
SDL_GetRendererOutputSize(renderer, &w, &h);
|
SDL_GL_GetDrawableSize(renderer, &w, &h);
|
||||||
data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h);
|
data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -388,7 +388,7 @@ GLES2_UpdateViewport(SDL_Renderer * renderer)
|
|||||||
} else {
|
} else {
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
SDL_GetRendererOutputSize(renderer, &w, &h);
|
SDL_GL_GetDrawableSize(renderer->window, &w, &h);
|
||||||
data->glViewport(renderer->viewport.x, (h - renderer->viewport.y - renderer->viewport.h),
|
data->glViewport(renderer->viewport.x, (h - renderer->viewport.y - renderer->viewport.h),
|
||||||
renderer->viewport.w, renderer->viewport.h);
|
renderer->viewport.w, renderer->viewport.h);
|
||||||
}
|
}
|
||||||
@ -417,7 +417,7 @@ GLES2_UpdateClipRect(SDL_Renderer * renderer)
|
|||||||
} else {
|
} else {
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
SDL_GetRendererOutputSize(renderer, &w, &h);
|
SDL_GL_GetDrawableSize(renderer->window, &w, &h);
|
||||||
data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h);
|
data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user