cr_glstate.h revision 11f375aeb42298e3def991f90f66f69a93d958cc
/* Copyright (c) 2001, Stanford University
* All rights reserved.
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#ifndef CR_GLSTATE_H
#define CR_GLSTATE_H
struct CRContext;
#include "cr_version.h"
#include "state/cr_buffer.h"
#include "state/cr_bufferobject.h"
#include "state/cr_client.h"
#include "state/cr_current.h"
#include "state/cr_evaluators.h"
#include "state/cr_feedback.h"
#include "state/cr_lighting.h"
#include "state/cr_limits.h"
#include "state/cr_lists.h"
#include "state/cr_multisample.h"
#include "state/cr_occlude.h"
#include "state/cr_pixel.h"
#include "state/cr_point.h"
#include "state/cr_polygon.h"
#include "state/cr_program.h"
#include "state/cr_regcombiner.h"
#include "state/cr_stencil.h"
#include "state/cr_texture.h"
#include "state/cr_transform.h"
#include "state/cr_viewport.h"
#include "state/cr_attrib.h"
#include "state/cr_framebuffer.h"
#include "state/cr_statefuncs.h"
#include "state/cr_stateerror.h"
#include "spu_dispatch_table.h"
#ifndef IN_GUEST
#endif
#define CR_MAX_EXTENTS 256
#ifdef __cplusplus
extern "C" {
#endif
/**
* Bit vectors describing GL state
*/
typedef struct {
#ifdef CR_ARB_vertex_buffer_object
#endif
#endif
} CRStateBits;
typedef void (*CRStateFlushFunc)( void *arg );
typedef struct _CRSharedState {
/* Indicates that we have to resend data to GPU on first glMakeCurrent call with owning context */
/**
* Chromium version of the state variables in OpenGL
*/
struct CRContext {
int id;
#ifdef CHROMIUM_THREADSAFE
/* we keep reference counting of context's makeCurrent for different threads
* this is primarily needed to avoid having an invalid memory reference in the TLS
* when the context is assigned to more than one threads and then destroyed from
* one of those, i.e.
* 1. Thread1 -> MakeCurrent(ctx1);
* 2. Thread2 -> MakeCurrent(ctx1);
* 3. Thread1 -> Destroy(ctx1);
* => Thread2 still refers to destroyed ctx1
* */
/* number of threads that have context set as current */
volatile int cRefs;
#endif
void *flush_arg;
#ifdef CR_ARB_vertex_buffer_object
#endif
#endif
#ifdef CR_EXT_framebuffer_object
#endif
#ifdef CR_OPENGL_VERSION_2_0
#endif
/*@{*/
/*@}*/
};
DECLEXPORT(void) crStateInit(void);
DECLEXPORT(void) crStateDestroy(void);
DECLEXPORT(CRContext *) crStateCreateContext(const CRLimitsState *limits, GLint visBits, CRContext *share);
DECLEXPORT(CRContext *) crStateCreateContextEx(const CRLimitsState *limits, GLint visBits, CRContext *share, GLint presetID);
DECLEXPORT(void) crStateUpdateColorBits( void );
#ifndef IN_GUEST
DECLEXPORT(int32_t) crStateLoadContext(CRContext *pContext, CRHashTable * pCtxTable, PSSMHANDLE pSSM);
#endif
/* XXX move these! */
DECLEXPORT(void) STATE_APIENTRY
DECLEXPORT(void) STATE_APIENTRY
DECLEXPORT(void) STATE_APIENTRY
DECLEXPORT(void) STATE_APIENTRY
DECLEXPORT(void) STATE_APIENTRY
#ifdef __cplusplus
}
#endif
#endif /* CR_GLSTATE_H */