// we don't know until we try it!
cvar_t vid_hardwaregammasupported = {CVAR_READONLY,"vid_hardwaregammasupported","1", "indicates whether hardware gamma is supported (updated by attempts to set hardware gamma ramps)"};
+
+// VorteX: more info cvars, mostly set in VID_CheckExtensions
+cvar_t gl_info_vendor = {CVAR_READONLY, "gl_info_vendor", "", "indicates brand of graphics chip"};
+cvar_t gl_info_renderer = {CVAR_READONLY, "gl_info_renderer", "", "indicates graphics chip model and other information"};
+cvar_t gl_info_version = {CVAR_READONLY, "gl_info_version", "", "indicates version of current renderer. begins with 1.0.0, 1.1.0, 1.2.0, 1.3.1 etc."};
+cvar_t gl_info_extensions = {CVAR_READONLY, "gl_info_extensions", "", "indicates extension list found by engine, space separated."};
+cvar_t gl_info_platform = {CVAR_READONLY, "gl_info_platform", "", "indicates GL platform: WGL, GLX, or AGL."};
+cvar_t gl_info_driver = {CVAR_READONLY, "gl_info_driver", "", "name of driver library (opengl32.dll, libGL.so.1, or whatever)."};
+
// whether hardware gamma ramps are currently in effect
qboolean vid_usinghwgamma = false;
cvar_t vid_grabkeyboard = {CVAR_SAVE, "vid_grabkeyboard", "0", "whether to grab the keyboard when mouse is active (prevents use of volume control keys, music player keys, etc on some keyboards)"};
cvar_t vid_minwidth = {0, "vid_minwidth", "0", "minimum vid_width that is acceptable (to be set in default.cfg in mods)"};
cvar_t vid_minheight = {0, "vid_minheight", "0", "minimum vid_height that is acceptable (to be set in default.cfg in mods)"};
-cvar_t gl_combine = {0, "gl_combine", "1", "faster rendering by using GL_ARB_texture_env_combine extension (part of OpenGL 1.3 and above)"};
+cvar_t gl_combine = {0, "gl_combine", "1", "enables faster rendering using GL_ARB_texture_env_combine extension (part of OpenGL 1.3 and above)"};
cvar_t gl_finish = {0, "gl_finish", "0", "make the cpu wait for the graphics processor at the end of each rendered frame (can help with strange input or video lag problems on some machines)"};
cvar_t vid_stick_mouse = {CVAR_SAVE, "vid_stick_mouse", "0", "have the mouse stuck in the center of the screen" };
void (GLAPIENTRY *qglPixelStoref)(GLenum pname, GLfloat param);
void (GLAPIENTRY *qglPixelStorei)(GLenum pname, GLint param);
-void (GLAPIENTRY *qglTexImage1D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+//void (GLAPIENTRY *qglTexImage1D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
void (GLAPIENTRY *qglTexImage2D)(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-void (GLAPIENTRY *qglTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+//void (GLAPIENTRY *qglTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, 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 *qglCopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+//void (GLAPIENTRY *qglCopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
void (GLAPIENTRY *qglCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-void (GLAPIENTRY *qglCopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+//void (GLAPIENTRY *qglCopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
void (GLAPIENTRY *qglCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
void (GLAPIENTRY *qglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers);
void (GLAPIENTRY *qglGenFramebuffersEXT)(GLsizei n, GLuint *framebuffers);
GLenum (GLAPIENTRY *qglCheckFramebufferStatusEXT)(GLenum target);
-void (GLAPIENTRY *qglFramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+//void (GLAPIENTRY *qglFramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
void (GLAPIENTRY *qglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
void (GLAPIENTRY *qglFramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
void (GLAPIENTRY *qglFramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
void (GLAPIENTRY *qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data);
void (GLAPIENTRY *qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
-void (GLAPIENTRY *qglCompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
+//void (GLAPIENTRY *qglCompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data);
void (GLAPIENTRY *qglCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data);
void (GLAPIENTRY *qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
-void (GLAPIENTRY *qglCompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
+//void (GLAPIENTRY *qglCompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data);
void (GLAPIENTRY *qglGetCompressedTexImageARB)(GLenum target, GLint lod, void *img);
void (GLAPIENTRY *qglGenQueriesARB)(GLsizei n, GLuint *ids);
int failed = false;
const dllfunction_t *func;
struct { int major, minor; } min_version, curr_version;
+ char extstr[MAX_INPUTLINE];
int ext;
if(sscanf(minglver_or_ext, "%d.%d", &min_version.major, &min_version.minor) == 2)
// delay the return so it prints all missing functions
if (failed)
return false;
+ // VorteX: add to found extension list
+ dpsnprintf(extstr, sizeof(extstr), "%s %s ", gl_info_extensions.string, minglver_or_ext);
+ Cvar_SetQuick(&gl_info_extensions, extstr);
+
Con_DPrint("enabled\n");
return true;
}
// {"glPrioritizeTextures", (void **) &qglPrioritizeTextures},
// {"glAreTexturesResident", (void **) &qglAreTexturesResident},
{"glIsTexture", (void **) &qglIsTexture},
- {"glTexImage1D", (void **) &qglTexImage1D},
+// {"glTexImage1D", (void **) &qglTexImage1D},
{"glTexImage2D", (void **) &qglTexImage2D},
- {"glTexSubImage1D", (void **) &qglTexSubImage1D},
+// {"glTexSubImage1D", (void **) &qglTexSubImage1D},
{"glTexSubImage2D", (void **) &qglTexSubImage2D},
- {"glCopyTexImage1D", (void **) &qglCopyTexImage1D},
+// {"glCopyTexImage1D", (void **) &qglCopyTexImage1D},
{"glCopyTexImage2D", (void **) &qglCopyTexImage2D},
- {"glCopyTexSubImage1D", (void **) &qglCopyTexSubImage1D},
+// {"glCopyTexSubImage1D", (void **) &qglCopyTexSubImage1D},
{"glCopyTexSubImage2D", (void **) &qglCopyTexSubImage2D},
{"glScissor", (void **) &qglScissor},
{"glPolygonOffset", (void **) &qglPolygonOffset},
{"glDeleteFramebuffersEXT" , (void **) &qglDeleteFramebuffersEXT},
{"glGenFramebuffersEXT" , (void **) &qglGenFramebuffersEXT},
{"glCheckFramebufferStatusEXT" , (void **) &qglCheckFramebufferStatusEXT},
- {"glFramebufferTexture1DEXT" , (void **) &qglFramebufferTexture1DEXT},
+// {"glFramebufferTexture1DEXT" , (void **) &qglFramebufferTexture1DEXT},
{"glFramebufferTexture2DEXT" , (void **) &qglFramebufferTexture2DEXT},
{"glFramebufferTexture3DEXT" , (void **) &qglFramebufferTexture3DEXT},
{"glFramebufferRenderbufferEXT" , (void **) &qglFramebufferRenderbufferEXT},
{
{"glCompressedTexImage3DARB", (void **) &qglCompressedTexImage3DARB},
{"glCompressedTexImage2DARB", (void **) &qglCompressedTexImage2DARB},
- {"glCompressedTexImage1DARB", (void **) &qglCompressedTexImage1DARB},
+// {"glCompressedTexImage1DARB", (void **) &qglCompressedTexImage1DARB},
{"glCompressedTexSubImage3DARB", (void **) &qglCompressedTexSubImage3DARB},
{"glCompressedTexSubImage2DARB", (void **) &qglCompressedTexSubImage2DARB},
- {"glCompressedTexSubImage1DARB", (void **) &qglCompressedTexSubImage1DARB},
+// {"glCompressedTexSubImage1DARB", (void **) &qglCompressedTexSubImage1DARB},
{"glGetCompressedTexImageARB", (void **) &qglGetCompressedTexImageARB},
{NULL, NULL}
};
{
gl_stencil = vid_bitsperpixel.integer == 32;
+ // VorteX: reset extensions info cvar, it got filled by GL_CheckExtension
+ Cvar_SetQuick(&gl_info_extensions, "");
+
// reset all the gl extension variables here
// this should match the declarations
gl_max_texture_size = 0;
gl_support_amd_texture_texture4 = GL_CheckExtension("GL_AMD_texture_texture4", NULL, "-notexture4", false);
// COMMANDLINEOPTION: GL: -notexturegather disables GL_ARB_texture_gather (which provides fetch4 sampling)
gl_support_arb_texture_gather = GL_CheckExtension("GL_ARB_texture_gather", NULL, "-notexturegather", false);
+
+ // VorteX: set other info (maybe place them in VID_InitMode?)
+ Cvar_SetQuick(&gl_info_vendor, gl_vendor);
+ Cvar_SetQuick(&gl_info_renderer, gl_renderer);
+ Cvar_SetQuick(&gl_info_version, gl_version);
+ Cvar_SetQuick(&gl_info_platform, gl_platform ? gl_platform : "");
+ Cvar_SetQuick(&gl_info_driver, gl_driver ? gl_driver : "");
}
void Force_CenterView_f (void)
void VID_Shared_Init(void)
{
Cvar_RegisterVariable(&vid_hardwaregammasupported);
+ Cvar_RegisterVariable(&gl_info_vendor);
+ Cvar_RegisterVariable(&gl_info_renderer);
+ Cvar_RegisterVariable(&gl_info_version);
+ Cvar_RegisterVariable(&gl_info_extensions);
+ Cvar_RegisterVariable(&gl_info_platform);
+ Cvar_RegisterVariable(&gl_info_driver);
Cvar_RegisterVariable(&v_gamma);
Cvar_RegisterVariable(&v_brightness);
Cvar_RegisterVariable(&v_contrastboost);