void (GLAPIENTRY *qglActiveTexture) (GLenum);
void (GLAPIENTRY *qglClientActiveTexture) (GLenum);
-// GL_EXT_compiled_vertex_array
-void (GLAPIENTRY *qglLockArraysEXT) (GLint first, GLint count);
-void (GLAPIENTRY *qglUnlockArraysEXT) (void);
-
// general GL functions
void (GLAPIENTRY *qglClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
void (GLAPIENTRY *qglDrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
void (GLAPIENTRY *qglDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
+void (GLAPIENTRY *qglDrawArrays)(GLenum mode, GLint first, GLsizei count);
void (GLAPIENTRY *qglVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
void (GLAPIENTRY *qglNormalPointer)(GLenum type, GLsizei stride, const GLvoid *ptr);
void (GLAPIENTRY *qglColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
void (GLAPIENTRY *qglTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr);
void (GLAPIENTRY *qglArrayElement)(GLint i);
+void (GLAPIENTRY *qglColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
void (GLAPIENTRY *qglColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
void (GLAPIENTRY *qglTexCoord1f)(GLfloat s);
void (GLAPIENTRY *qglTexCoord2f)(GLfloat s, GLfloat t);
void (GLAPIENTRY *qglTexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
void (GLAPIENTRY *qglVertex2f)(GLfloat x, GLfloat y);
void (GLAPIENTRY *qglVertex3f)(GLfloat x, GLfloat y, GLfloat z);
+void (GLAPIENTRY *qglVertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void (GLAPIENTRY *qglBegin)(GLenum mode);
void (GLAPIENTRY *qglEnd)(void);
#define sscanf sscanf_s
#endif
-int GL_CheckExtension(const char *minglver_or_ext, const dllfunction_t *funcs, const char *disableparm, int silent)
+qboolean GL_CheckExtension(const char *minglver_or_ext, const dllfunction_t *funcs, const char *disableparm, int silent)
{
int failed = false;
const dllfunction_t *func;
{"glDepthMask", (void **) &qglDepthMask},
{"glDepthRange", (void **) &qglDepthRange},
{"glDrawElements", (void **) &qglDrawElements},
+ {"glDrawArrays", (void **) &qglDrawArrays},
{"glColorMask", (void **) &qglColorMask},
{"glVertexPointer", (void **) &qglVertexPointer},
{"glNormalPointer", (void **) &qglNormalPointer},
{"glColorPointer", (void **) &qglColorPointer},
{"glTexCoordPointer", (void **) &qglTexCoordPointer},
{"glArrayElement", (void **) &qglArrayElement},
+ {"glColor4ub", (void **) &qglColor4ub},
{"glColor4f", (void **) &qglColor4f},
{"glTexCoord1f", (void **) &qglTexCoord1f},
{"glTexCoord2f", (void **) &qglTexCoord2f},
{"glTexCoord4f", (void **) &qglTexCoord4f},
{"glVertex2f", (void **) &qglVertex2f},
{"glVertex3f", (void **) &qglVertex3f},
+ {"glVertex4f", (void **) &qglVertex4f},
{"glBegin", (void **) &qglBegin},
{"glEnd", (void **) &qglEnd},
//[515]: added on 29.07.2005
{NULL, NULL}
};
-static dllfunction_t compiledvertexarrayfuncs[] =
-{
- {"glLockArraysEXT", (void **) &qglLockArraysEXT},
- {"glUnlockArraysEXT", (void **) &qglUnlockArraysEXT},
- {NULL, NULL}
-};
-
static dllfunction_t texture3dextfuncs[] =
{
{"glTexImage3DEXT", (void **) &qglTexImage3D},
{NULL, NULL}
};
-void VID_CheckExtensions(void)
+void VID_ClearExtensions(void)
{
+ // VorteX: reset extensions info cvar, it got filled by GL_CheckExtension
+ Cvar_SetQuick(&gl_info_extensions, "");
+
// clear the extension flags
memset(&vid.support, 0, sizeof(vid.support));
+ vid.renderpath = RENDERPATH_GL11;
+ vid.forcevbo = false;
+ vid.maxtexturesize_2d = 0;
+ vid.maxtexturesize_3d = 0;
+ vid.maxtexturesize_cubemap = 0;
+ vid.texunits = 1;
+ vid.teximageunits = 1;
+ vid.texarrayunits = 1;
+ vid.max_anisotropy = 1;
+ vid.maxdrawbuffers = 1;
- // VorteX: reset extensions info cvar, it got filled by GL_CheckExtension
- Cvar_SetQuick(&gl_info_extensions, "");
+ // this is a complete list of all functions that are directly checked in the renderer
+ qglDrawRangeElements = NULL;
+ qglDrawBuffer = NULL;
+ qglPolygonStipple = NULL;
+ qglFlush = NULL;
+ qglActiveTexture = NULL;
+ qglGetCompressedTexImageARB = NULL;
+ qglFramebufferTexture2DEXT = NULL;
+ qglDrawBuffersARB = NULL;
+}
+
+void VID_CheckExtensions(void)
+{
if (!GL_CheckExtension("1.1", opengl110funcs, NULL, false))
Sys_Error("OpenGL 1.1.0 functions not found");
vid.support.ati_separate_stencil = GL_CheckExtension("2.0", gl2separatestencilfuncs, "-noseparatestencil", true) || GL_CheckExtension("GL_ATI_separate_stencil", atiseparatestencilfuncs, "-noseparatestencil", false);
vid.support.ext_blend_minmax = GL_CheckExtension("GL_EXT_blend_minmax", blendequationfuncs, "-noblendminmax", false);
vid.support.ext_blend_subtract = GL_CheckExtension("GL_EXT_blend_subtract", blendequationfuncs, "-noblendsubtract", false);
- vid.support.ext_compiled_vertex_array = GL_CheckExtension("GL_EXT_compiled_vertex_array", compiledvertexarrayfuncs, "-nocva", false);
vid.support.ext_draw_range_elements = GL_CheckExtension("1.2", drawrangeelementsfuncs, "-nodrawrangeelements", true) || GL_CheckExtension("GL_EXT_draw_range_elements", drawrangeelementsextfuncs, "-nodrawrangeelements", false);
vid.support.ext_framebuffer_object = GL_CheckExtension("GL_EXT_framebuffer_object", fbofuncs, "-nofbo", false);
vid.support.ext_stencil_two_side = GL_CheckExtension("GL_EXT_stencil_two_side", stenciltwosidefuncs, "-nostenciltwoside", false);
// COMMANDLINEOPTION: GL: -noblendsubtract disables GL_EXT_blend_subtract
// COMMANDLINEOPTION: GL: -nocombine disables GL_ARB_texture_env_combine or GL_EXT_texture_env_combine (required for bumpmapping and faster map rendering)
// COMMANDLINEOPTION: GL: -nocubemap disables GL_ARB_texture_cube_map (required for bumpmapping)
-// COMMANDLINEOPTION: GL: -nocva disables GL_EXT_compiled_vertex_array (renders faster)
// COMMANDLINEOPTION: GL: -nodepthtexture disables use of GL_ARB_depth_texture (required for shadowmapping)
// COMMANDLINEOPTION: GL: -nodrawbuffers disables use of GL_ARB_draw_buffers (required for r_shadow_deferredprepass)
// COMMANDLINEOPTION: GL: -nodrawrangeelements disables GL_EXT_draw_range_elements (renders faster)
// COMMANDLINEOPTION: GL: -novbo disables GL_ARB_vertex_buffer_object (which accelerates rendering)
// COMMANDLINEOPTION: GL: -novertexshader disables GL_ARB_vertex_shader (allows vertex shader effects)
- vid.maxtexturesize_2d = 0;
- vid.maxtexturesize_3d = 0;
- vid.maxtexturesize_cubemap = 0;
- vid.texunits = 1;
- vid.teximageunits = 1;
- vid.texarrayunits = 1;
- vid.max_anisotropy = 1;
- vid.maxdrawbuffers = 1;
-
if (vid.support.arb_draw_buffers)
qglGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, (GLint*)&vid.maxdrawbuffers);
{
case RENDERPATH_GL20:
case RENDERPATH_CGGL:
+ case RENDERPATH_D3D9:
+ case RENDERPATH_D3D10:
+ case RENDERPATH_D3D11:
if (v_glslgamma.integer)
wantgamma = 0;
break;
{
viddef_mode_t mode;
memset(&mode, 0, sizeof(mode));
- mode.fullscreen = fullscreen;
+ mode.fullscreen = fullscreen != 0;
mode.width = width;
mode.height = height;
mode.bitsperpixel = bpp;
mode.refreshrate = vid_userefreshrate.integer ? max(1, refreshrate) : 0;
- mode.userefreshrate = vid_userefreshrate.integer;
- mode.stereobuffer = stereobuffer;
+ mode.userefreshrate = vid_userefreshrate.integer != 0;
+ mode.stereobuffer = stereobuffer != 0;
mode.samples = samples;
cl_ignoremousemoves = 2;
+ VID_ClearExtensions();
if (VID_InitMode(&mode))
{
// accept the (possibly modified) mode