-extern int polygonelements[768];
-
-void GL_SetupView_ViewPort (int x, int y, int width, int height);
-void GL_SetupView_Orientation_Identity (void);
-void GL_SetupView_Orientation_FromEntity (vec3_t origin, vec3_t angles);
-void GL_SetupView_Mode_Perspective (double fovx, double fovy, double zNear, double zFar);
-void GL_SetupView_Mode_PerspectiveInfiniteFarClip (double fovx, double fovy, double zNear);
-void GL_SetupView_Mode_Ortho (double x1, double y1, double x2, double y2, double zNear, double zFar);
-void GL_UseColorArray(void);
+extern int polygonelement3i[(POLYGONELEMENTS_MAXPOINTS-2)*3];
+extern unsigned short polygonelement3s[(POLYGONELEMENTS_MAXPOINTS-2)*3];
+#define QUADELEMENTS_MAXQUADS 128
+extern int quadelement3i[QUADELEMENTS_MAXQUADS*6];
+extern unsigned short quadelement3s[QUADELEMENTS_MAXQUADS*6];
+
+void R_Viewport_TransformToScreen(const r_viewport_t *v, const vec4_t in, vec4_t out);
+void R_Viewport_InitOrtho(r_viewport_t *v, const matrix4x4_t *cameramatrix, int x, int y, int width, int height, double x1, double y1, double x2, double y2, double zNear, double zFar, const double *nearplane);
+void R_Viewport_InitPerspective(r_viewport_t *v, const matrix4x4_t *cameramatrix, int x, int y, int width, int height, double frustumx, double frustumy, double zNear, double zFar, const double *nearplane);
+void R_Viewport_InitPerspectiveInfinite(r_viewport_t *v, const matrix4x4_t *cameramatrix, int x, int y, int width, int height, double frustumx, double frustumy, double zNear, const double *nearplane);
+void R_Viewport_InitCubeSideView(r_viewport_t *v, const matrix4x4_t *cameramatrix, int side, int size, float nearclip, float farclip, const float *nearplane);
+void R_Viewport_InitRectSideView(r_viewport_t *v, const matrix4x4_t *cameramatrix, int side, int size, int border, float nearclip, float farclip, const float *nearplane);
+void R_SetViewport(const r_viewport_t *v);
+void R_GetViewport(r_viewport_t *v);
+
+void GL_BlendFunc(int blendfunc1, int blendfunc2);
+void GL_DepthMask(int state);
+void GL_DepthTest(int state);
+void GL_DepthRange(float nearfrac, float farfrac);
+void GL_PolygonOffset(float planeoffset, float depthoffset);
+void GL_CullFace(int state);
+void GL_AlphaTest(int state);
+void GL_ColorMask(int r, int g, int b, int a);