src/render/opengl/SDL_render_gl.c
changeset 7169 d27e9ee7310f
parent 7161 1619292eec30
child 7171 929700967727
equal deleted inserted replaced
7168:b9070b2e868a 7169:d27e9ee7310f
   792     const SDL_Rect *rect = &renderer->clip_rect;
   792     const SDL_Rect *rect = &renderer->clip_rect;
   793     GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
   793     GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
   794 
   794 
   795     if (!SDL_RectEmpty(rect)) {
   795     if (!SDL_RectEmpty(rect)) {
   796         data->glEnable(GL_SCISSOR_TEST);
   796         data->glEnable(GL_SCISSOR_TEST);
   797         data->glScissor(rect->x, rect->h - rect->y, rect->w, rect->h);
   797         int lowerLeft = renderer->viewport.h - rect->y - rect->h;
       
   798         data->glScissor(rect->x, lowerLeft, rect->w, rect->h);
   798     } else {
   799     } else {
   799         data->glDisable(GL_SCISSOR_TEST);
   800         data->glDisable(GL_SCISSOR_TEST);
   800     }
   801     }
   801     return 0;
   802     return 0;
   802 }
   803 }