Move macros from header to C file. Updated some comments
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 18 Sep 2003 17:00:14 +0000 (17:00 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 18 Sep 2003 17:00:14 +0000 (17:00 +0000)
src/mesa/main/dlist.c
src/mesa/main/dlist.h

index 6282b5b4147f6439d78deebd1be933a67bb5e4bf..3a241448d0d3d91d1a7839fcdb5330cff502cdea 100644 (file)
 
 
 /**
- * Functions which aren't compiled but executed immediately:
- * - glIsList
- * - glGenLists
- * - glDeleteLists
- * - glEndList  --- BUT:  call ctx->Driver.EndList at end of list execution?
- * - glFeedbackBuffer
- * - glSelectBuffer
- * - glRenderMode
- * - glReadPixels
- * - glPixelStore
- * - glFlush
- * - glFinish
- * - glIsEnabled
- * - glGet*
- *
- * Functions which cause errors if called while compiling a display list:
- *  - glNewList
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair, with return value.
+ * 
+ * \param ctx GL context.
+ * \param retval value to return value in case the assertion fails.
  */
-
-
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval)         \
+do {                                                                   \
+   if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON ||               \
+       ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
+      _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" );   \
+      return retval;                                                   \
+   }                                                                   \
+} while (0)
 
 /**
- * Display list instructions are stored as sequences of "nodes".  Nodes
- * are allocated in blocks.  Each block has BLOCK_SIZE nodes.  Blocks
- * are linked together with a pointer.
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair.
+ * 
+ * \param ctx GL context.
  */
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx)                             \
+do {                                                                   \
+   if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON ||               \
+       ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
+      _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" );   \
+      return;                                                          \
+   }                                                                   \
+} while (0)
 
+/**
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair and flush the vertices.
+ * 
+ * \param ctx GL context.
+ */
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx)                   \
+do {                                                                   \
+   ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx);                                 \
+   FLUSH_VERTICES(ctx, 0);                                             \
+} while (0)
 
 /**
- * How many nodes to allocate at a time.
- *
- * \note Reduced now that we hold vertices etc. elsewhere.
+ * Macro to assert that the API call was made outside the
+ * glBegin()/glEnd() pair and flush the vertices, with return value.
+ * 
+ * \param ctx GL context.
+ * \param retval value to return value in case the assertion fails.
  */
-#define BLOCK_SIZE 256
+#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
+do {                                                                   \
+   ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval);             \
+   FLUSH_VERTICES(ctx, 0);                                             \
+} while (0)
+
 
 
 /**
@@ -281,9 +302,14 @@ typedef enum {
 } OpCode;
 
 
+
 /**
  * Display list node.
  *
+ * Display list instructions are stored as sequences of "nodes".  Nodes
+ * are allocated in blocks.  Each block has BLOCK_SIZE nodes.  Blocks
+ * are linked together with a pointer.
+ *
  * Each instruction in the display list is stored as a sequence of
  * contiguous nodes in memory.
  * Each node is the union of a variety of data types.
@@ -304,6 +330,15 @@ union node {
 };
 
 
+/**
+ * How many nodes to allocate at a time.
+ *
+ * \note Reduced now that we hold vertices etc. elsewhere.
+ */
+#define BLOCK_SIZE 256
+
+
+
 /**
  * Number of nodes of storage needed for each instruction.
  * Sizes for dynamically allocated opcodes are stored in the context struct.
index b8d115cd8297a27bece00e9b8e6d789cfc9be6ef..945cebbaab9cc2c6497006539affb5a39080471a 100644 (file)
@@ -5,9 +5,9 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  4.1
+ * Version:  5.1
  *
- * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
 #include "mtypes.h"
 
 
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair, with return value.
- * 
- * \param ctx GL context.
- * \param retval value to return value in case the assertion fails.
- */
-#define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval)         \
-do {                                                                   \
-   if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON ||               \
-       ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
-      _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" );   \
-      return retval;                                                   \
-   }                                                                   \
-} while (0)
-
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair.
- * 
- * \param ctx GL context.
- */
-#define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx)                             \
-do {                                                                   \
-   if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON ||               \
-       ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
-      _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" );   \
-      return;                                                          \
-   }                                                                   \
-} while (0)
-
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair and flush the vertices.
- * 
- * \param ctx GL context.
- */
-#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx)                   \
-do {                                                                   \
-   ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx);                                 \
-   FLUSH_VERTICES(ctx, 0);                                             \
-} while (0)
-
-/**
- * Macro to assert that the API call was made outside the
- * glBegin()/glEnd() pair and flush the vertices, with return value.
- * 
- * \param ctx GL context.
- * \param retval value to return value in case the assertion fails.
- */
-#define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
-do {                                                                   \
-   ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval);             \
-   FLUSH_VERTICES(ctx, 0);                                             \
-} while (0)
-
-
 #if _HAVE_FULL_GL
 
 extern void _mesa_init_lists( void );