#include "glapi.h"
#include "imports.h"
#include "mtypes.h"
Macros for contexts/flushing. | |
| #define | FLUSH_VERTICES(ctx, newstate) |
| Flush vertices. More... | |
| #define | FLUSH_CURRENT(ctx, newstate) |
| Flush current state. More... | |
| #define | ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) |
| Macro to assert that the API call was made outside the glBegin()/glEnd() pair, with return value. More... | |
| #define | ASSERT_OUTSIDE_BEGIN_END(ctx) |
| Macro to assert that the API call was made outside the glBegin()/glEnd() pair. More... | |
| #define | ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx) |
| Macro to assert that the API call was made outside the glBegin()/glEnd() pair and flush the vertices. More... | |
| #define | ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) |
| Macro to assert that the API call was made outside the glBegin()/glEnd() pair and flush the vertices, with return value. More... | |
Create/destroy a GLvisual. | |
| GLvisual * | _mesa_create_visual (GLboolean rgbFlag, GLboolean dbFlag, GLboolean stereoFlag, GLint redBits, GLint greenBits, GLint blueBits, GLint alphaBits, GLint indexBits, GLint depthBits, GLint stencilBits, GLint accumRedBits, GLint accumGreenBits, GLint accumBlueBits, GLint accumAlphaBits, GLint numSamples) |
| Allocates a GLvisual structure and initializes it via _mesa_initialize_visual(). More... | |
| GLboolean | _mesa_initialize_visual (GLvisual *v, GLboolean rgbFlag, GLboolean dbFlag, GLboolean stereoFlag, GLint redBits, GLint greenBits, GLint blueBits, GLint alphaBits, GLint indexBits, GLint depthBits, GLint stencilBits, GLint accumRedBits, GLint accumGreenBits, GLint accumBlueBits, GLint accumAlphaBits, GLint numSamples) |
| Makes some sanity checks and fills in the fields of the GLvisual structure with the given parameters. More... | |
| void | _mesa_destroy_visual (GLvisual *vis) |
| Destroy a visual and free its memory. More... | |
Create/destroy a GLframebuffer. | |
| GLframebuffer * | _mesa_create_framebuffer (const GLvisual *visual, GLboolean softwareDepth, GLboolean softwareStencil, GLboolean softwareAccum, GLboolean softwareAlpha) |
| Allocate a GLframebuffer structure and initializes it via _mesa_initialize_framebuffer(). More... | |
| void | _mesa_initialize_framebuffer (GLframebuffer *fb, const GLvisual *visual, GLboolean softwareDepth, GLboolean softwareStencil, GLboolean softwareAccum, GLboolean softwareAlpha) |
| Makes some sanity checks and fills in the fields of the GLframebuffer structure with the given parameters. More... | |
| void | _mesa_free_framebuffer_data (GLframebuffer *buffer) |
Free the data hanging off of buffer, but not buffer itself. More... | |
| void | _mesa_destroy_framebuffer (GLframebuffer *buffer) |
| Free a framebuffer struct and its buffers. More... | |
Create/destroy a GLcontext. | |
| GLcontext * | _mesa_create_context (const GLvisual *visual, GLcontext *share_list, const struct dd_function_table *driverFunctions, void *driverContext) |
| Allocate and initialize a GLcontext structure. More... | |
| GLboolean | _mesa_initialize_context (GLcontext *ctx, const GLvisual *visual, GLcontext *share_list, const struct dd_function_table *driverFunctions, void *driverContext) |
| Initialize a GLcontext struct (rendering context). More... | |
| void | _mesa_free_context_data (GLcontext *ctx) |
| Free the data associated with the given context. More... | |
| void | _mesa_destroy_context (GLcontext *ctx) |
| Destroy a GLcontext structure. More... | |
| void | _mesa_copy_context (const GLcontext *src, GLcontext *dst, GLuint mask) |
| Copy attribute groups from one context to another. More... | |
| void | _mesa_make_current (GLcontext *ctx, GLframebuffer *buffer) |
| Set the current context, binding the given frame buffer to the context. More... | |
| void | _mesa_make_current2 (GLcontext *ctx, GLframebuffer *drawBuffer, GLframebuffer *readBuffer) |
| Bind the given context to the given draw-buffer and read-buffer and make it the current context for this thread. More... | |
| GLcontext * | _mesa_get_current_context (void) |
| Get current context for the calling thread. More... | |
OpenGL SI-style export functions. | |
| GLboolean | _mesa_destroyContext (__GLcontext *gc) |
| Destroy context callback. More... | |
| GLboolean | _mesa_loseCurrent (__GLcontext *gc) |
| Unbind context callback. More... | |
| GLboolean | _mesa_makeCurrent (__GLcontext *gc) |
| Bind context callback. More... | |
| GLboolean | _mesa_shareContext (__GLcontext *gc, __GLcontext *gcShare) |
| Share context callback. More... | |
| GLboolean | _mesa_copyContext (__GLcontext *dst, const __GLcontext *src, GLuint mask) |
| Copy context callback. More... | |
| GLboolean | _mesa_forceCurrent (__GLcontext *gc) |
| No-op. More... | |
| GLboolean | _mesa_notifyResize (__GLcontext *gc) |
| Windows/buffer resizing notification callback. More... | |
| void | _mesa_notifyDestroy (__GLcontext *gc) |
| Window/buffer destruction notification callback. More... | |
| void | _mesa_notifySwapBuffers (__GLcontext *gc) |
| Swap buffers notification callback. More... | |
| __GLdispatchStateRec * | _mesa_dispatchExec (__GLcontext *gc) |
| No-op. More... | |
| void | _mesa_beginDispatchOverride (__GLcontext *gc) |
| No-op. More... | |
| void | _mesa_endDispatchOverride (__GLcontext *gc) |
| No-op. More... | |
Miscellaneous | |
| void | _mesa_record_error (GLcontext *ctx, GLenum error) |
| Record an error. More... | |
| void GLAPIENTRY | _mesa_Finish (void) |
| Execute glFinish(). More... | |
| void GLAPIENTRY | _mesa_Flush (void) |
| Execute glFlush(). More... | |
Defines | |
| #define | GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_Context |
| Macro for declaration and fetching the current context. More... | |
Functions | |
| _glapi_table * | _mesa_get_dispatch (GLcontext *ctx) |
| Get context's current API dispatch table. More... | |
There are three Mesa data types which are meant to be used by device drivers:
In OOP terms, GLcontext, GLvisual, and GLframebuffer are base classes which the device driver must derive from.
The following functions create and destroy these data types.
|
|
Value: do { \
if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \
_mesa_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
return; \
} \
} while (0)
|
|
|
Value: do { \
ASSERT_OUTSIDE_BEGIN_END(ctx); \
FLUSH_VERTICES(ctx, 0); \
} while (0)
|
|
|
Value: do { \
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval); \
FLUSH_VERTICES(ctx, 0); \
} while (0)
|
|
|
Value: do { \
if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { \
_mesa_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
return retval; \
} \
} while (0)
|
|
|
Value: do { \
if (MESA_VERBOSE & VERBOSE_STATE) \
_mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION); \
if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT) \
ctx->Driver.FlushVertices(ctx, FLUSH_UPDATE_CURRENT); \
ctx->NewState |= newstate; \
} while (0)
newstate. |
|
|
Value: do { \
if (MESA_VERBOSE & VERBOSE_STATE) \
_mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);\
if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) \
ctx->Driver.FlushVertices(ctx, FLUSH_STORED_VERTICES); \
ctx->NewState |= newstate; \
} while (0)
newstate. |
|
|
Macro for declaration and fetching the current context.
...
{
GET_CURRENT_CONTEXT(ctx);
...
|
|
|
Value: (((CTX)->Light.Enabled && \
(CTX)->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) \
|| (CTX)->Fog.ColorSumEnabled \
|| ((CTX)->VertexProgram._Enabled && \
((CTX)->VertexProgram.Current->InputsRead & VERT_BIT_COLOR1)) \
|| ((CTX)->FragmentProgram._Enabled && \
((CTX)->FragmentProgram.Current->InputsRead & FRAG_BIT_COL1)) \
)
|
|
|
Is two-sided lighting in effect?
|
|
|
No-op.
|
|
||||||||||||||||
|
Copy attribute groups from one context to another.
mask, copies the corresponding attributes from src into \dst. For many of the attributes a simple memcpy is not enough due to the existence of internal pointers in their data structures. |
|
||||||||||||||||
|
Copy context callback.
|
|
||||||||||||||||||||
|
Allocate and initialize a GLcontext structure. Note that the driver needs to pass in its dd_function_table here since we need to at least call driverFunctions->NewTextureObject to initialize the rendering context.
|
|
||||||||||||||||||||||||
|
Allocate a GLframebuffer structure and initializes it via _mesa_initialize_framebuffer(). A GLframebuffer is a structure which encapsulates the depth, stencil and accum buffers and related parameters.
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Allocates a GLvisual structure and initializes it via _mesa_initialize_visual().
|
|
|
Destroy a GLcontext structure.
|
|
|
Free a framebuffer struct and its buffers. Calls _mesa_free_framebuffer_data() and frees the structure. |
|
|
Destroy a visual and free its memory.
|
|
|
Destroy context callback.
Frees the context data and the context structure. |
|
|
No-op.
|
|
|
No-op.
|
|
|
Execute glFinish(). Calls the ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the dd_function_table::Finish driver callback, if not NULL. |
|
|
Execute glFlush(). Calls the ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH macro and the dd_function_table::Flush driver callback, if not NULL. |
|
|
No-op.
|
|
|
Free the data associated with the given context. But doesn't free the GLcontext struct itself.
|
|
|
Free the data hanging off of
|
|
|
Get current context for the calling thread.
|
|
|
Get context's current API dispatch table. It'll either be the immediate-mode execute dispatcher or the display list compile dispatcher.
|
|
||||||||||||||||||||||||
|
Initialize a GLcontext struct (rendering context). This includes allocating all the other structs and arrays which hang off of the context by pointers. Note that the driver needs to pass in its dd_function_table here since we need to at least call driverFunctions->NewTextureObject to create the default texture objects. Called by _mesa_create_context().
Performs the imports and exports callback tables initialization, and miscellaneous one-time initializations. If no shared context is supplied one is allocated, and increase its reference count. Setups the GL API dispatch tables. Initialize the TNL module. Sets the maximum Z buffer depth. Finally queries the
|
|
||||||||||||||||||||||||||||
|
Makes some sanity checks and fills in the fields of the GLframebuffer structure with the given parameters.
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Makes some sanity checks and fills in the fields of the GLvisual structure with the given parameters.
|
|
|
Unbind context callback.
No-op |
|
||||||||||||
|
Set the current context, binding the given frame buffer to the context.
buffer as read and write framebuffer. |
|
||||||||||||||||
|
Bind the given context to the given draw-buffer and read-buffer and make it the current context for this thread.
newCtx is not NULL, associates drawBuffer and readBuffer with it and calls dd_function_table::ResizeBuffers if the buffers size has changed. Calls dd_function_table::MakeCurrent callback if defined.
When a context is bound by the first time and the |
|
|
Bind context callback.
No-op |
|
|
Window/buffer destruction notification callback.
No-op |
|
|
Windows/buffer resizing notification callback.
|
|
|
Swap buffers notification callback.
|
|
||||||||||||
|
Record an error.
|
|
||||||||||||
|
Share context callback.
Update the shared context reference count, gl_shared_state::RefCount. |
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001