-/* $Id: osmesa.c,v 1.16 2000/04/22 01:05:40 brianp Exp $ */
+/* $Id: osmesa.c,v 1.17 2000/05/26 14:44:59 brianp Exp $ */
/*
* Mesa 3-D graphics library
return NULL;
}
gl_extensions_enable(&(osmesa->gl_ctx),"GL_HP_occlusion_test");
+ gl_extensions_enable(&(osmesa->gl_ctx), "GL_ARB_texture_cube_map");
osmesa->gl_buffer = gl_create_framebuffer( osmesa->gl_visual,
osmesa->gl_visual->DepthBits > 0,
-/* $Id: context.c,v 1.69 2000/05/24 15:04:45 brianp Exp $ */
+/* $Id: context.c,v 1.70 2000/05/26 14:44:59 brianp Exp $ */
/*
* Mesa 3-D graphics library
ss->DefaultD[d]->RefCount++; /* don't free if not in use */
}
+ ss->DefaultCubeMap = gl_alloc_texture_object(ss, 0, 6);
+ if (!ss->DefaultCubeMap) {
+ outOfMemory = GL_TRUE;
+ }
+ else {
+ ss->DefaultCubeMap->RefCount++;
+ }
+
if (!ss->DisplayList || !ss->TexObjects || outOfMemory) {
/* Ran out of memory at some point. Free everything and return NULL */
if (ss->DisplayList)
gl_free_texture_object(ss, ss->DefaultD[2]);
if (ss->DefaultD[3])
gl_free_texture_object(ss, ss->DefaultD[3]);
+ if (ss->DefaultCubeMap)
+ gl_free_texture_object(ss, ss->DefaultCubeMap);
FREE(ss);
return NULL;
}
texUnit->CurrentD[1] = ctx->Shared->DefaultD[1];
texUnit->CurrentD[2] = ctx->Shared->DefaultD[2];
texUnit->CurrentD[3] = ctx->Shared->DefaultD[3];
+ texUnit->CurrentCubeMap = ctx->Shared->DefaultCubeMap;
}
void gl_problem( const GLcontext *ctx, const char *s )
{
fprintf( stderr, "Mesa implementation error: %s\n", s );
- fprintf( stderr, "Report to mesa-bugs@mesa3d.org\n" );
+ fprintf( stderr, "Report to Mesa bug database at www.mesa3d.org\n" );
(void) ctx;
}
-/* $Id: state.c,v 1.14 2000/05/24 15:04:45 brianp Exp $ */
+/* $Id: state.c,v 1.15 2000/05/26 14:44:59 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Enabled &= ~(ENABLE_TEXMAT0|ENABLE_TEXMAT1);
for (i=0; i < MAX_TEXTURE_UNITS; i++) {
- if (ctx->TextureMatrix[i].flags & MAT_DIRTY_ALL_OVER)
- {
+ if (ctx->TextureMatrix[i].flags & MAT_DIRTY_ALL_OVER) {
gl_matrix_analyze( &ctx->TextureMatrix[i] );
ctx->TextureMatrix[i].flags &= ~MAT_DIRTY_DEPENDENTS;
if (ctx->NewState & (NEW_TEXTURING | NEW_TEXTURE_ENABLE)) {
ctx->Texture.NeedNormals = GL_FALSE;
gl_update_dirty_texobjs(ctx);
- ctx->Enabled &= ~(ENABLE_TEXGEN0|ENABLE_TEXGEN1);
+ ctx->Enabled &= ~(ENABLE_TEXGEN0 | ENABLE_TEXGEN1);
ctx->Texture.ReallyEnabled = 0;
for (i=0; i < MAX_TEXTURE_UNITS; i++) {
gl_update_texture_unit( ctx, &ctx->Texture.Unit[i] );
ctx->Texture.ReallyEnabled |=
- ctx->Texture.Unit[i].ReallyEnabled<<(i*4);
+ ctx->Texture.Unit[i].ReallyEnabled << (i * 4);
if (ctx->Texture.Unit[i].GenFlags != 0) {
ctx->Enabled |= ENABLE_TEXGEN0 << i;
- if (ctx->Texture.Unit[i].GenFlags & TEXGEN_NEED_NORMALS)
- {
+ if (ctx->Texture.Unit[i].GenFlags & TEXGEN_NEED_NORMALS) {
ctx->Texture.NeedNormals = GL_TRUE;
ctx->Texture.NeedEyeCoords = GL_TRUE;
}
- if (ctx->Texture.Unit[i].GenFlags & TEXGEN_NEED_EYE_COORD)
- {
+ if (ctx->Texture.Unit[i].GenFlags & TEXGEN_NEED_EYE_COORD) {
ctx->Texture.NeedEyeCoords = GL_TRUE;
}
}
tObj->Image[level] = texImage;
return;
case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
- tObj->PosX[level] = texImage;
+ tObj->Image[level] = texImage;
return;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
tObj->NegX[level] = texImage;
return ctx->Texture.Proxy3D->Image[level];
case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
if (ctx->Extensions.HaveTextureCubeMap)
- return texUnit->CurrentCubeMap->PosX[level];
+ return texUnit->CurrentCubeMap->Image[level];
else
return NULL;
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
return NULL;
case GL_PROXY_TEXTURE_CUBE_MAP_ARB:
if (ctx->Extensions.HaveTextureCubeMap)
- return ctx->Texture.ProxyCubeMap->PosX[level];
+ return ctx->Texture.ProxyCubeMap->Image[level];
else
return NULL;
default:
}
else if (dimensions == 2) {
isProxy = (GLboolean) (target == GL_PROXY_TEXTURE_2D);
- if (target != GL_TEXTURE_2D && !isProxy) {
+ if (target != GL_TEXTURE_2D && !isProxy &&
+ !(ctx->Extensions.HaveTextureCubeMap &&
+ target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB &&
+ target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) {
gl_error( ctx, GL_INVALID_ENUM, "glTexImage2D(target)" );
return GL_TRUE;
}
return; /* found smallest needed mipmap, all done! */
}
}
+ }
+ else if (t->Dimensions == 6) { /* cube map */
+
+
}
else {
/* Dimensions = ??? */