summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.h
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>1999-12-17 14:52:35 +0000
committerBrian Paul <[email protected]>1999-12-17 14:52:35 +0000
commit0003778847df6adb792f453df83808fefa560f18 (patch)
tree2647b24bb9fa898f5c7e90def027cfcc8a8bf98b /src/mesa/main/context.h
parent8f91fb630c3292c6294384783d02e2e7402fc778 (diff)
further simplification of thread-related code, misc clean-up
Diffstat (limited to 'src/mesa/main/context.h')
-rw-r--r--src/mesa/main/context.h55
1 files changed, 28 insertions, 27 deletions
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 76ac1bb327a..57c209aae9f 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -1,4 +1,4 @@
-/* $Id: context.h,v 1.6 1999/12/17 12:21:39 brianp Exp $ */
+/* $Id: context.h,v 1.7 1999/12/17 14:52:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -29,6 +29,7 @@
#define CONTEXT_H
+#include "glapi.h"
#include "types.h"
@@ -73,6 +74,21 @@ extern void gl_destroy_visual( GLvisual *vis );
/*
+ * Create/destroy a GLframebuffer. A GLframebuffer is like a GLX drawable.
+ * It bundles up the depth buffer, stencil buffer and accum buffers into a
+ * single entity.
+ */
+extern GLframebuffer *gl_create_framebuffer( GLvisual *visual,
+ GLboolean softwareDepth,
+ GLboolean softwareStencil,
+ GLboolean softwareAccum,
+ GLboolean softwareAlpha );
+
+extern void gl_destroy_framebuffer( GLframebuffer *buffer );
+
+
+
+/*
* Create/destroy a GLcontext. A GLcontext is like a GLX context. It
* contains the rendering state.
*/
@@ -92,36 +108,24 @@ extern void gl_context_initialize( GLcontext *ctx );
extern void gl_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask);
-/*
- * Create/destroy a GLframebuffer. A GLframebuffer is like a GLX drawable.
- * It bundles up the depth buffer, stencil buffer and accum buffers into a
- * single entity.
- */
-extern GLframebuffer *gl_create_framebuffer( GLvisual *visual,
- GLboolean softwareDepth,
- GLboolean softwareStencil,
- GLboolean softwareAccum,
- GLboolean softwareAlpha );
-
-extern void gl_destroy_framebuffer( GLframebuffer *buffer );
-
-
-
extern void gl_make_current( GLcontext *ctx, GLframebuffer *buffer );
+
extern void gl_make_current2( GLcontext *ctx, GLframebuffer *drawBuffer,
GLframebuffer *readBuffer );
-extern GLcontext *gl_get_current_context(void);
+extern GLcontext *gl_get_current_context(void);
-#ifdef THREADS
/*
- * A seperate GLcontext for each thread
+ * Macros for fetching current context, input buffer, etc.
*/
-#define GET_CURRENT_CONTEXT(C) GLcontext *C = gl_get_current_context()
-#define GET_IMMEDIATE struct immediate *IM = (gl_get_current_context())->input;
+#ifdef THREADS
+
+#define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_ThreadSafe ? _glapi_get_current_context() : _glapi_CurrentContext)
+
+#define GET_IMMEDIATE struct immediate *IM = ((GLcontext *) _glapi_get_current_context())->input;
#define SET_IMMEDIATE(ctx, im) \
do { \
ctx->input = im; \
@@ -129,12 +133,8 @@ do { \
#else
-/*
- * All threads use same pointer to current context.
- */
-extern GLcontext *_mesa_current_context;
extern struct immediate *CURRENT_INPUT;
-#define GET_CURRENT_CONTEXT(C) GLcontext *C = _mesa_current_context
+#define GET_CURRENT_CONTEXT(C) GLcontext *C = _glapi_CurrentContext
#define GET_IMMEDIATE struct immediate *IM = CURRENT_INPUT
#define SET_IMMEDIATE(ctx, im) \
do { \
@@ -149,6 +149,7 @@ do { \
extern void
_mesa_swapbuffers(GLcontext *ctx);
+
extern struct _glapi_table *
_mesa_get_dispatch(GLcontext *ctx);
@@ -170,8 +171,8 @@ extern void gl_problem( const GLcontext *ctx, const char *s );
extern void gl_warning( const GLcontext *ctx, const char *s );
extern void gl_error( GLcontext *ctx, GLenum error, const char *s );
-extern void gl_compile_error( GLcontext *ctx, GLenum error, const char *s );
+extern void gl_compile_error( GLcontext *ctx, GLenum error, const char *s );
extern void gl_update_state( GLcontext *ctx );