summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/arbprogram.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2003-07-22 03:51:46 +0000
committerBrian Paul <[email protected]>2003-07-22 03:51:46 +0000
commit05944c031cd6bea985050f0e88a19f0794f57887 (patch)
tree23b1def1e5c7fe1efe19deb67c366f811e21cdc0 /src/mesa/main/arbprogram.c
parentf7fda86c6dcb7894157bd35a0cf15d003d48b441 (diff)
Restore more code lost during last big merge.
Rename colortable-related functions.
Diffstat (limited to 'src/mesa/main/arbprogram.c')
-rw-r--r--src/mesa/main/arbprogram.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c
index 24ab8a1035f..cd441f8e13e 100644
--- a/src/mesa/main/arbprogram.c
+++ b/src/mesa/main/arbprogram.c
@@ -60,6 +60,39 @@ _mesa_parse_arb_fragment_program(GLcontext *ctx, GLenum target,
}
+/*
+ * Init context's program state
+ */
+void
+_mesa_init_program(GLcontext *ctx)
+{
+ GLuint i;
+
+ ctx->Program.ErrorPos = -1;
+ ctx->Program.ErrorString = _mesa_strdup("");
+
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
+ ctx->VertexProgram.Enabled = GL_FALSE;
+ ctx->VertexProgram.PointSizeEnabled = GL_FALSE;
+ ctx->VertexProgram.TwoSideEnabled = GL_FALSE;
+ ctx->VertexProgram.Current = NULL;
+ ctx->VertexProgram.Current = (struct vertex_program *) ctx->Shared->DefaultVertexProgram;
+ assert(ctx->VertexProgram.Current);
+ ctx->VertexProgram.Current->Base.RefCount++;
+ for (i = 0; i < VP_NUM_PROG_REGS / 4; i++) {
+ ctx->VertexProgram.TrackMatrix[i] = GL_NONE;
+ ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV;
+ }
+#endif
+
+#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
+ ctx->FragmentProgram.Enabled = GL_FALSE;
+ ctx->FragmentProgram.Current = (struct fragment_program *) ctx->Shared->DefaultFragmentProgram;
+ assert(ctx->FragmentProgram.Current);
+ ctx->FragmentProgram.Current->Base.RefCount++;
+#endif
+}
+
void
_mesa_EnableVertexAttribArrayARB(GLuint index)