X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fcontext.h;h=a66dd507670cd1c365df5c9d2e320a8ab67c56c1;hb=9d36c96d6ec9f2c05c8e0b9ef18c5462cddee8c1;hp=42d98a33a8d6684f911b69827da6752cd9496c05;hpb=cd6a31cd4a9ea6deef4778c2eaef2d47240c3a6e;p=mesa.git diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 42d98a33a8d..a66dd507670 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -30,16 +30,16 @@ * There are three large Mesa data types/classes which are meant to be * used by device drivers: * - struct gl_context: this contains the Mesa rendering state - * - struct gl_config: this describes the color buffer (RGB vs. ci), whether or not - * there's a depth buffer, stencil buffer, etc. - * - struct gl_framebuffer: contains pointers to the depth buffer, stencil buffer, - * accum buffer and alpha buffers. + * - struct gl_config: this describes the color buffer (RGB vs. ci), whether + * or not there's a depth buffer, stencil buffer, etc. + * - struct gl_framebuffer: contains pointers to the depth buffer, stencil + * buffer, accum buffer and alpha buffers. * * These types should be encapsulated by corresponding device driver * data types. See xmesa.h and xmesaP.h for an example. * - * In OOP terms, struct gl_context, struct gl_config, and struct gl_framebuffer are base classes - * which the device driver must derive from. + * In OOP terms, struct gl_context, struct gl_config, and struct gl_framebuffer + * are base classes which the device driver must derive from. * * The following functions create and destroy these data types. */ @@ -53,6 +53,11 @@ #include "mtypes.h" +#ifdef __cplusplus +extern "C" { +#endif + + struct _glapi_table; @@ -99,33 +104,20 @@ _mesa_destroy_visual( struct gl_config *vis ); /** \name Context-related functions */ /*@{*/ -extern struct gl_context * -_mesa_create_context( const struct gl_config *visual, - struct gl_context *share_list, - const struct dd_function_table *driverFunctions, - void *driverContext ); - extern GLboolean _mesa_initialize_context( struct gl_context *ctx, + gl_api api, const struct gl_config *visual, struct gl_context *share_list, const struct dd_function_table *driverFunctions, void *driverContext ); extern struct gl_context * -_mesa_create_context_for_api(gl_api api, - const struct gl_config *visual, - struct gl_context *share_list, - const struct dd_function_table *driverFunctions, - void *driverContext); - -extern GLboolean -_mesa_initialize_context_for_api(struct gl_context *ctx, - gl_api api, - const struct gl_config *visual, - struct gl_context *share_list, - const struct dd_function_table *driverFunctions, - void *driverContext); +_mesa_create_context(gl_api api, + const struct gl_config *visual, + struct gl_context *share_list, + const struct dd_function_table *driverFunctions, + void *driverContext); extern void _mesa_free_context_data( struct gl_context *ctx ); @@ -246,7 +238,7 @@ do { \ * glBegin()/glEnd() pair, with return value. * * \param ctx GL context. - * \param retval value to return value in case the assertion fails. + * \param retval value to return in case the assertion fails. */ #define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval) \ do { \ @@ -287,7 +279,7 @@ do { \ * 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. + * \param retval value to return in case the assertion fails. */ #define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \ do { \ @@ -298,29 +290,9 @@ do { \ /*@}*/ - -/** - * Is the secondary color needed? - */ -#define NEED_SECONDARY_COLOR(CTX) \ - (((CTX)->Light.Enabled && \ - (CTX)->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR) \ - || (CTX)->Fog.ColorSumEnabled \ - || ((CTX)->VertexProgram._Current && \ - ((CTX)->VertexProgram._Current != (CTX)->VertexProgram._TnlProgram) && \ - ((CTX)->VertexProgram._Current->Base.InputsRead & VERT_BIT_COLOR1)) \ - || ((CTX)->FragmentProgram._Current && \ - ((CTX)->FragmentProgram._Current != (CTX)->FragmentProgram._TexEnvProgram) && \ - ((CTX)->FragmentProgram._Current->Base.InputsRead & FRAG_BIT_COL1)) \ - ) - - -/** - * Is RGBA LogicOp enabled? - */ -#define RGBA_LOGICOP_ENABLED(CTX) \ - ((CTX)->Color.ColorLogicOpEnabled || \ - ((CTX)->Color.BlendEnabled && (CTX)->Color.BlendEquationRGB == GL_LOGIC_OP)) +#ifdef __cplusplus +} +#endif #endif /* CONTEXT_H */