]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_shared.c
start of "dpdefs", QC files that define all current DP features
[xonotic/darkplaces.git] / vid_shared.c
index d4da46941760a3c7dce2ddc6569acf96f2b76644..eb6c56d47acbd0aa5d099c70a1a2cbb268f92e57 100644 (file)
@@ -110,10 +110,6 @@ void (GLAPIENTRY *qglMultiTexCoord4f) (GLenum, GLfloat, GLfloat, GLfloat, GLfloa
 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);
@@ -151,12 +147,14 @@ void (GLAPIENTRY *qglColorMask)(GLboolean red, GLboolean green, GLboolean blue,
 
 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);
@@ -164,6 +162,7 @@ void (GLAPIENTRY *qglTexCoord3f)(GLfloat s, GLfloat t, GLfloat r);
 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);
 
@@ -198,6 +197,11 @@ void (GLAPIENTRY *qglTexEnvi)(GLenum target, GLenum pname, GLint param);
 void (GLAPIENTRY *qglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
 void (GLAPIENTRY *qglTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
 void (GLAPIENTRY *qglTexParameteri)(GLenum target, GLenum pname, GLint param);
+void (GLAPIENTRY *qglGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
+void (GLAPIENTRY *qglGetTexParameteriv)(GLenum target, GLenum pname, GLint *params);
+void (GLAPIENTRY *qglGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
+void (GLAPIENTRY *qglGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
+void (GLAPIENTRY *qglGetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
 void (GLAPIENTRY *qglHint)(GLenum target, GLenum mode);
 
 void (GLAPIENTRY *qglGenTextures)(GLsizei n, GLuint *textures);
@@ -487,12 +491,14 @@ static dllfunction_t opengl110funcs[] =
        {"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},
@@ -500,6 +506,7 @@ static dllfunction_t opengl110funcs[] =
        {"glTexCoord4f", (void **) &qglTexCoord4f},
        {"glVertex2f", (void **) &qglVertex2f},
        {"glVertex3f", (void **) &qglVertex3f},
+       {"glVertex4f", (void **) &qglVertex4f},
        {"glBegin", (void **) &qglBegin},
        {"glEnd", (void **) &qglEnd},
 //[515]: added on 29.07.2005
@@ -534,6 +541,11 @@ static dllfunction_t opengl110funcs[] =
        {"glTexParameterf", (void **) &qglTexParameterf},
        {"glTexParameterfv", (void **) &qglTexParameterfv},
        {"glTexParameteri", (void **) &qglTexParameteri},
+       {"glGetTexImage", (void **) &qglGetTexImage},
+       {"glGetTexParameterfv", (void **) &qglGetTexParameterfv},
+       {"glGetTexParameteriv", (void **) &qglGetTexParameteriv},
+       {"glGetTexLevelParameterfv", (void **) &qglGetTexLevelParameterfv},
+       {"glGetTexLevelParameteriv", (void **) &qglGetTexLevelParameteriv},
        {"glHint", (void **) &qglHint},
 //     {"glPixelStoref", (void **) &qglPixelStoref},
        {"glPixelStorei", (void **) &qglPixelStorei},
@@ -583,13 +595,6 @@ static dllfunction_t multitexturefuncs[] =
        {NULL, NULL}
 };
 
-static dllfunction_t compiledvertexarrayfuncs[] =
-{
-       {"glLockArraysEXT", (void **) &qglLockArraysEXT},
-       {"glUnlockArraysEXT", (void **) &qglUnlockArraysEXT},
-       {NULL, NULL}
-};
-
 static dllfunction_t texture3dextfuncs[] =
 {
        {"glTexImage3DEXT", (void **) &qglTexImage3D},
@@ -799,6 +804,7 @@ void VID_CheckExtensions(void)
 
        Con_DPrint("Checking OpenGL extensions...\n");
 
+       vid.forcevbo = false;
        vid.support.amd_texture_texture4 = GL_CheckExtension("GL_AMD_texture_texture4", NULL, "-notexture4", false);
        vid.support.arb_depth_texture = GL_CheckExtension("GL_ARB_depth_texture", NULL, "-nodepthtexture", false);
        vid.support.arb_draw_buffers = GL_CheckExtension("GL_ARB_draw_buffers", drawbuffersfuncs, "-nodrawbuffers", false);
@@ -819,11 +825,11 @@ void VID_CheckExtensions(void)
        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);
        vid.support.ext_texture_3d = GL_CheckExtension("GL_EXT_texture3D", texture3dextfuncs, "-notexture3d", false);
+       vid.support.ext_texture_compression_s3tc = GL_CheckExtension("GL_EXT_texture_compression_s3tc", NULL, "-nos3tc", false);
        vid.support.ext_texture_edge_clamp = GL_CheckExtension("GL_EXT_texture_edge_clamp", NULL, "-noedgeclamp", false) || GL_CheckExtension("GL_SGIS_texture_edge_clamp", NULL, "-noedgeclamp", false);
        vid.support.ext_texture_filter_anisotropic = GL_CheckExtension("GL_EXT_texture_filter_anisotropic", NULL, "-noanisotropy", false);
 // COMMANDLINEOPTION: GL: -noanisotropy disables GL_EXT_texture_filter_anisotropic (allows higher quality texturing)
@@ -831,7 +837,6 @@ void VID_CheckExtensions(void)
 // 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)
@@ -841,6 +846,7 @@ void VID_CheckExtensions(void)
 // COMMANDLINEOPTION: GL: -nomtex disables GL_ARB_multitexture (required for faster map rendering)
 // COMMANDLINEOPTION: GL: -noocclusionquery disables GL_ARB_occlusion_query (which allows coronas to fade according to visibility, and potentially used for rendering optimizations)
 // COMMANDLINEOPTION: GL: -norectangle disables GL_ARB_texture_rectangle (required for bumpmapping)
+// COMMANDLINEOPTION: GL: -nos3tc disables GL_EXT_texture_compression_s3tc (which allows use of .dds texture caching)
 // COMMANDLINEOPTION: GL: -noseparatestencil disables use of OpenGL2.0 glStencilOpSeparate and GL_ATI_separate_stencil extensions (which accelerate shadow rendering)
 // COMMANDLINEOPTION: GL: -noshaderobjects disables GL_ARB_shader_objects (required for vertex shader and fragment shader)
 // COMMANDLINEOPTION: GL: -noshadinglanguage100 disables GL_ARB_shading_language_100 (required for vertex shader and fragment shader)