mirror of https://github.com/encounter/SDL.git
render: Mark viewport/cliprect dirty when window is resized.
Fixes #4751.
This commit is contained in:
parent
b8da02e6ef
commit
5faea84c63
|
@ -1279,7 +1279,14 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
|
||||||
|
|
||||||
data->drawstate.target = renderer->target;
|
data->drawstate.target = renderer->target;
|
||||||
if (!data->drawstate.target) {
|
if (!data->drawstate.target) {
|
||||||
SDL_GL_GetDrawableSize(renderer->window, &data->drawstate.drawablew, &data->drawstate.drawableh);
|
int w, h;
|
||||||
|
SDL_GL_GetDrawableSize(renderer->window, &w, &h);
|
||||||
|
if ((w != data->drawstate.drawablew) || (h != data->drawstate.drawableh)) {
|
||||||
|
data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc.
|
||||||
|
data->drawstate.cliprect_dirty = SDL_TRUE;
|
||||||
|
data->drawstate.drawablew = w;
|
||||||
|
data->drawstate.drawableh = h;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -934,7 +934,15 @@ GLES_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vert
|
||||||
data->drawstate.target = renderer->target;
|
data->drawstate.target = renderer->target;
|
||||||
|
|
||||||
if (!renderer->target) {
|
if (!renderer->target) {
|
||||||
SDL_GL_GetDrawableSize(renderer->window, &data->drawstate.drawablew, &data->drawstate.drawableh);
|
int w, h;
|
||||||
|
SDL_GL_GetDrawableSize(renderer->window, &w, &h);
|
||||||
|
if ((w != data->drawstate.drawablew) || (h != data->drawstate.drawableh)) {
|
||||||
|
data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc.
|
||||||
|
data->drawstate.cliprect_dirty = SDL_TRUE;
|
||||||
|
data->drawstate.drawablew = w;
|
||||||
|
data->drawstate.drawableh = h;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (cmd) {
|
while (cmd) {
|
||||||
|
|
|
@ -1270,7 +1270,14 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver
|
||||||
|
|
||||||
data->drawstate.target = renderer->target;
|
data->drawstate.target = renderer->target;
|
||||||
if (!data->drawstate.target) {
|
if (!data->drawstate.target) {
|
||||||
SDL_GL_GetDrawableSize(renderer->window, &data->drawstate.drawablew, &data->drawstate.drawableh);
|
int w, h;
|
||||||
|
SDL_GL_GetDrawableSize(renderer->window, &w, &h);
|
||||||
|
if ((w != data->drawstate.drawablew) || (h != data->drawstate.drawableh)) {
|
||||||
|
data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc.
|
||||||
|
data->drawstate.cliprect_dirty = SDL_TRUE;
|
||||||
|
data->drawstate.drawablew = w;
|
||||||
|
data->drawstate.drawableh = h;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* upload the new VBO data for this set of commands. */
|
/* upload the new VBO data for this set of commands. */
|
||||||
|
|
|
@ -987,7 +987,15 @@ VITA_GXM_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *
|
||||||
|
|
||||||
data->drawstate.target = renderer->target;
|
data->drawstate.target = renderer->target;
|
||||||
if (!data->drawstate.target) {
|
if (!data->drawstate.target) {
|
||||||
SDL_GL_GetDrawableSize(renderer->window, &data->drawstate.drawablew, &data->drawstate.drawableh);
|
int w, h;
|
||||||
|
SDL_GL_GetDrawableSize(renderer->window, &w, &h);
|
||||||
|
if ((w != data->drawstate.drawablew) || (h != data->drawstate.drawableh)) {
|
||||||
|
data->drawstate.viewport_dirty = SDL_TRUE; // if the window dimensions changed, invalidate the current viewport, etc.
|
||||||
|
data->drawstate.cliprect_dirty = SDL_TRUE;
|
||||||
|
data->drawstate.drawablew = w;
|
||||||
|
data->drawstate.drawableh = h;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (cmd) {
|
while (cmd) {
|
||||||
|
|
Loading…
Reference in New Issue