summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2008-09-21 19:29:15 -0700
committerKeith Whitwell <[email protected]>2008-09-21 22:13:52 -0700
commit34a61c66fd1b625a5606b795d192a49632ff1787 (patch)
tree6c185413739b4af3b9790df17dc53a76a32f2312 /src/mesa/main/context.c
parent24172fe595eede2649dd88363d2cda68f928a03e (diff)
mesa: refactor: move #define FEATURE flags into new mfeatures.h file
Also, check the FEATURE flags in many places. (cherry picked from commit 40d1a40f294f1ed2dacfad6f5498322fc08cc2d1) Conflicts: src/mesa/main/config.h src/mesa/main/context.c src/mesa/main/texobj.c src/mesa/main/texstate.c src/mesa/main/texstore.c
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c50
1 files changed, 48 insertions, 2 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index f7202984078..228e77543b1 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -78,27 +78,41 @@
#include "glheader.h"
#include "imports.h"
+#if FEATURE_accum
#include "accum.h"
+#endif
#include "api_exec.h"
#include "arrayobj.h"
+#if FEATURE_attrib_stack
#include "attrib.h"
+#endif
#include "blend.h"
#include "buffers.h"
#include "bufferobj.h"
+#if FEATURE_colortable
#include "colortab.h"
+#endif
#include "context.h"
#include "debug.h"
#include "depth.h"
+#if FEATURE_dlist
#include "dlist.h"
+#endif
+#if FEATURE_evaluators
#include "eval.h"
+#endif
#include "enums.h"
#include "extensions.h"
#include "fbobject.h"
+#if FEATURE_feedback
#include "feedback.h"
+#endif
#include "fog.h"
#include "framebuffer.h"
#include "get.h"
+#if FEATURE_histogram
#include "histogram.h"
+#endif
#include "hint.h"
#include "hash.h"
#include "light.h"
@@ -106,12 +120,16 @@
#include "macros.h"
#include "matrix.h"
#include "multisample.h"
+#if FEATURE_pixel_transfer
#include "pixel.h"
+#endif
#include "pixelstore.h"
#include "points.h"
#include "polygon.h"
#include "queryobj.h"
+#if FEATURE_drawpix
#include "rastpos.h"
+#endif
#include "scissor.h"
#include "simple_list.h"
#include "state.h"
@@ -562,9 +580,11 @@ cleanup:
static void
delete_displaylist_cb(GLuint id, void *data, void *userData)
{
+#if FEATURE_dlist
struct mesa_display_list *list = (struct mesa_display_list *) data;
GLcontext *ctx = (GLcontext *) userData;
_mesa_delete_list(ctx, list);
+#endif
}
/**
@@ -978,32 +998,50 @@ init_attrib_groups(GLcontext *ctx)
_mesa_init_extensions( ctx );
/* Attribute Groups */
+#if FEATURE_accum
_mesa_init_accum( ctx );
+#endif
+#if FEATURE_attrib_stack
_mesa_init_attrib( ctx );
+#endif
_mesa_init_buffer_objects( ctx );
_mesa_init_color( ctx );
+#if FEATURE_colortable
_mesa_init_colortables( ctx );
+#endif
_mesa_init_current( ctx );
_mesa_init_depth( ctx );
_mesa_init_debug( ctx );
+#if FEATURE_dlist
_mesa_init_display_list( ctx );
+#endif
+#if FEATURE_evaluators
_mesa_init_eval( ctx );
+#endif
_mesa_init_fbobjects( ctx );
+#if FEATURE_feedback
_mesa_init_feedback( ctx );
+#endif
_mesa_init_fog( ctx );
+#if FEATURE_histogram
_mesa_init_histogram( ctx );
+#endif
_mesa_init_hint( ctx );
_mesa_init_line( ctx );
_mesa_init_lighting( ctx );
_mesa_init_matrix( ctx );
_mesa_init_multisample( ctx );
+#if FEATURE_pixel_transfer
_mesa_init_pixel( ctx );
+#endif
_mesa_init_pixelstore( ctx );
_mesa_init_point( ctx );
_mesa_init_polygon( ctx );
_mesa_init_program( ctx );
_mesa_init_query( ctx );
+#if FEATURE_drawpix
_mesa_init_rastpos( ctx );
+#endif
_mesa_init_scissor( ctx );
_mesa_init_shader_state( ctx );
_mesa_init_stencil( ctx );
@@ -1014,8 +1052,12 @@ init_attrib_groups(GLcontext *ctx)
if (!_mesa_init_texture( ctx ))
return GL_FALSE;
+#if FEATURE_texture_s3tc
_mesa_init_texture_s3tc( ctx );
+#endif
+#if FEATURE_texture_fxt1
_mesa_init_texture_fxt1( ctx );
+#endif
/* Miscellaneous */
ctx->NewState = _NEW_ALL;
@@ -1169,14 +1211,14 @@ _mesa_initialize_context(GLcontext *ctx,
}
_mesa_init_exec_table(ctx->Exec);
ctx->CurrentDispatch = ctx->Exec;
-#if _HAVE_FULL_GL
+#if FEATURE_dlist
_mesa_init_dlist_table(ctx->Save);
_mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+#endif
/* Neutral tnl module stuff */
_mesa_init_exec_vtxfmt( ctx );
ctx->TnlModule.Current = NULL;
ctx->TnlModule.SwapCount = 0;
-#endif
ctx->FragmentProgram._MaintainTexEnvProgram
= (_mesa_getenv("MESA_TEX_PROG") != NULL);
@@ -1268,11 +1310,15 @@ _mesa_free_context_data( GLcontext *ctx )
_mesa_free_attrib_data(ctx);
_mesa_free_lighting_data( ctx );
+#if FEATURE_evaluators
_mesa_free_eval_data( ctx );
+#endif
_mesa_free_texture_data( ctx );
_mesa_free_matrix_data( ctx );
_mesa_free_viewport_data( ctx );
+#if FEATURE_colortable
_mesa_free_colortables_data( ctx );
+#endif
_mesa_free_program_data(ctx);
_mesa_free_shader_state(ctx);
_mesa_free_query_data(ctx);