View previous topic :: View next topic |
Author |
Message |
Baker

Joined: 14 Mar 2006 Posts: 1538
|
Posted: Mon Dec 08, 2008 9:53 pm Post subject: |
|
|
reckless wrote: | hmm ok.
i compiled it with msvc 2008 it might need the NET runtimes.
one way to get some debug info from it is to start it with Realm.exe -condebug it will create a log with where in the code it crashes could you try that ? |
Alright, with -condebug here is the log. It doesn't get far:
Quote: | Console initialized.
Winsock TCP/IP Initialized
WIPX_Init: Unable to open control socket
Exe: 17:46:16 Dec 8 2008
64.0 megabyte heap
GL_VENDOR: Intel
GL_RENDERER: Intel Brookdale-G
GL_VERSION: 1.30
WARNING
GL_VERSION 1.300000 detected - you may experience reduced functionality
Buffers
Color: 24 Bits
Depth: 24 Bits
Stencil: 8 Bits |
Is downloading and trying with the VC++ 2008 runtime libraries (this is what I used)
And with that installed, I get no further ...
Quote: | Console initialized.
Winsock TCP/IP Initialized
WIPX_Init: Unable to open control socket
Exe: 17:46:16 Dec 8 2008
64.0 megabyte heap
GL_VENDOR: Intel
GL_RENDERER: Intel Brookdale-G
GL_VERSION: 1.30
WARNING
GL_VERSION 1.300000 detected - you may experience reduced functionality
Buffers
Color: 24 Bits
Depth: 24 Bits
Stencil: 8 Bits |
|
|
Back to top |
|
 |
