src/render/opengl/SDL_render_gl.c
changeset 9680 1d13a878b066
parent 9619 b94b6d0bff0f
child 9958 687e118144c7
equal deleted inserted replaced
9679:7fc4a8be47a8 9680:1d13a878b066
  1044     GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
  1044     GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
  1045 
  1045 
  1046     if (renderer->clipping_enabled) {
  1046     if (renderer->clipping_enabled) {
  1047         const SDL_Rect *rect = &renderer->clip_rect;
  1047         const SDL_Rect *rect = &renderer->clip_rect;
  1048         data->glEnable(GL_SCISSOR_TEST);
  1048         data->glEnable(GL_SCISSOR_TEST);
  1049         data->glScissor(rect->x, renderer->viewport.h - rect->y - rect->h, rect->w, rect->h);
  1049         if (renderer->target) {
       
  1050             data->glScissor(renderer->viewport.x + rect->x, renderer->viewport.y + rect->y, rect->w, rect->h);
       
  1051         } else {
       
  1052             int w, h;
       
  1053 
       
  1054             SDL_GetRendererOutputSize(renderer, &w, &h);
       
  1055             data->glScissor(renderer->viewport.x + rect->x, (h - renderer->viewport.y - renderer->viewport.h) + rect->y, rect->w, rect->h);
       
  1056         }
  1050     } else {
  1057     } else {
  1051         data->glDisable(GL_SCISSOR_TEST);
  1058         data->glDisable(GL_SCISSOR_TEST);
  1052     }
  1059     }
  1053     return 0;
  1060     return 0;
  1054 }
  1061 }