static textypeinfo_t textype_rgba = {TEXTYPE_RGBA , 4, 4, GL_RGBA , 3};
static textypeinfo_t textype_palette_alpha = {TEXTYPE_PALETTE, 1, 4, GL_RGBA , 4};
static textypeinfo_t textype_rgba_alpha = {TEXTYPE_RGBA , 4, 4, GL_RGBA , 4};
-static textypeinfo_t textype_dsdt = {TEXTYPE_DSDT , 2, 2, GL_DSDT_NV, GL_DSDT8_NV};
#define GLTEXTURETYPE_1D 0
#define GLTEXTURETYPE_2D 1
return &textype_rgb;
case TEXTYPE_RGBA:
return &textype_rgba;
- case TEXTYPE_DSDT:
- return &textype_dsdt;
default:
Host_Error("R_GetTexTypeInfo: unknown texture format");
return NULL;
}
}
break;
- case TEXTYPE_DSDT:
- break;
default:
Host_Error("R_LoadTexture: unknown texture type");
}
void *GL_GetProcAddress(const char *name);
int GL_CheckExtension(const char *name, const dllfunction_t *funcs, const char *disableparm, int silent);
-// this attempts to use vendor extensions to allocate faster vertex memory if
-// the fast parameter is true, if unsuccessful it uses Mem_Alloc instead
-void *VID_AllocVertexArrays(mempool_t *pool, int size, int fast, float readfrequency, float writefrequency, float priority);
-void VID_FreeVertexArrays(void *pointer);
-
void VID_Shared_Init(void);
void GL_Init (void);
// GL_EXT_texture_filter_anisotropic
int gl_support_anisotropy = false;
int gl_max_anisotropy = 1;
-// GL_NV_texture_shader
-int gl_textureshader = false;
// GL_EXT_stencil_two_side
int gl_support_stenciltwoside = false;
// GL_ARB_shader_objects
void (GLAPIENTRY *qglLockArraysEXT) (GLint first, GLint count);
void (GLAPIENTRY *qglUnlockArraysEXT) (void);
-//GL_NV_vertex_array_range
-GLvoid *(GLAPIENTRY *qglAllocateMemoryNV)(GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
-GLvoid (GLAPIENTRY *qglFreeMemoryNV)(GLvoid *pointer);
-GLvoid (GLAPIENTRY *qglVertexArrayRangeNV)(GLsizei length, GLvoid *pointer);
-GLvoid (GLAPIENTRY *qglFlushVertexArrayRangeNV)(GLvoid);
-
// general GL functions
void (GLAPIENTRY *qglClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
gl_support_clamptoedge = false;
gl_support_anisotropy = false;
gl_max_anisotropy = 1;
- gl_textureshader = false;
gl_support_stenciltwoside = false;
gl_support_shader_objects = false;
gl_support_shading_language_100 = false;
if ((gl_support_anisotropy = GL_CheckExtension("GL_EXT_texture_filter_anisotropic", NULL, "-noanisotropy", false)))
qglGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl_max_anisotropy);
-// COMMANDLINEOPTION: GL: -notextureshader disables GL_NV_texture_shader (required for the Geforce3 water shader, NVIDIA only)
- gl_textureshader = GL_CheckExtension("GL_NV_texture_shader", NULL, "-notextureshader", false);
-
// COMMANDLINEOPTION: GL: -nostenciltwoside disables GL_EXT_stencil_two_side (accelerates shadow rendering)
gl_support_stenciltwoside = GL_CheckExtension("GL_EXT_stencil_two_side", stenciltwosidefuncs, "-nostenciltwoside", false);
gl_support_half_float = GL_CheckExtension("GL_NV_half_float", NULL, "-nohalffloat", false);
}
-qboolean vid_vertexarrays_are_var = false;
-void *VID_AllocVertexArrays(mempool_t *pool, int size, int fast, float readfrequency, float writefrequency, float priority)
-{
- void *m;
- vid_vertexarrays_are_var = false;
- if (fast && qglAllocateMemoryNV)
- {
- CHECKGLERROR
- m = qglAllocateMemoryNV(size, readfrequency, writefrequency, priority);
- CHECKGLERROR
- if (m)
- {
- vid_vertexarrays_are_var = true;
- return m;
- }
- }
- return Mem_Alloc(pool, size);
-}
-
-void VID_FreeVertexArrays(void *pointer)
-{
- if (vid_vertexarrays_are_var)
- {
- CHECKGLERROR
- qglFreeMemoryNV(pointer);
- CHECKGLERROR
- }
- else
- Mem_Free(pointer);
- vid_vertexarrays_are_var = false;
-}
-
void Force_CenterView_f (void)
{
cl.viewangles[PITCH] = 0;