add paletted texture entry points

remove texture compression ones
This commit is contained in:
Glenn Maynard
2003-01-22 22:41:05 +00:00
parent 2fcbbf3ac3
commit b2062dd91f
3 changed files with 24 additions and 5 deletions
+15 -2
View File
@@ -49,6 +49,8 @@ static int g_iFramesRenderedSinceLastCheck,
g_iNumChecksSinceLastReset; g_iNumChecksSinceLastReset;
PWSWAPINTERVALEXTPROC GLExt::wglSwapIntervalEXT; PWSWAPINTERVALEXTPROC GLExt::wglSwapIntervalEXT;
PFNGLCOLORTABLEPROC GLExt::glColorTableEXT;
PFNGLCOLORTABLEPARAMETERIVPROC GLExt::glGetColorTableParameterivEXT;
/* We don't actually use normals (we don't tunr on lighting), there's just /* We don't actually use normals (we don't tunr on lighting), there's just
* no GL_T2F_C4F_V3F. */ * no GL_T2F_C4F_V3F. */
@@ -155,16 +157,22 @@ void RageDisplay::SetupExtensions()
/* Check for extensions: */ /* Check for extensions: */
m_oglspecs->EXT_texture_env_combine = HasExtension("GL_EXT_texture_env_combine"); m_oglspecs->EXT_texture_env_combine = HasExtension("GL_EXT_texture_env_combine");
m_oglspecs->ARB_texture_compression = HasExtension("GL_ARB_texture_compression");
m_oglspecs->EXT_texture_compression_s3tc = HasExtension("GL_EXT_texture_compression_s3tc");
m_oglspecs->WGL_EXT_swap_control = HasExtension("WGL_EXT_swap_control"); m_oglspecs->WGL_EXT_swap_control = HasExtension("WGL_EXT_swap_control");
m_oglspecs->EXT_paletted_texture = HasExtension("GL_EXT_paletted_texture");
/* Find extension functions. */ /* Find extension functions. */
wglSwapIntervalEXT = (PWSWAPINTERVALEXTPROC) SDL_GL_GetProcAddress("wglSwapIntervalEXT"); wglSwapIntervalEXT = (PWSWAPINTERVALEXTPROC) SDL_GL_GetProcAddress("wglSwapIntervalEXT");
glColorTableEXT = (PFNGLCOLORTABLEPROC) SDL_GL_GetProcAddress("glColorTableEXT");
glGetColorTableParameterivEXT = (PFNGLCOLORTABLEPARAMETERIVPROC) SDL_GL_GetProcAddress("glGetColorTableParameterivEXT");
/* Make sure we have all components for detected extensions. */ /* Make sure we have all components for detected extensions. */
if(m_oglspecs->WGL_EXT_swap_control) if(m_oglspecs->WGL_EXT_swap_control)
ASSERT(wglSwapIntervalEXT); ASSERT(wglSwapIntervalEXT);
if(m_oglspecs->EXT_paletted_texture)
{
ASSERT(glColorTableEXT);
ASSERT(glGetColorTableParameterivEXT);
}
} }
/* Set the video mode. In some cases, changing the video mode will reset /* Set the video mode. In some cases, changing the video mode will reset
@@ -338,6 +346,11 @@ void RageDisplay::ResetStats()
g_LastCheckTimer.GetDeltaTime(); g_LastCheckTimer.GetDeltaTime();
} }
void RageDisplay::DisablePalettedTexture()
{
m_oglspecs->EXT_paletted_texture = false;
}
bool RageDisplay::IsWindowed() const bool RageDisplay::IsWindowed() const
{ {
return true; // FIXME return true; // FIXME
+1
View File
@@ -85,6 +85,7 @@ public:
void ResetStats(); void ResetStats();
const oglspecs_t &GetSpecs() const { return *m_oglspecs; } const oglspecs_t &GetSpecs() const { return *m_oglspecs; }
void DisablePalettedTexture();
protected: protected:
void AddVerts( const RageVertex v[], int iNumVerts ); void AddVerts( const RageVertex v[], int iNumVerts );
+7 -2
View File
@@ -15,6 +15,10 @@
#include "glext.h" #include "glext.h"
/* Windows's broken gl.h defines GL_EXT_paletted_texture incompletely: */
#ifndef GL_TEXTURE_INDEX_SIZE_EXT
#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
#endif
#include <set> #include <set>
/* Not in glext.h: */ /* Not in glext.h: */
@@ -38,14 +42,15 @@ struct oglspecs_t {
/* Which extensions we actually use are supported: */ /* Which extensions we actually use are supported: */
bool EXT_texture_env_combine, bool EXT_texture_env_combine,
WGL_EXT_swap_control, WGL_EXT_swap_control,
ARB_texture_compression, EXT_paletted_texture;
EXT_texture_compression_s3tc;
}; };
/* Extension functions we use. Put these in a namespace instead of in oglspecs_t, /* Extension functions we use. Put these in a namespace instead of in oglspecs_t,
* so they can be called like regular functions. */ * so they can be called like regular functions. */
namespace GLExt { namespace GLExt {
extern PWSWAPINTERVALEXTPROC wglSwapIntervalEXT; extern PWSWAPINTERVALEXTPROC wglSwapIntervalEXT;
extern PFNGLCOLORTABLEPROC glColorTableEXT;
extern PFNGLCOLORTABLEPARAMETERIVPROC glGetColorTableParameterivEXT;
}; };
using namespace GLExt; using namespace GLExt;