Browse Source

renamed _glapi_CurrentContext to _glapi_Context

tags/mesa_3_3
Brian Paul 25 years ago
parent
commit
f9b97d95f9
4 changed files with 22 additions and 21 deletions
  1. 9
    9
      src/mesa/glapi/glapi.c
  2. 4
    4
      src/mesa/glapi/glapi.h
  3. 5
    4
      src/mesa/main/context.c
  4. 4
    4
      src/mesa/main/context.h

+ 9
- 9
src/mesa/glapi/glapi.c View File

@@ -1,4 +1,4 @@
/* $Id: glapi.c,v 1.28 2000/01/28 19:03:33 brianp Exp $ */
/* $Id: glapi.c,v 1.29 2000/01/28 20:17:42 brianp Exp $ */

/*
* Mesa 3-D graphics library
@@ -58,7 +58,7 @@
struct _glapi_table *_glapi_Dispatch = &__glapi_noop_table;

/* Used when thread safety disabled */
void *_glapi_CurrentContext = NULL;
void *_glapi_Context = NULL;


#if defined(THREADS)
@@ -127,16 +127,16 @@ _glapi_check_multithread(void)
* void from the real context pointer type.
*/
void
_glapi_set_current_context(void *context)
_glapi_set_context(void *context)
{
#if defined(THREADS)
_glthread_SetTSD(&ContextTSD, context, context_thread_init);
if (ThreadSafe)
_glapi_CurrentContext = NULL;
_glapi_Context = NULL;
else
_glapi_CurrentContext = context;
_glapi_Context = context;
#else
_glapi_CurrentContext = context;
_glapi_Context = context;
#endif
}

@@ -148,17 +148,17 @@ _glapi_set_current_context(void *context)
* void to the real context pointer type.
*/
void *
_glapi_get_current_context(void)
_glapi_get_context(void)
{
#if defined(THREADS)
if (ThreadSafe) {
return _glthread_GetTSD(&ContextTSD);
}
else {
return _glapi_CurrentContext;
return _glapi_Context;
}
#else
return _glapi_CurrentContext;
return _glapi_Context;
#endif
}


+ 4
- 4
src/mesa/glapi/glapi.h View File

@@ -1,4 +1,4 @@
/* $Id: glapi.h,v 1.13 2000/01/17 19:28:43 brianp Exp $ */
/* $Id: glapi.h,v 1.14 2000/01/28 20:17:42 brianp Exp $ */

/*
* Mesa 3-D graphics library
@@ -34,7 +34,7 @@
struct _glapi_table;


extern void *_glapi_CurrentContext;
extern void *_glapi_Context;

extern struct _glapi_table *_glapi_Dispatch;

@@ -44,11 +44,11 @@ _glapi_check_multithread(void);


extern void
_glapi_set_current_context(void *context);
_glapi_set_context(void *context);


extern void *
_glapi_get_current_context(void);
_glapi_get_context(void);


extern void

+ 5
- 4
src/mesa/main/context.c View File

@@ -1,4 +1,4 @@
/* $Id: context.c,v 1.35 2000/01/28 19:02:22 brianp Exp $ */
/* $Id: context.c,v 1.36 2000/01/28 20:17:42 brianp Exp $ */

/*
* Mesa 3-D graphics library
@@ -43,6 +43,7 @@
#include "fog.h"
#include "get.h"
#include "glapi.h"
#include "glapinoop.h"
#include "hash.h"
#include "light.h"
#include "lines.h"
@@ -1619,7 +1620,7 @@ void gl_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
GLframebuffer *readBuffer )
{
#if 0
GLcontext *oldCtx = gl_get_current_context();
GLcontext *oldCtx = gl_get_context();

/* Flush the old context
*/
@@ -1641,7 +1642,7 @@ void gl_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
*/
_glapi_check_multithread();

_glapi_set_current_context((void *) newCtx);
_glapi_set_context((void *) newCtx);
ASSERT(gl_get_current_context() == newCtx);
if (newCtx) {
SET_IMMEDIATE(newCtx, newCtx->input);
@@ -1696,7 +1697,7 @@ void gl_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer,
*/
GLcontext *gl_get_current_context( void )
{
return (GLcontext *) _glapi_get_current_context();
return (GLcontext *) _glapi_get_context();
}



+ 4
- 4
src/mesa/main/context.h View File

@@ -1,4 +1,4 @@
/* $Id: context.h,v 1.11 2000/01/18 17:36:16 brianp Exp $ */
/* $Id: context.h,v 1.12 2000/01/28 20:17:42 brianp Exp $ */

/*
* Mesa 3-D graphics library
@@ -129,9 +129,9 @@ extern GLcontext *gl_get_current_context(void);
*/
#ifdef THREADS

#define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_CurrentContext ? _glapi_CurrentContext : _glapi_get_current_context())
#define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context())

#define GET_IMMEDIATE struct immediate *IM = ((GLcontext *) (_glapi_CurrentContext ? _glapi_CurrentContext : _glapi_get_current_context()))->input
#define GET_IMMEDIATE struct immediate *IM = ((GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context()))->input

#define SET_IMMEDIATE(ctx, im) \
do { \
@@ -142,7 +142,7 @@ do { \

extern struct immediate *_mesa_CurrentInput;

#define GET_CURRENT_CONTEXT(C) GLcontext *C = _glapi_CurrentContext
#define GET_CURRENT_CONTEXT(C) GLcontext *C = _glapi_Context

#define GET_IMMEDIATE struct immediate *IM = _mesa_CurrentInput


Loading…
Cancel
Save