]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.c
Added in_mouse_x and in_mouse_y, which contain the rel. coords of the mouse.
[xonotic/darkplaces.git] / gl_backend.c
index c3eef34081e835296f1a08800b37a1663fa55521..70810fce77c665dbd7c83b2380e4845687bb4203 100644 (file)
@@ -344,6 +344,7 @@ static struct
        int blend;
        GLboolean depthmask;
        int depthtest;
+       int scissortest;
        int unit;
        int clientunit;
        gltextureunit_t units[MAX_TEXTUREUNITS];
@@ -605,6 +606,26 @@ void GL_LockArrays(int first, int count)
        }
 }
 
+void GL_Scissor (int x, int y, int width, int height)
+{
+       CHECKGLERROR
+       qglScissor(x, vid.realheight - (y + height),width,height);      
+       CHECKGLERROR
+}
+
+void GL_ScissorTest(qboolean state)
+{
+       if(gl_state.scissortest == state)
+               return;
+       
+       CHECKGLERROR
+       if((gl_state.scissortest = state))
+               qglEnable(GL_SCISSOR_TEST);
+       else
+               qglDisable(GL_SCISSOR_TEST);
+       CHECKGLERROR
+}
+
 void GL_TransformToScreen(const vec4_t in, vec4_t out)
 {
        vec4_t temp;