summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r--src/mesa/main/texstate.c64
1 files changed, 63 insertions, 1 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index 2284499bf3d..8f4f3631ea7 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -1,4 +1,4 @@
-/* $Id: texstate.c,v 1.75 2002/06/15 03:03:09 brianp Exp $ */
+/* $Id: texstate.c,v 1.76 2002/06/17 23:36:31 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -56,6 +56,68 @@
+void
+_mesa_copy_texture_state( const GLcontext *src, GLcontext *dst )
+{
+ GLuint i;
+
+ ASSERT(src);
+ ASSERT(dst);
+
+ dst->Texture.CurrentUnit = src->Texture.CurrentUnit;
+ dst->Texture._GenFlags = src->Texture._GenFlags;
+ dst->Texture._TexGenEnabled = src->Texture._TexGenEnabled;
+ dst->Texture._TexMatEnabled = src->Texture._TexMatEnabled;
+ dst->Texture.SharedPalette = src->Texture.SharedPalette;
+
+ /* per-unit state */
+ for (i = 0; i < src->Const.MaxTextureUnits; i++) {
+ dst->Texture.Unit[i].Enabled = src->Texture.Unit[i].Enabled;
+ dst->Texture.Unit[i].EnvMode = src->Texture.Unit[i].EnvMode;
+ COPY_4V(dst->Texture.Unit[i].EnvColor, src->Texture.Unit[i].EnvColor);
+ dst->Texture.Unit[i].TexGenEnabled = src->Texture.Unit[i].TexGenEnabled;
+ dst->Texture.Unit[i].GenModeS = src->Texture.Unit[i].GenModeS;
+ dst->Texture.Unit[i].GenModeT = src->Texture.Unit[i].GenModeT;
+ dst->Texture.Unit[i].GenModeR = src->Texture.Unit[i].GenModeR;
+ dst->Texture.Unit[i].GenModeQ = src->Texture.Unit[i].GenModeQ;
+ dst->Texture.Unit[i]._GenBitS = src->Texture.Unit[i]._GenBitS;
+ dst->Texture.Unit[i]._GenBitT = src->Texture.Unit[i]._GenBitT;
+ dst->Texture.Unit[i]._GenBitR = src->Texture.Unit[i]._GenBitR;
+ dst->Texture.Unit[i]._GenBitQ = src->Texture.Unit[i]._GenBitQ;
+ dst->Texture.Unit[i]._GenFlags = src->Texture.Unit[i]._GenFlags;
+ COPY_4V(dst->Texture.Unit[i].ObjectPlaneS, src->Texture.Unit[i].ObjectPlaneS);
+ COPY_4V(dst->Texture.Unit[i].ObjectPlaneT, src->Texture.Unit[i].ObjectPlaneT);
+ COPY_4V(dst->Texture.Unit[i].ObjectPlaneR, src->Texture.Unit[i].ObjectPlaneR);
+ COPY_4V(dst->Texture.Unit[i].ObjectPlaneQ, src->Texture.Unit[i].ObjectPlaneQ);
+ COPY_4V(dst->Texture.Unit[i].EyePlaneS, src->Texture.Unit[i].EyePlaneS);
+ COPY_4V(dst->Texture.Unit[i].EyePlaneT, src->Texture.Unit[i].EyePlaneT);
+ COPY_4V(dst->Texture.Unit[i].EyePlaneR, src->Texture.Unit[i].EyePlaneR);
+ COPY_4V(dst->Texture.Unit[i].EyePlaneQ, src->Texture.Unit[i].EyePlaneQ);
+ dst->Texture.Unit[i].LodBias = src->Texture.Unit[i].LodBias;
+
+ /* GL_EXT_texture_env_combine */
+ dst->Texture.Unit[i].CombineModeRGB = src->Texture.Unit[i].CombineModeRGB;
+ dst->Texture.Unit[i].CombineModeA = src->Texture.Unit[i].CombineModeA;
+ COPY_3V(dst->Texture.Unit[i].CombineSourceRGB, src->Texture.Unit[i].CombineSourceRGB);
+ COPY_3V(dst->Texture.Unit[i].CombineSourceA, src->Texture.Unit[i].CombineSourceA);
+ COPY_3V(dst->Texture.Unit[i].CombineOperandRGB, src->Texture.Unit[i].CombineOperandRGB);
+ COPY_3V(dst->Texture.Unit[i].CombineOperandA, src->Texture.Unit[i].CombineOperandA);
+ dst->Texture.Unit[i].CombineScaleShiftRGB = src->Texture.Unit[i].CombineScaleShiftRGB;
+ dst->Texture.Unit[i].CombineScaleShiftA = src->Texture.Unit[i].CombineScaleShiftA;
+
+ /* texture object state */
+ _mesa_copy_texture_object(dst->Texture.Unit[i].Current1D,
+ src->Texture.Unit[i].Current1D);
+ _mesa_copy_texture_object(dst->Texture.Unit[i].Current2D,
+ src->Texture.Unit[i].Current2D);
+ _mesa_copy_texture_object(dst->Texture.Unit[i].Current3D,
+ src->Texture.Unit[i].Current3D);
+ _mesa_copy_texture_object(dst->Texture.Unit[i].CurrentCubeMap,
+ src->Texture.Unit[i].CurrentCubeMap);
+ }
+}
+
+
/**********************************************************************/
/* Texture Environment */
/**********************************************************************/