#include "quakedef.h"
+// global video state
+viddef_t vid;
+
// LordHavoc: these are only set in wgl
qboolean isG200 = false; // LordHavoc: the Matrox G200 can't do per pixel alpha, and it uses a D3D driver for GL... ugh...
qboolean isRagePro = false; // LordHavoc: the ATI Rage Pro has limitations with per pixel alpha (the color scaler does not apply to per pixel alpha images...), although not as bad as a G200.
// LordHavoc: GL_ARB_multitexture support
-int gl_textureunits;
+int gl_textureunits = 0;
// LordHavoc: GL_ARB_texture_env_combine or GL_EXT_texture_env_combine support
int gl_combine_extension = false;
// LordHavoc: GL_EXT_compiled_vertex_array support
cvar_t vid_fullscreen = {0, "vid_fullscreen", "1"};
cvar_t vid_width = {0, "vid_width", "640"};
cvar_t vid_height = {0, "vid_height", "480"};
-cvar_t vid_bitsperpixel = {0, "vid_bitsperpixel", "15"};
+cvar_t vid_bitsperpixel = {0, "vid_bitsperpixel", "16"};
cvar_t vid_mouse = {CVAR_SAVE, "vid_mouse", "1"};
cvar_t gl_combine = {0, "gl_combine", "1"};
void (GLAPIENTRY *qglTexImage2D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
void (GLAPIENTRY *qglTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
void (GLAPIENTRY *qglDeleteTextures)(GLsizei n, const GLuint *textures);
+void (GLAPIENTRY *qglPixelStoref)(GLenum pname, GLfloat param);
+void (GLAPIENTRY *qglPixelStorei)(GLenum pname, GLint param);
void (GLAPIENTRY *qglDrawRangeElementsEXT)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
{"glTexImage2D", (void **) &qglTexImage2D},
{"glTexSubImage2D", (void **) &qglTexSubImage2D},
{"glDeleteTextures", (void **) &qglDeleteTextures},
+ {"glPixelStoref", (void **) &qglPixelStoref},
+ {"glPixelStorei", (void **) &qglPixelStorei},
{NULL, NULL}
};
qglDrawRangeElements = qglDrawRangeElementsEXT;
}
-double VID_CompareMode(int width1, int height1, int bpp1, int width2, int height2, int bpp2)
-{
- double dw, dh, db;
- dw = ((width2 - width1) / 2048) * 16;
- dh = ((height2 - height1) / 1536) * 4;
- db = (bpp2 - bpp1) / 32;
- return dw * dw + dh * dh + db * db;
-}
-
void Force_CenterView_f (void)
{
cl.viewangles[PITCH] = 0;
Cvar_SetQuick(&vid_bitsperpixel, com_argv[i+1]);
}
+extern int VID_InitMode (int fullscreen, int width, int height, int bpp);
+int VID_Mode(int fullscreen, int width, int height, int bpp)
+{
+ if (fullscreen)
+ Con_Printf("Video: %dx%dx%d fullscreen\n", width, height, bpp);
+ else
+ Con_Printf("Video: %dx%d windowed\n", width, height);
+ if (VID_InitMode(fullscreen, width, height, bpp))
+ return true;
+ else
+ return false;
+}