diff options
author | Daniel Borca <[email protected]> | 2004-10-12 07:31:26 +0000 |
---|---|---|
committer | Daniel Borca <[email protected]> | 2004-10-12 07:31:26 +0000 |
commit | 2bff8bd8de1cdb0398a4c6f4519c5716c90343ab (patch) | |
tree | e822d25f1fa46055727003092ede6b3d6edeb621 /src | |
parent | 92e1d5fd34491814c48310e4e6d5207c434dcc3f (diff) |
SWTC trick, enabled new extensions
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/windows/gdi/wmesa.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index ea13a31c42b..96cfafff4c3 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -56,6 +56,8 @@ #include "tnl/t_pipeline.h" #include "drivers/common/driverfuncs.h" +#define SWTC 0 /* SW texture compression */ + /* Dither not tested for Mesa 4.0 */ #ifdef DITHER #ifdef USE_WING @@ -1057,6 +1059,21 @@ static void read_rgba_pixels( const GLcontext* ctx, /**********************************************************************/ +static const struct gl_texture_format * +choose_tex_format( GLcontext *ctx, GLint internalFormat, + GLenum format, GLenum type ) +{ + switch (internalFormat) { + case GL_COMPRESSED_RGB_ARB: + return &_mesa_texformat_rgb; + case GL_COMPRESSED_RGBA_ARB: + return &_mesa_texformat_rgba; + default: + return _mesa_choose_tex_format(ctx, internalFormat, format, type); + } +} + + static const GLubyte *get_string(GLcontext *ctx, GLenum name) { (void) ctx; @@ -1076,13 +1093,17 @@ static void SetFunctionPointers( struct dd_function_table *functions ) functions->UpdateState = wmesa_update_state; functions->ResizeBuffers = _swrast_alloc_buffers; functions->GetBufferSize = buffer_size; - + functions->Clear = clear; - + functions->Flush = flush; functions->ClearIndex = clear_index; functions->ClearColor = clear_color; functions->Enable = enable; + +#if SWTC + functions->ChooseTextureFormat = choose_tex_format; +#endif } @@ -1377,6 +1398,15 @@ WMesaContext WMesaCreateContext( HWND hWnd, HPALETTE* Pal, _mesa_enable_sw_extensions(c->gl_ctx); _mesa_enable_1_3_extensions(c->gl_ctx); _mesa_enable_1_4_extensions(c->gl_ctx); + _mesa_enable_1_5_extensions(c->gl_ctx); + _mesa_enable_2_0_extensions(c->gl_ctx); +#if SWTC + if (c->gl_ctx->Mesa_DXTn) { + _mesa_enable_extension(c->gl_ctx, "GL_EXT_texture_compression_s3tc"); + _mesa_enable_extension(c->gl_ctx, "GL_S3_s3tc"); + } + _mesa_enable_extension(c->gl_ctx, "GL_3DFX_texture_compression_FXT1"); +#endif c->gl_buffer = _mesa_create_framebuffer( c->gl_visual, c->gl_visual->depthBits > 0, |