// AK where should it be placed ?
float in_mouse_x, in_mouse_y;
+// value of GL_MAX_TEXTURE_<various>_SIZE
+int gl_max_texture_size = 0;
+int gl_max_3d_texture_size = 0;
+int gl_max_cube_map_texture_size = 0;
// GL_ARB_multitexture
int gl_textureunits = 1;
// GL_ARB_texture_env_combine or GL_EXT_texture_env_combine
int gl_support_vertex_shader = false;
// GL_ARB_fragment_shader
int gl_support_fragment_shader = false;
+// GL_NV_half_float
+int gl_support_half_float = false;
// LordHavoc: if window is hidden, don't update screen
qboolean vid_hidden = true;
// reset all the gl extension variables here
// this should match the declarations
+ gl_max_texture_size = 0;
+ gl_max_3d_texture_size = 0;
+ gl_max_cube_map_texture_size = 0;
gl_textureunits = 1;
gl_combine_extension = false;
gl_supportslockarrays = false;
gl_support_fragment_shader = false;
if (!GL_CheckExtension("OpenGL 1.1.0", opengl110funcs, NULL, false))
- Sys_Error("OpenGL 1.1.0 functions not found\n");
+ Sys_Error("OpenGL 1.1.0 functions not found");
Con_Printf("GL_VENDOR: %s\n", gl_vendor);
Con_Printf("GL_RENDERER: %s\n", gl_renderer);
Con_Printf("GL_EXTENSIONS: %s\n", gl_extensions);
Con_Printf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
+ qglGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max_texture_size);
+
Con_Print("Checking OpenGL extensions...\n");
// COMMANDLINEOPTION: GL: -nodrawrangeelements disables GL_EXT_draw_range_elements (renders faster)
}
// COMMANDLINEOPTION: GL: -notexture3d disables GL_EXT_texture3D (required for spherical lights, otherwise they render as a column)
- gl_texture3d = GL_CheckExtension("GL_EXT_texture3D", texture3dextfuncs, "-notexture3d", false);
+ if ((gl_texture3d = GL_CheckExtension("GL_EXT_texture3D", texture3dextfuncs, "-notexture3d", false)))
+ qglGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &gl_max_3d_texture_size);
// COMMANDLINEOPTION: GL: -nocubemap disables GL_ARB_texture_cube_map (required for bumpmapping)
- gl_texturecubemap = GL_CheckExtension("GL_ARB_texture_cube_map", NULL, "-nocubemap", false);
+ if ((gl_texturecubemap = GL_CheckExtension("GL_ARB_texture_cube_map", NULL, "-nocubemap", false)))
+ qglGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB, &gl_max_cube_map_texture_size);
// COMMANDLINEOPTION: GL: -nocva disables GL_EXT_compiled_vertex_array (renders faster)
gl_supportslockarrays = GL_CheckExtension("GL_EXT_compiled_vertex_array", compiledvertexarrayfuncs, "-nocva", false);
// COMMANDLINEOPTION: GL: -noedgeclamp disables GL_EXT_texture_edge_clamp or GL_SGIS_texture_edge_clamp (recommended, some cards do not support the other texture clamp method)
// 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)
-// COMMANDLINEOPTION: GL: -novertexshader disables GL_ARB_vertex_shader (currently unused, allows vertex shader effects)
-// COMMANDLINEOPTION: GL: -nofragmentshader disables GL_ARB_fragment_shader (currently unused, allows pixel shader effects)
+// COMMANDLINEOPTION: GL: -novertexshader disables GL_ARB_vertex_shader (allows vertex shader effects)
+// COMMANDLINEOPTION: GL: -nofragmentshader disables GL_ARB_fragment_shader (allows pixel shader effects, can improve per pixel lighting performance and capabilities)
if ((gl_support_shader_objects = GL_CheckExtension("GL_ARB_shader_objects", shaderobjectsfuncs, "-noshaderobjects", false)))
if ((gl_support_shading_language_100 = GL_CheckExtension("GL_ARB_shading_language_100", NULL, "-noshadinglanguage100", false)))
if ((gl_support_vertex_shader = GL_CheckExtension("GL_ARB_vertex_shader", vertexshaderfuncs, "-novertexshader", false)))
gl_support_fragment_shader = GL_CheckExtension("GL_ARB_fragment_shader", NULL, "-nofragmentshader", false);
+
+// COMMANDLINEOPTION: GL: -nohalffloat disables GL_NV_half_float extension
+ gl_support_half_float = GL_CheckExtension("GL_NV_half_float", NULL, "-nohalffloat", false);
}
qboolean vid_vertexarrays_are_var = false;
{
Con_Print("Video mode change failed\n");
if (!VID_Mode(vid.fullscreen, vid.width, vid.height, vid.bitsperpixel))
- Sys_Error("Unable to restore to last working video mode\n");
+ Sys_Error("Unable to restore to last working video mode");
}
VID_OpenSystems();
}
if (!success && vid_fullscreen.integer)
success = VID_Mode(false, 640, 480, 16);
if (!success)
- Sys_Error("Video modes failed\n");
+ Sys_Error("Video modes failed");
}
VID_OpenSystems();
}