reckless
Joined: 24 Jan 2008 Posts: 390 Location: inside tha debugger
|
Posted: Tue Dec 09, 2008 5:52 am Post subject: |
|
|
Quote: | GL_VERSION 1.300000 detected - you may experience reduced functionality |
ouch seems anything below 1.4 is pretty much a no go.
wonder if its the check for fragment and vertex shaders i put in it ?
i think those require 1.4 if im not mistaken. any ideas mh ?.
Code: | //====================================
gl_caps_s GLCaps;
static char *VendorCode[10] = {"ARB", "EXT", "NV", "ATI", "SGI", "SGIS", "SGIX", "INTEL", "3DFX", NULL};
/*
==================
GL EXTENSION MALARKEY
As a general rule, I don't like the idea of proprietary extensions. A special case of this rule is that
anything which allows me to rub ATI's nose in it must necessarily be a good thing :D
This will check vendor codes for extensions too...
==================
*/
qboolean GL_CheckExtension (char *ExtensionName, qboolean crash, qboolean silent)
{
int i;
// let us specify extensions directly
if (ExtensionName[0] == 'G' && ExtensionName[1] == 'L' && ExtensionName[2] == '_')
{
// allow direct access to the extension name
if (strstr (GL_State.gl_extensions, ExtensionName))
{
if (!silent)
{
Con_Printf ("Found Extension %s.\n", ExtensionName);
}
return true;
}
if (crash)
{
Sys_Error ("Extension %s NOT Found!!!\n\nAborting Realm...", ExtensionName);
}
if (!silent)
{
Con_Printf ("Extension %s NOT Found.\n", ExtensionName);
}
return false;
}
// use the fallback mechanism
for (i = 0; ; i++)
{
if (strstr (GL_State.gl_extensions, va ("GL_%s_%s", VendorCode[i], ExtensionName)))
{
if (!silent)
{
Con_Printf ("Found Extension GL_%s_%s.\n", VendorCode[i], ExtensionName);
}
return true;
}
}
if (crash)
{
Sys_Error ("Extension GL_*_%s NOT Found!!!\n\nAborting Realm...", ExtensionName);
}
if (!silent)
{
Con_Printf ("Extension GL_*_%s NOT Found.\n", ExtensionName);
}
return false;
}
/*
================
MHGLGetProcAddress
Implements a work-around for earlier OpenGL versions, by checking for extensions that
support the required functions. I'm VERY DISPLEASED at having to do this (you don't
cut down the Mona Lisa to make it fit in a smaller frame, do you?), but ATI's most
recent OpenGL implementation is only at version 1.3 and even at that it doesn't support
some 1.2 stuff. Thank God for Doom 3 - it may make them get their act together.
================
*/
static PROC MHGLGetProcAddress (char *funcname, qboolean crash)
{
int i;
static PROC thePROC;
// see is the function supported by the core implementation
if (thePROC = wglGetProcAddress (funcname))
{
return thePROC;
}
for (i = 0; ; i++)
{
if (!VendorCode[i]) break;
thePROC = wglGetProcAddress (va ("%s%s", funcname, VendorCode[i]));
if (thePROC)
{
// return silently if not crashing
if (crash)
{
Con_Printf ("%s Unavailable, reverting to %s%s\n", funcname, funcname, VendorCode[i]);
}
return thePROC;
}
}
// oh dear.
if (crash)
{
Sys_Error ("Core OpenGL 1.4 function %s Unavailable!!!", funcname);
}
// shut up compiler warnings
return NULL;
}
void GetGLCore (void)
{
// Realm doesn't have a 1 TMU render path any more, so...
glGetIntegerv (GL_MAX_TEXTURE_UNITS, &GLCaps.GL_TextureUnits);
if (GLCaps.GL_TextureUnits < 2)
{
Sys_Error ("Not enough TMUs");
}
// query extension availability... do this as a default because some drivers may report versions > 1.4 but not
// actually implement the required feature set (hello ATI...) - we crash if one is not found...
// this list is pretty exhaustive of all the required stuff that's been added from 1.1 onwards. it may include some
// that aren't actually used by Realm at present. all of these were promoted to the core a long long time ago, and
// as such should no longer be considered "extensions" unless you have a really creaky old card...
GL_CheckExtension ("generate_mipmap", true, true);
GL_CheckExtension ("vertex_array", true, true);
GL_CheckExtension ("texture", true, true);
GL_CheckExtension ("texture_object", true, true);
// SGIS doesn't use glActiveTexture, so if we don't have that we'll crash later on
GL_CheckExtension ("multitexture", true, true);
GL_CheckExtension ("texture_compression", true, true);
GL_CheckExtension ("texture_env_add", true, true);
GL_CheckExtension ("texture_env_combine", true, true);
GL_CheckExtension ("texture_env_dot3", true, true);
GL_CheckExtension ("texture_cube_map", true, true);
// this is an NV extension, and may not be present on ATI... Realm does use it though, so don't crash if it's not
// found, and be prepared for undefined program behaviour... (it's been core since 1.4 so this should only be an
// issue if ATI's drivers are crap...)
GL_CheckExtension ("blend_square", false, true);
GL_CheckExtension ("fog_coord", true, true);
GL_CheckExtension ("point_parameters", true, true);
GL_CheckExtension ("bgra", true, true);
GL_CheckExtension ("texture_edge_clamp", true, true);
GL_CheckExtension ("texture_lod", true, true);
// now get the function pointers...
// OpenGL 1.2 - check the ones we need only, and a few others to ensure it's OK
glBlendColor = (void *) MHGLGetProcAddress ("glBlendColor", false);
glBlendEquation = (void *) MHGLGetProcAddress ("glBlendEquation", false);
glDrawRangeElements = (void *) MHGLGetProcAddress ("glDrawRangeElements", true);
glColorTable = (void *) MHGLGetProcAddress ("glColorTable", false);
glColorTableParameterfv = (void *) MHGLGetProcAddress ("glColorTableParameterfv", false);
glColorTableParameteriv = (void *) MHGLGetProcAddress ("glColorTableParameteriv", false);
glCopyColorTable = (void *) MHGLGetProcAddress ("glCopyColorTable", false);
glGetColorTable = (void *) MHGLGetProcAddress ("glGetColorTable", false);
glGetColorTableParameterfv = (void *) MHGLGetProcAddress ("glGetColorTableParameterfv", false);
glGetColorTableParameteriv = (void *) MHGLGetProcAddress ("glGetColorTableParameteriv", false);
glColorSubTable = (void *) MHGLGetProcAddress ("glColorSubTable", false);
glCopyColorSubTable = (void *) MHGLGetProcAddress ("glCopyColorSubTable", false);
glConvolutionFilter1D = (void *) MHGLGetProcAddress ("glConvolutionFilter1D", false);
glConvolutionFilter2D = (void *) MHGLGetProcAddress ("glConvolutionFilter2D", false);
glConvolutionParameterf = (void *) MHGLGetProcAddress ("glConvolutionParameterf", false);
glConvolutionParameterfv = (void *) MHGLGetProcAddress ("glConvolutionParameterfv", false);
glConvolutionParameteri = (void *) MHGLGetProcAddress ("glConvolutionParameteri", false);
glConvolutionParameteriv = (void *) MHGLGetProcAddress ("glConvolutionParameteriv", false);
glCopyConvolutionFilter1D = (void *) MHGLGetProcAddress ("glCopyConvolutionFilter1D", false);
glCopyConvolutionFilter2D = (void *) MHGLGetProcAddress ("glCopyConvolutionFilter2D", false);
glGetConvolutionFilter = (void *) MHGLGetProcAddress ("glGetConvolutionFilter", false);
glGetConvolutionParameterfv = (void *) MHGLGetProcAddress ("glGetConvolutionParameterfv", false);
glGetConvolutionParameteriv = (void *) MHGLGetProcAddress ("glGetConvolutionParameteriv", false);
glGetSeparableFilter = (void *) MHGLGetProcAddress ("glGetSeparableFilter", false);
glSeparableFilter2D = (void *) MHGLGetProcAddress ("glSeparableFilter2D", false);
glGetHistogram = (void *) MHGLGetProcAddress ("glGetHistogram", false);
glGetHistogramParameterfv = (void *) MHGLGetProcAddress ("glGetHistogramParameterfv", false);
glGetHistogramParameteriv = (void *) MHGLGetProcAddress ("glGetHistogramParameteriv", false);
glGetMinmax = (void *) MHGLGetProcAddress ("glGetMinmax", false);
glGetMinmaxParameterfv = (void *) MHGLGetProcAddress ("glGetMinmaxParameterfv", false);
glGetMinmaxParameteriv = (void *) MHGLGetProcAddress ("glGetMinmaxParameteriv", false);
glHistogram = (void *) MHGLGetProcAddress ("glHistogram", false);
glMinmax = (void *) MHGLGetProcAddress ("glMinmax", false);
glResetHistogram = (void *) MHGLGetProcAddress ("glResetHistogram", false);
glResetMinmax = (void *) MHGLGetProcAddress ("glResetMinmax", false);
glTexImage3D = (void *) MHGLGetProcAddress ("glTexImage3D", true);
glTexSubImage3D = (void *) MHGLGetProcAddress ("glTexSubImage3D", false);
glCopyTexSubImage3D = (void *) MHGLGetProcAddress ("glCopyTexSubImage3D", false);
// OpenGL 1.3 - check the ones we need only, and a few others to ensure it's OK
glActiveTexture = (void *) MHGLGetProcAddress ("glActiveTexture", true);
glClientActiveTexture = (void *) MHGLGetProcAddress ("glClientActiveTexture", true);
glMultiTexCoord1d = (void *) MHGLGetProcAddress ("glMultiTexCoord1d", false);
glMultiTexCoord1dv = (void *) MHGLGetProcAddress ("glMultiTexCoord1dv", false);
glMultiTexCoord1f = (void *) MHGLGetProcAddress ("glMultiTexCoord1f", true);
glMultiTexCoord1fv = (void *) MHGLGetProcAddress ("glMultiTexCoord1fv", false);
glMultiTexCoord1i = (void *) MHGLGetProcAddress ("glMultiTexCoord1i", false);
glMultiTexCoord1iv = (void *) MHGLGetProcAddress ("glMultiTexCoord1iv", false);
glMultiTexCoord1s = (void *) MHGLGetProcAddress ("glMultiTexCoord1s", false);
glMultiTexCoord1sv = (void *) MHGLGetProcAddress ("glMultiTexCoord1sv", false);
glMultiTexCoord2d = (void *) MHGLGetProcAddress ("glMultiTexCoord2d", false);
glMultiTexCoord2dv = (void *) MHGLGetProcAddress ("glMultiTexCoord2dv", false);
glMultiTexCoord2f = (void *) MHGLGetProcAddress ("glMultiTexCoord2f", true);
glMultiTexCoord2fv = (void *) MHGLGetProcAddress ("glMultiTexCoord2fv", false);
glMultiTexCoord2i = (void *) MHGLGetProcAddress ("glMultiTexCoord2i", false);
glMultiTexCoord2iv = (void *) MHGLGetProcAddress ("glMultiTexCoord2iv", false);
glMultiTexCoord2s = (void *) MHGLGetProcAddress ("glMultiTexCoord2s", false);
glMultiTexCoord2sv = (void *) MHGLGetProcAddress ("glMultiTexCoord2sv", false);
glMultiTexCoord3d = (void *) MHGLGetProcAddress ("glMultiTexCoord3d", false);
glMultiTexCoord3dv = (void *) MHGLGetProcAddress ("glMultiTexCoord3dv", false);
glMultiTexCoord3f = (void *) MHGLGetProcAddress ("glMultiTexCoord3f", true);
glMultiTexCoord3fv = (void *) MHGLGetProcAddress ("glMultiTexCoord3fv", false);
glMultiTexCoord3i = (void *) MHGLGetProcAddress ("glMultiTexCoord3i", false);
glMultiTexCoord3iv = (void *) MHGLGetProcAddress ("glMultiTexCoord3iv", false);
glMultiTexCoord3s = (void *) MHGLGetProcAddress ("glMultiTexCoord3s", false);
glMultiTexCoord3sv = (void *) MHGLGetProcAddress ("glMultiTexCoord3sv", false);
glMultiTexCoord4d = (void *) MHGLGetProcAddress ("glMultiTexCoord4d", false);
glMultiTexCoord4dv = (void *) MHGLGetProcAddress ("glMultiTexCoord4dv", false);
glMultiTexCoord4f = (void *) MHGLGetProcAddress ("glMultiTexCoord4f", false);
glMultiTexCoord4fv = (void *) MHGLGetProcAddress ("glMultiTexCoord4fv", false);
glMultiTexCoord4i = (void *) MHGLGetProcAddress ("glMultiTexCoord4i", false);
glMultiTexCoord4iv = (void *) MHGLGetProcAddress ("glMultiTexCoord4iv", false);
glMultiTexCoord4s = (void *) MHGLGetProcAddress ("glMultiTexCoord4s", false);
glMultiTexCoord4sv = (void *) MHGLGetProcAddress ("glMultiTexCoord4sv", false);
glLoadTransposeMatrixf = (void *) MHGLGetProcAddress ("glLoadTransposeMatrixf", false);
glLoadTransposeMatrixd = (void *) MHGLGetProcAddress ("glLoadTransposeMatrixd", false);
glMultTransposeMatrixf = (void *) MHGLGetProcAddress ("glMultTransposeMatrixf", false);
glMultTransposeMatrixd = (void *) MHGLGetProcAddress ("glMultTransposeMatrixd", false);
glSampleCoverage = (void *) MHGLGetProcAddress ("glSampleCoverage", false);
glCompressedTexImage3D = (void *) MHGLGetProcAddress ("glCompressedTexImage3D", false);
glCompressedTexImage2D = (void *) MHGLGetProcAddress ("glCompressedTexImage2D", true);
glCompressedTexImage1D = (void *) MHGLGetProcAddress ("glCompressedTexImage1D", false);
glCompressedTexSubImage3D = (void *) MHGLGetProcAddress ("glCompressedTexSubImage3D", false);
glCompressedTexSubImage2D = (void *) MHGLGetProcAddress ("glCompressedTexSubImage2D", false);
glCompressedTexSubImage1D = (void *) MHGLGetProcAddress ("glCompressedTexSubImage1D", false);
glGetCompressedTexImage = (void *) MHGLGetProcAddress ("glGetCompressedTexImage", false);
// OpenGL 1.4 - check the ones we need only, and a few others to ensure it's OK
glBlendFuncSeparate = (void *) MHGLGetProcAddress ("glBlendFuncSeparate", false);
glFogCoordf = (void *) MHGLGetProcAddress ("glFogCoordf", true);
glFogCoordfv = (void *) MHGLGetProcAddress ("glFogCoordfv", false);
glFogCoordd = (void *) MHGLGetProcAddress ("glFogCoordd", false);
glFogCoorddv = (void *) MHGLGetProcAddress ("glFogCoorddv", false);
glFogCoordPointer = (void *) MHGLGetProcAddress ("glFogCoordPointer", true);
glMultiDrawArrays = (void *) MHGLGetProcAddress ("glMultiDrawArrays", true);
glMultiDrawElements = (void *) MHGLGetProcAddress ("glMultiDrawElements", false);
glPointParameterf = (void *) MHGLGetProcAddress ("glPointParameterf", true);
glPointParameterfv = (void *) MHGLGetProcAddress ("glPointParameterfv", false);
glSecondaryColor3b = (void *) MHGLGetProcAddress ("glSecondaryColor3b", false);
glSecondaryColor3bv = (void *) MHGLGetProcAddress ("glSecondaryColor3bv", false);
glSecondaryColor3d = (void *) MHGLGetProcAddress ("glSecondaryColor3d", false);
glSecondaryColor3dv = (void *) MHGLGetProcAddress ("glSecondaryColor3dv", false);
glSecondaryColor3f = (void *) MHGLGetProcAddress ("glSecondaryColor3f", true);
glSecondaryColor3fv = (void *) MHGLGetProcAddress ("glSecondaryColor3fv", false);
glSecondaryColor3i = (void *) MHGLGetProcAddress ("glSecondaryColor3i", false);
glSecondaryColor3iv = (void *) MHGLGetProcAddress ("glSecondaryColor3iv", false);
glSecondaryColor3s = (void *) MHGLGetProcAddress ("glSecondaryColor3s", false);
glSecondaryColor3sv = (void *) MHGLGetProcAddress ("glSecondaryColor3sv", false);
glSecondaryColor3ub = (void *) MHGLGetProcAddress ("glSecondaryColor3ub", false);
glSecondaryColor3ubv = (void *) MHGLGetProcAddress ("glSecondaryColor3ubv", false);
glSecondaryColor3ui = (void *) MHGLGetProcAddress ("glSecondaryColor3ui", false);
glSecondaryColor3uiv = (void *) MHGLGetProcAddress ("glSecondaryColor3uiv", false);
glSecondaryColor3us = (void *) MHGLGetProcAddress ("glSecondaryColor3us", false);
glSecondaryColor3usv = (void *) MHGLGetProcAddress ("glSecondaryColor3usv", false);
glSecondaryColorPointer = (void *) MHGLGetProcAddress ("glSecondaryColorPointer", true);
glWindowPos2d = (void *) MHGLGetProcAddress ("glWindowPos2d", false);
glWindowPos2dv = (void *) MHGLGetProcAddress ("glWindowPos2dv", false);
glWindowPos2f = (void *) MHGLGetProcAddress ("glWindowPos2f", false);
glWindowPos2fv = (void *) MHGLGetProcAddress ("glWindowPos2fv", false);
glWindowPos2i = (void *) MHGLGetProcAddress ("glWindowPos2i", false);
glWindowPos2iv = (void *) MHGLGetProcAddress ("glWindowPos2iv", false);
glWindowPos2s = (void *) MHGLGetProcAddress ("glWindowPos2s", false);
glWindowPos2sv = (void *) MHGLGetProcAddress ("glWindowPos2sv", false);
glWindowPos3d = (void *) MHGLGetProcAddress ("glWindowPos3d", false);
glWindowPos3dv = (void *) MHGLGetProcAddress ("glWindowPos3dv", false);
glWindowPos3f = (void *) MHGLGetProcAddress ("glWindowPos3f", false);
glWindowPos3fv = (void *) MHGLGetProcAddress ("glWindowPos3fv", false);
glWindowPos3i = (void *) MHGLGetProcAddress ("glWindowPos3i", false);
glWindowPos3iv = (void *) MHGLGetProcAddress ("glWindowPos3iv", false);
glWindowPos3s = (void *) MHGLGetProcAddress ("glWindowPos3s", false);
glWindowPos3sv = (void *) MHGLGetProcAddress ("glWindowPos3sv", false);
// OpenGL 1.5 - get them all but don't crash on a fail cos they're optional
glGenQueries = (void *) MHGLGetProcAddress ("glGenQueries", false);
glDeleteQueries = (void *) MHGLGetProcAddress ("glDeleteQueries", false);
glIsQuery = (void *) MHGLGetProcAddress ("glIsQuery", false);
glEndQuery = (void *) MHGLGetProcAddress ("glEndQuery", false);
glGetQueryiv = (void *) MHGLGetProcAddress ("glGetQueryiv", false);
glGetQueryObjectiv = (void *) MHGLGetProcAddress ("glGetQueryObjectiv", false);
glGetQueryObjectuiv = (void *) MHGLGetProcAddress ("glGetQueryObjectuiv", false);
glBindBuffer = (void *) MHGLGetProcAddress ("glBindBuffer", false);
glDeleteBuffers = (void *) MHGLGetProcAddress ("glDeleteBuffers", false);
glGenBuffers = (void *) MHGLGetProcAddress ("glGenBuffers", false);
glIsBuffer = (void *) MHGLGetProcAddress ("glIsBuffer", false);
glBufferData = (void *) MHGLGetProcAddress ("glBufferData", false);
glBufferSubData = (void *) MHGLGetProcAddress ("glBufferSubData", false);
glGetBufferSubData = (void *) MHGLGetProcAddress ("glGetBufferSubData", false);
glMapBuffer = (void *) MHGLGetProcAddress ("glMapBuffer", false);
glUnmapBuffer = (void *) MHGLGetProcAddress ("glUnmapBuffer", false);
glGetBufferParameteriv = (void *) MHGLGetProcAddress ("glGetBufferParameteriv", false);
glGetBufferPointerv = (void *) MHGLGetProcAddress ("glGetBufferPointerv", false);
// vertex programs
glGetVertexAttribdvARB = (void *) MHGLGetProcAddress( "glGetVertexAttribdvARB", false );
glGetVertexAttribfvARB = (void *) MHGLGetProcAddress( "glGetVertexAttribfvARB", false );
glGetVertexAttribivARB = (void *) MHGLGetProcAddress( "glGetVertexAttribivARB", false );
glGetVertexAttribPointervARB = (void *) MHGLGetProcAddress( "glGetVertexAttribPointervARB", false );
// fragment programs
glProgramStringARB = (void *) MHGLGetProcAddress( "glProgramStringARB", false );
glBindProgramARB = (void *) MHGLGetProcAddress( "glBindProgramARB", false );
glDeleteProgramsARB = (void *) MHGLGetProcAddress( "glDeleteProgramsARB", false );
glGenProgramsARB = (void *) MHGLGetProcAddress( "glGenProgramsARB", false );
glProgramEnvParameter4dARB = (void *) MHGLGetProcAddress( "glProgramEnvParameter4dARB", false );
glProgramEnvParameter4dvARB = (void *) MHGLGetProcAddress( "glProgramEnvParameter4dvARB", false );
glProgramEnvParameter4fARB = (void *) MHGLGetProcAddress( "glProgramEnvParameter4fARB", false );
glProgramEnvParameter4fvARB = (void *) MHGLGetProcAddress( "glProgramEnvParameter4fvARB", false );
glProgramLocalParameter4dARB = (void *) MHGLGetProcAddress( "glProgramLocalParameter4dARB", false );
glProgramLocalParameter4dvARB = (void *) MHGLGetProcAddress( "glProgramLocalParameter4dvARB", false );
glProgramLocalParameter4fARB = (void *) MHGLGetProcAddress( "glProgramLocalParameter4fARB", false );
glProgramLocalParameter4fvARB = (void *) MHGLGetProcAddress( "glProgramLocalParameter4fvARB", false );
glGetProgramEnvParameterdvARB = (void *) MHGLGetProcAddress( "glGetProgramEnvParameterdvARB", false );
glGetProgramEnvParameterfvARB = (void *) MHGLGetProcAddress( "glGetProgramEnvParameterfvARB", false );
glGetProgramLocalParameterdvARB = (void *) MHGLGetProcAddress( "glGetProgramLocalParameterdvARB", false );
glGetProgramLocalParameterfvARB = (void *) MHGLGetProcAddress( "glGetProgramLocalParameterfvARB", false );
glGetProgramivARB = (void *) MHGLGetProcAddress( "glGetProgramivARB", false );
glGetProgramStringARB = (void *) MHGLGetProcAddress( "glGetProgramStringARB", false );
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &GLCaps.GL_MaxTextureSize);
Con_Printf ("\nMaximum Texture Size: %i x %i\n", GLCaps.GL_MaxTextureSize, GLCaps.GL_MaxTextureSize);
Con_Printf ("\nRequired OpenGL Support OK\n\n...Checking Optional Features\n");
// check OpenGL 1.5 optional features
if (GL_State.gl_version >= 1.5)
{
GL_ExtensionBits |= HAS_OCCLUSION;
Con_Printf ("Found core feature: occlusion_query.\n");
}
else
{
if (GL_CheckExtension ("occlusion_query", false, false))
{
GL_ExtensionBits |= HAS_OCCLUSION;
}
}
if (GL_ExtensionBits & HAS_OCCLUSION)
{
glGetQueryiv (GL_SAMPLES_PASSED, GL_QUERY_COUNTER_BITS, &GLCaps.GL_OcclusionBits);
Con_Printf (" %i Occlusion Query Bits\n", GLCaps.GL_OcclusionBits);
}
else
{
GLCaps.GL_OcclusionBits = 0;
}
// check other non-core and/or proprietary extensions
if (GL_CheckExtension ("texture_filter_anisotropic", false, false))
{
GL_ExtensionBits |= HAS_ANISOTROPIC;
glGetFloatv (GL_MAX_TEXTURE_MAX_ANISOTROPY, &GLCaps.GL_MaxAnisotropy);
Con_Printf ("Maximum Anisotropic Filter: %i\n", (int) GLCaps.GL_MaxAnisotropy);
}
else
{
GLCaps.GL_MaxAnisotropy = 1;
}
if (GL_CheckExtension ("GL_EXT_compiled_vertex_array", false, true))
{
glLockArrays = (void *) MHGLGetProcAddress ("glLockArrays", false);
glUnlockArrays = (void *) MHGLGetProcAddress ("glUnlockArrays", false);
if (glLockArrays && glUnlockArrays)
{
GL_ExtensionBits |= HAS_CVA;
Con_Printf ("Found Extension GL_EXT_compiled_vertex_array.\n");
}
}
if (GL_CheckExtension ("GL_ARB_vertex_program", false, false))
{
GL_ExtensionBits |= HAS_ARBVERTEXPROGRAMS;
}
if (GL_CheckExtension ("GL_ARB_fragment_program", false, false))
{
GL_ExtensionBits |= HAS_ARBFRAGMENTSHADERS;
}
if (GL_CheckExtension ("GL_NV_texture_shader", false, false))
{
GL_ExtensionBits |= HAS_NVVERTEXSHADERS;
}
// get the number of TMUs available
Con_Printf("\nFound %i TMUs support.\n", GLCaps.GL_TextureUnits);
Con_Printf ("\nMinimal Required OpenGL Startup OK\n");
}
/*
===============
GL_Init
===============
*/
void GL_Init (void)
{
int GL_ColorBitsRed;
int GL_ColorBitsGreen;
int GL_ColorBitsBlue;
int GL_DepthBits;
int GL_StencilBits;
int i;
// set baseline gl state
GL_InitState ();
GL_State.gl_vendor = (const char *)glGetString (GL_VENDOR);
Con_Printf ("\nGL_VENDOR: %s\n", GL_State.gl_vendor);
GL_State.gl_renderer = (const char *)glGetString (GL_RENDERER);
Con_Printf ("GL_RENDERER: %s\n", GL_State.gl_renderer);
GL_State.gl_version = atof ((const char *)glGetString (GL_VERSION));
Con_Printf ("GL_VERSION: %0.2f\n", GL_State.gl_version);
GL_State.gl_extensions = (const char *)glGetString (GL_EXTENSIONS);
Con_DPrintf ("\nGL_EXTENSIONS: %s\n", GL_State.gl_extensions);
if (GL_State.gl_version < 1.4)
{
Con_Printf ("\nWARNING\nGL_VERSION %f detected - you may experience reduced functionality\n", GL_State.gl_version);
}
for (i = 0; i < (int)strlen (GL_State.gl_renderer) - 7; i++)
{
// test different ways of reporting this
if (GL_State.gl_renderer[i] == 'f' || GL_State.gl_renderer[i] == 'F' && GL_State.gl_renderer[i + 1] == 'x' || GL_State.gl_renderer[i + 1] == 'X')
{
int j;
if (GL_State.gl_renderer[i + 2] == ' ')
{
j = i + 3;
}
else
{
j = i + 2;
}
if (j + 3 >= (int)strlen (GL_State.gl_renderer)) break;
if (GL_State.gl_renderer[j] == '5')
{
GL_State.NP2BigDirtyFib = true;
Con_Printf ("\nWARNING\nNV 3x Chipset detected - you may experience reduced functionality\n");
break;
}
}
}
// get some caps
glGetIntegerv (GL_RED_BITS, &GL_ColorBitsRed);
glGetIntegerv (GL_GREEN_BITS, &GL_ColorBitsGreen);
glGetIntegerv (GL_BLUE_BITS, &GL_ColorBitsBlue);
glGetIntegerv (GL_DEPTH_BITS, &GL_DepthBits);
glGetIntegerv (GL_STENCIL_BITS, &GL_StencilBits);
Con_Printf ("\nBuffers\n");
Con_Printf (" Color: %2i Bits\n", GL_ColorBitsRed + GL_ColorBitsGreen + GL_ColorBitsBlue);
Con_Printf (" Depth: %2i Bits\n", GL_DepthBits);
Con_Printf (" Stencil: %2i Bits\n", GL_StencilBits);
GetGLCore ();
// default states
glClearColor (0.0, 0.0, 0.0, 1.0);
glCullFace(GL_FRONT);
glEnable(GL_TEXTURE_2D);
glAlphaFunc(GL_GREATER, 0.666f);
glPolygonOffset(0.05f, 0);
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
glShadeModel (GL_SMOOTH);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
// set up the hints for drawing
glHint (GL_POINT_SMOOTH_HINT, GL_NICEST);
glHint (GL_LINE_SMOOTH_HINT, GL_NICEST);
glHint (GL_POLYGON_SMOOTH_HINT, GL_NICEST);
glHint (GL_FOG_HINT, GL_NICEST);
glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glHint (GL_GENERATE_MIPMAP_HINT, GL_NICEST);
// explicitly enable dithering
glEnable (GL_DITHER);
// use fragment depth fog for higher quality
glFogf (GL_FOG_COORDINATE_SOURCE, GL_FRAGMENT_DEPTH);
} |
|
|
Back to top |
|
 |
reckless
Joined: 24 Jan 2008 Posts: 390 Location: inside tha debugger
|
Posted: Tue Dec 09, 2008 6:24 am Post subject: |
|
|
forgot to mention im compiling it on vista x64. should still be a 32 bit executable but maybe some 64 bit code got mixed in. i sure hope not but looks like i will have to install my old xp pro to find out... |
|
Back to top |
|
 |
reckless
Joined: 24 Jan 2008 Posts: 390 Location: inside tha debugger
|
Posted: Tue Dec 09, 2008 6:39 pm Post subject: |
|
|
any reports from ati users btw ? can check it here but since my old ati card now resides in my friends pc its not as easy  |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|