+ qglGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*)&vid.maxtexturesize_2d);
+ if (vid.support.ext_texture_filter_anisotropic)
+ qglGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, (GLint*)&vid.max_anisotropy);
+ if (vid.support.arb_texture_cube_map)
+ qglGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB, (GLint*)&vid.maxtexturesize_cubemap);
+ if (vid.support.arb_texture_rectangle)
+ qglGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB, (GLint*)&vid.maxtexturesize_rectangle);
+ if (vid.support.ext_texture_3d)
+ qglGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, (GLint*)&vid.maxtexturesize_3d);
+
+ // verify that 3d textures are really supported
+ if (vid.support.ext_texture_3d && vid.maxtexturesize_3d < 32)
+ {
+ vid.support.ext_texture_3d = false;
+ Con_Printf("GL_EXT_texture3D reported bogus GL_MAX_3D_TEXTURE_SIZE, disabled\n");
+ }
+
+ vid.texunits = vid.teximageunits = vid.texarrayunits = 1;
+ if (vid.support.arb_fragment_shader && vid_gl20.integer)
+ {
+ qglGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&vid.texunits);
+ qglGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, (int *)&vid.teximageunits);CHECKGLERROR
+ qglGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, (int *)&vid.texarrayunits);CHECKGLERROR
+ vid.texunits = bound(4, vid.texunits, MAX_TEXTUREUNITS);
+ vid.teximageunits = bound(16, vid.teximageunits, MAX_TEXTUREUNITS);
+ vid.texarrayunits = bound(8, vid.texarrayunits, MAX_TEXTUREUNITS);
+ Con_DPrintf("Using GL2.0 rendering path - %i texture matrix, %i texture images, %i texcoords%s\n", vid.texunits, vid.teximageunits, vid.texarrayunits, vid.support.ext_framebuffer_object ? ", shadowmapping supported" : "");
+ vid.renderpath = RENDERPATH_GL20;
+ }
+ else if (vid.support.arb_texture_env_combine && vid.texunits >= 2 && vid_gl13.integer)
+ {
+ qglGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&vid.texunits);
+ vid.texunits = bound(1, vid.texunits, MAX_TEXTUREUNITS);
+ vid.teximageunits = vid.texunits;
+ vid.texarrayunits = vid.texunits;
+ Con_DPrintf("Using GL1.3 rendering path - %i texture units, single pass rendering\n", vid.texunits);
+ vid.renderpath = RENDERPATH_GL13;
+ }
+ else
+ {
+ if (vid.support.arb_multitexture)
+ qglGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, (GLint*)&vid.texunits);
+ vid.texunits = bound(1, vid.texunits, MAX_TEXTUREUNITS);
+ vid.teximageunits = vid.texunits;
+ vid.texarrayunits = vid.texunits;
+ Con_DPrintf("Using GL1.1 rendering path - %i texture units, two pass rendering\n", vid.texunits);
+ vid.renderpath = RENDERPATH_GL11;
+ }
+
+ gl_max_texture_size = vid.maxtexturesize_2d;
+ gl_max_3d_texture_size = vid.maxtexturesize_3d;
+ gl_max_cube_map_texture_size = vid.maxtexturesize_cubemap;
+ gl_textureunits = vid.texunits;
+ gl_max_anisotropy = vid.max_anisotropy;
+
+ gl_combine_extension = vid.support.arb_texture_env_combine;
+ gl_supportslockarrays = vid.support.ext_compiled_vertex_array;
+ gl_texture3d = vid.support.ext_texture_3d;
+ gl_texturecubemap = vid.support.arb_texture_cube_map;
+ gl_texturerectangle = vid.support.arb_texture_rectangle;
+ gl_support_arb_texture_non_power_of_two = vid.support.arb_texture_non_power_of_two;
+ gl_dot3arb = vid.support.arb_texture_env_dot3;
+ gl_depthtexture = vid.support.arb_depth_texture;
+ gl_support_arb_shadow = vid.support.arb_shadow;
+ gl_support_clamptoedge = vid.support.ext_texture_edge_clamp;
+ gl_support_anisotropy = vid.support.ext_texture_filter_anisotropic;
+ gl_support_separatestencil = vid.support.ati_separate_stencil;
+ gl_support_stenciltwoside = vid.support.ext_stencil_two_side;
+ gl_support_ext_blend_minmax = vid.support.ext_blend_minmax;
+ gl_support_ext_blend_subtract = vid.support.ext_blend_subtract;
+ gl_support_shader_objects = vid.support.arb_shader_objects;
+ gl_support_shading_language_100 = vid.support.arb_shading_language_100;
+ gl_support_vertex_shader = vid.support.arb_vertex_shader;
+ gl_support_fragment_shader = vid.support.arb_fragment_shader;
+ gl_support_arb_vertex_buffer_object = vid.support.arb_vertex_buffer_object;
+ gl_support_ext_framebuffer_object = vid.support.ext_framebuffer_object;
+ gl_support_texture_compression = vid.support.arb_texture_compression;
+ gl_support_arb_occlusion_query = vid.support.arb_occlusion_query;
+ gl_support_amd_texture_texture4 = vid.support.amd_texture_texture4;
+ gl_support_arb_texture_gather = vid.support.arb_texture_gather;
+
+ // 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);