Commit f40676ab authored by hwaechtler's avatar hwaechtler
Browse files

replaced _EXT by _MESA in new tokens

parent 9d48fc66
......@@ -1419,17 +1419,17 @@ extern "C" {
#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF
#endif
#ifndef GL_EXT_texture_env_combine2
#define GL_ADD_MODULATE_EXT 0x6000
#define GL_ADD_SIGNED_MODULATE_EXT 0x6001
#define GL_MODULATE_ADD_EXT 0x6002
#define GL_MODULATE_ADD_SIGNED_EXT 0x6003
#define GL_MODULATE3_EXT 0x6004
#define GL_ADD3_EXT 0x6005
#define GL_DOT3_EXT 0x6006
#define GL_DOT3_SIGNED_EXT 0x6007
#define GL_DOT3_MODULATE_EXT 0x6008
#define GL_DOT3_SIGNED_MODULATE_EXT 0x6009
#ifndef GL_MESA_texture_env_combine2
#define GL_ADD_MODULATE_MESA 0x6000
#define GL_ADD_SIGNED_MODULATE_MESA 0x6001
#define GL_MODULATE_ADD_MESA 0x6002
#define GL_MODULATE_ADD_SIGNED_MESA 0x6003
#define GL_MODULATE3_MESA 0x6004
#define GL_ADD3_MESA 0x6005
#define GL_DOT3_MESA 0x6006
#define GL_DOT3_SIGNED_MESA 0x6007
#define GL_DOT3_MODULATE_MESA 0x6008
#define GL_DOT3_SIGNED_MODULATE_MESA 0x6009
#endif
/*************************************************************/
......
......@@ -354,7 +354,7 @@ render_perpixel (Mesh *m, int width, int height)
glEnable (GL_TEXTURE_2D);
glBindTexture (GL_TEXTURE_2D, m->normal_specular_texture);
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_DOT3_EXT);
glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_DOT3_MESA);
glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_PREVIOUS_EXT);
glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_TEXTURE);
glTexEnvi (GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR);
......@@ -414,7 +414,7 @@ render_perpixel (Mesh *m, int width, int height)
glBindTexture (GL_TEXTURE_2D, m->normal_specular_texture);
glEnable (GL_TEXTURE_2D);
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_DOT3_MODULATE_EXT);
glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_DOT3_MODULATE_MESA);
glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PRIMARY_COLOR_EXT);
glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_TEXTURE);
glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_CONSTANT_EXT);
......@@ -432,7 +432,7 @@ render_perpixel (Mesh *m, int width, int height)
glBindTexture (GL_TEXTURE_2D, m->color_texture);
glEnable (GL_TEXTURE_2D);
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD_MODULATE_EXT);
glTexEnvi (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_ADD_MODULATE_MESA);
glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PREVIOUS_EXT);
glTexEnvi (GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_CONSTANT_EXT);
glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, ambient_light);
......@@ -769,8 +769,8 @@ static void initGL (void)
printf("Sorry, GL_EXT_texture_env_combine not supported.\n");
exit(1);
}
if (!strstr(exten, "GL_EXT_texture_env_combine2")) {
printf("Sorry, GL_EXT_texture_env_combine2 not supported.\n");
if (!strstr(exten, "GL_MESA_texture_env_combine2")) {
printf("Sorry, GL_MESA_texture_env_combine2 not supported.\n");
exit(1);
}
......@@ -818,8 +818,6 @@ int main (int argc, char *argv[])
glutInitDisplayMode (GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow (argv[0]);
initGL ();
if (argc > 1 && strcmp(argv[1], "-info")==0) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
......@@ -827,6 +825,8 @@ int main (int argc, char *argv[])
printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
}
initGL ();
printf (usage, argv[0]);
glutReshapeFunc (reshape);
......
/* $Id: osmesa.c,v 1.19.2.1 2000/07/16 06:52:15 hwaechtler Exp $ */
/* $Id: osmesa.c,v 1.19.2.2 2000/07/16 07:39:43 hwaechtler Exp $ */
/*
* Mesa 3-D graphics library
......@@ -227,7 +227,7 @@ OSMesaCreateContext( GLenum format, OSMesaContext sharelist )
gl_extensions_enable(&(osmesa->gl_ctx),"GL_HP_occlusion_test");
gl_extensions_enable(&(osmesa->gl_ctx), "GL_ARB_texture_cube_map");
gl_extensions_enable(&(osmesa->gl_ctx), "GL_EXT_texture_env_combine");
gl_extensions_enable(&(osmesa->gl_ctx), "GL_EXT_texture_env_combine2");
gl_extensions_enable(&(osmesa->gl_ctx), "GL_MESA_texture_env_combine2");
osmesa->gl_buffer = gl_create_framebuffer( osmesa->gl_visual,
osmesa->gl_visual->DepthBits > 0,
......
/* $Id: extensions.c,v 1.32.2.1 2000/07/16 06:52:15 hwaechtler Exp $ */
/* $Id: extensions.c,v 1.32.2.2 2000/07/16 07:39:43 hwaechtler Exp $ */
/*
* Mesa 3-D graphics library
......@@ -76,7 +76,6 @@ static struct { int enabled; const char *name; } default_extensions[] = {
{ DEFAULT_OFF, "GL_EXT_texture_env" },
{ DEFAULT_ON, "GL_EXT_texture_env_add" },
{ DEFAULT_OFF, "GL_EXT_texture_env_combine" },
{ DEFAULT_OFF, "GL_EXT_texture_env_combine2" },
{ ALWAYS_ENABLED, "GL_EXT_texture_object" },
{ DEFAULT_ON, "GL_EXT_texture_lod_bias" },
{ ALWAYS_ENABLED, "GL_EXT_vertex_array" },
......@@ -85,6 +84,7 @@ static struct { int enabled; const char *name; } default_extensions[] = {
{ DEFAULT_ON, "GL_INGR_blend_func_separate" },
{ ALWAYS_ENABLED, "GL_MESA_window_pos" },
{ ALWAYS_ENABLED, "GL_MESA_resize_buffers" },
{ DEFAULT_OFF, "GL_MESA_texture_env_combine2" },
{ DEFAULT_OFF, "GL_NV_blend_square" },
{ ALWAYS_ENABLED, "GL_NV_texgen_reflection" },
{ DEFAULT_ON, "GL_PGI_misc_hints" },
......@@ -106,7 +106,7 @@ update_extension_flags( GLcontext *ctx )
/* Update flags */
ctx->Extensions.HaveTextureEnvAdd = gl_extension_is_enabled(ctx, "GL_EXT_texture_env_add");
ctx->Extensions.HaveTextureEnvCombine = gl_extension_is_enabled(ctx, "GL_EXT_texture_env_combine");
ctx->Extensions.HaveTextureEnvCombine2 = gl_extension_is_enabled(ctx, "GL_EXT_texture_env_combine2");
ctx->Extensions.HaveTextureEnvCombine2 = gl_extension_is_enabled(ctx, "GL_MESA_texture_env_combine2");
ctx->Extensions.HaveTextureLodBias = gl_extension_is_enabled(ctx, "GL_EXT_texture_lod_bias");
ctx->Extensions.HaveHpOcclusionTest = gl_extension_is_enabled(ctx, "GL_HP_occlusion_test");
ctx->Extensions.HaveTextureCubeMap = gl_extension_is_enabled(ctx, "GL_ARB_texture_cube_map");
......
/* $Id: texstate.c,v 1.15.2.1 2000/07/16 06:52:15 hwaechtler Exp $ */
/* $Id: texstate.c,v 1.15.2.2 2000/07/16 07:39:43 hwaechtler Exp $ */
/*
* Mesa 3-D graphics library
......@@ -123,16 +123,16 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
texUnit->CombineModeRGB = mode;
ctx->NewState |= NEW_TEXTURE_ENV;
break;
case GL_ADD_MODULATE_EXT:
case GL_ADD_SIGNED_MODULATE_EXT:
case GL_MODULATE_ADD_EXT:
case GL_MODULATE_ADD_SIGNED_EXT:
case GL_ADD3_EXT:
case GL_MODULATE3_EXT:
case GL_DOT3_EXT:
case GL_DOT3_SIGNED_EXT:
case GL_DOT3_MODULATE_EXT:
case GL_DOT3_SIGNED_MODULATE_EXT:
case GL_ADD_MODULATE_MESA:
case GL_ADD_SIGNED_MODULATE_MESA:
case GL_MODULATE_ADD_MESA:
case GL_MODULATE_ADD_SIGNED_MESA:
case GL_ADD3_MESA:
case GL_MODULATE3_MESA:
case GL_DOT3_MESA:
case GL_DOT3_SIGNED_MESA:
case GL_DOT3_MODULATE_MESA:
case GL_DOT3_SIGNED_MODULATE_MESA:
if (ctx->Extensions.HaveTextureEnvCombine2) {
if (texUnit->CombineModeRGB == mode)
return; /* no change */
......@@ -167,6 +167,22 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
texUnit->CombineModeA = mode;
ctx->NewState |= NEW_TEXTURE_ENV;
break;
case GL_ADD_MODULATE_MESA:
case GL_ADD_SIGNED_MODULATE_MESA:
case GL_MODULATE_ADD_MESA:
case GL_MODULATE_ADD_SIGNED_MESA:
case GL_ADD3_MESA:
case GL_MODULATE3_MESA:
if (ctx->Extensions.HaveTextureEnvCombine2) {
if (texUnit->CombineModeA == mode)
return; /* no change */
texUnit->CombineModeA = mode;
ctx->NewState |= NEW_TEXTURE_ENV;
} else {
gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
return;
}
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glTexEnv(param)" );
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment