summaryrefslogtreecommitdiff
path: root/src/mesa/main/dlist.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2003-07-17 13:43:59 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2003-07-17 13:43:59 +0000
commit6dc85575000127630489b407c50a4b3ea87c9acb (patch)
treec79b24b7059577caf8201eeb7a42a6890721f52b /src/mesa/main/dlist.c
parent44c699949ac09459771304a8aec8f2fc622057fb (diff)
Merge Jose's documentation and core Mesa changes from embedded branch
Diffstat (limited to 'src/mesa/main/dlist.c')
-rw-r--r--src/mesa/main/dlist.c102
1 files changed, 64 insertions, 38 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 8513b45801..928b74cb54 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1,3 +1,8 @@
+/**
+ * \file dlist.c
+ * Display lists management functions.
+ */
+
/*
* Mesa 3-D graphics library
* Version: 5.1
@@ -22,6 +27,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+
#include "glheader.h"
#include "imports.h"
#include "api_loopback.h"
@@ -72,47 +78,48 @@
-/*
-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
-*/
+/**
+ * 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
+ */
-/*
+/**
* 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.
*/
-/* How many nodes to allocate at a time:
- * - reduced now that we hold vertices etc. elsewhere.
+/**
+ * How many nodes to allocate at a time.
+ *
+ * \note Reduced now that we hold vertices etc. elsewhere.
*/
#define BLOCK_SIZE 256
-/*
+/**
* Display list opcodes.
*
* The fact that these identifiers are assigned consecutive
* integer values starting at 0 is very important, see InstSize array usage)
- *
*/
typedef enum {
OPCODE_ACCUM,
@@ -265,10 +272,12 @@ typedef enum {
} OpCode;
-/*
+/**
+ * Display list node.
+ *
* 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 datatypes.
+ * Each node is the union of a variety of data types.
*/
union node {
OpCode opcode;
@@ -286,9 +295,9 @@ union node {
};
-
-/* Number of nodes of storage needed for each instruction. Sizes for
- * dynamically allocated opcodes are stored in the context struct.
+/**
+ * Number of nodes of storage needed for each instruction.
+ * Sizes for dynamically allocated opcodes are stored in the context struct.
*/
static GLuint InstSize[ OPCODE_END_OF_LIST+1 ];
@@ -299,10 +308,6 @@ void mesa_print_display_list( GLuint list );
/***** Private *****/
/**********************************************************************/
-
-
-
-
/*
* Make an empty display list. This is used by glGenLists() to
* reserver display list IDs.
@@ -318,7 +323,7 @@ static Node *make_empty_list( void )
/*
* Destroy all nodes in a display list.
- * Input: list - display list number
+ * \param list - display list number
*/
void _mesa_destroy_list( GLcontext *ctx, GLuint list )
{
@@ -682,9 +687,9 @@ void _mesa_init_lists( void )
/*
* Allocate space for a display list instruction.
- * Input: opcode - type of instruction
+ * \param opcode - type of instruction
* argcount - size in bytes of data required.
- * Return: pointer to the usable data area (not including the internal
+ * \return pointer to the usable data area (not including the internal
* opcode).
*/
void *
@@ -4444,7 +4449,7 @@ islist(GLcontext *ctx, GLuint list)
* Execute a display list. Note that the ListBase offset must have already
* been added before calling this function. I.e. the list argument is
* the absolute list number, not relative to ListBase.
- * Input: list - display list number
+ * \param list - display list number
*/
static void
execute_list( GLcontext *ctx, GLuint list )
@@ -4515,7 +4520,7 @@ execute_list( GLcontext *ctx, GLuint list )
case OPCODE_CALL_LIST_OFFSET:
/* Generated by glCallLists() so we must add ListBase */
if (n[2].b) {
- /* user specified a bad datatype at compile time */
+ /* user specified a bad data type at compile time */
_mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
}
else if (ctx->CallDepth < MAX_LIST_NESTING) {
@@ -6785,3 +6790,24 @@ void mesa_print_display_list( GLuint list )
GET_CURRENT_CONTEXT(ctx);
print_list( ctx, list );
}
+
+
+/**********************************************************************/
+/***** Initialization *****/
+/**********************************************************************/
+
+void _mesa_init_display_list( GLcontext * ctx )
+{
+ /* Display list */
+ ctx->CallDepth = 0;
+ ctx->ExecuteFlag = GL_TRUE;
+ ctx->CompileFlag = GL_FALSE;
+ ctx->CurrentListPtr = NULL;
+ ctx->CurrentBlock = NULL;
+ ctx->CurrentListNum = 0;
+ ctx->CurrentPos = 0;
+
+ /* Display List group */
+ ctx->List.ListBase = 0;
+
+}