-/* $Id: attrib.c,v 1.54 2001/08/07 21:46:52 brianp Exp $ */
+/* $Id: attrib.c,v 1.55 2001/08/07 23:10:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
#include "polygon.h"
#include "simple_list.h"
#include "stencil.h"
+#include "texobj.h"
#include "texstate.h"
#include "mtypes.h"
#endif
copy_texobj_state( struct gl_texture_object *dest,
const struct gl_texture_object *src )
{
- /*
dest->Name = src->Name;
+ /*
dest->Dimensions = src->Dimensions;
*/
dest->Priority = src->Priority;
{
GLuint u;
- /* "un-bump" the texture object reference counts. We did that so they
- * wouldn't inadvertantly get deleted.
- */
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
- ctx->Texture.Unit[u].Current1D->RefCount--;
- ctx->Texture.Unit[u].Current2D->RefCount--;
- ctx->Texture.Unit[u].Current3D->RefCount--;
- ctx->Texture.Unit[u].CurrentCubeMap->RefCount--;
- }
-
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
const struct gl_texture_unit *unit = &texAttrib->Unit[u];
GLuint numObjs, i;
; /* silence warnings */
}
+ _mesa_BindTexture(target, obj->Name);
+
bordColor[0] = CHAN_TO_FLOAT(obj->BorderColor[0]);
bordColor[1] = CHAN_TO_FLOAT(obj->BorderColor[1]);
bordColor[2] = CHAN_TO_FLOAT(obj->BorderColor[2]);
}
_mesa_ActiveTextureARB(GL_TEXTURE0_ARB
+ texAttrib->CurrentUnit);
+
+ /* "un-bump" the texture object reference counts. We did that so they
+ * wouldn't inadvertantly get deleted while they were still referenced
+ * inside the attribute state stack.
+ */
+ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
+ ctx->Texture.Unit[u].Current1D->RefCount--;
+ ctx->Texture.Unit[u].Current2D->RefCount--;
+ ctx->Texture.Unit[u].Current3D->RefCount--;
+ ctx->Texture.Unit[u].CurrentCubeMap->RefCount--;
+ }
}