chromium.h revision c62d2520ac91e12cf4665c936f490dd2064152d3
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Copyright (c) 2001, Stanford University
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * All rights reserved.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * See the file LICENSE.txt for information on redistributing this software.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Public Chromium exports.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Parallel Chromium applications will include this header.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/**********************************************************************/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/***** System includes and other cruft *****/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/**********************************************************************/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * We effectively wrap gl.h, glu.h, etc, just like GLUT
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* nothing */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#include <malloc.h> /* to get ptrdiff_t used below */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern "C" {
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/**********************************************************************/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/***** Define things that might have been missing in gl.h *****/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/**********************************************************************/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Define missing GLX tokens:
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define GLX_VISUAL_CAVEAT_EXT 0x20 /* visual_rating extension type */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Define missing WGL tokens:
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Define missing 1.2 tokens:
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Define missing ARB_imaging tokens
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (*CR_GLXFuncPtr)();
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncCR_GLXFuncPtr glXGetProcAddressARB( const GLubyte *name );
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GLX_ARB_get_proc_address */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncCR_GLXFuncPtr glXGetProcAddress( const GLubyte *name );
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GLX_ARB_get_proc_address */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* XXX how about this prototype for wglGetProcAddress()?
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncPROC WINAPI wglGetProcAddress_prox( LPCSTR name )
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* prototype these functions for opengl_stub/getprocaddress.c */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glGenQueries(GLsizei n, GLuint *ids);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glDeleteQueries(GLsizei n, const GLuint *ids);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glBeginQuery(GLenum target, GLuint id);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glGetQueryiv(GLenum target, GLenum pname, GLint *params);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glGetQueryObjectiv(GLuint id, GLenum pname, GLint *params);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glGetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glDeleteBuffers(GLsizei, const GLuint *);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glGenBuffers(GLsizei, GLuint *);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glBufferData(GLenum, GLsizeiptr, const GLvoid *, GLenum);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glBufferSubData(GLenum, GLintptr, GLsizeiptr, const GLvoid *);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glGetBufferSubData(GLenum, GLintptr, GLsizeiptr, GLvoid *);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern GLvoid* APIENTRY glMapBuffer(GLenum, GLenum);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glGetBufferParameteriv(GLenum, GLenum, GLint *);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glGetBufferPointerv(GLenum, GLenum, GLvoid* *);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/**********************************************************************/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/***** Chromium Extensions to OpenGL *****/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/***** *****/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/***** Chromium owns the OpenGL enum range 0x8AF0-0x8B2F *****/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/**********************************************************************/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glBarrierCreateCRProc) (GLuint name, GLuint count);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glBarrierDestroyCRProc) (GLuint name);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glBarrierExecCRProc) (GLuint name);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glSemaphoreCreateCRProc) (GLuint name, GLuint count);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glSemaphoreDestroyCRProc) (GLuint name);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glSemaphorePCRProc) (GLuint name);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glSemaphoreVCRProc) (GLuint name);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glBarrierCreateCR(GLuint name, GLuint count);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glBarrierDestroyCR(GLuint name);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glSemaphoreCreateCR(GLuint name, GLuint count);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glSemaphoreDestroyCR(GLuint name);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_synchronization */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Private, internal Chromium function */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glBoundsInfoCRProc)(const CRrecti *, const GLbyte *, GLint, GLint);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_bounds_info */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glChromiumParameteriCRProc) (GLenum target, GLint value);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glChromiumParameterfCRProc) (GLenum target, GLfloat value);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glChromiumParametervCRProc) (GLenum target, GLenum type, GLsizei count, const GLvoid *values);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *glGetChromiumParametervCRProc) (GLenum target, GLuint index, GLenum type, GLsizei count, GLvoid *values);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glChromiumParameteriCR(GLenum target, GLint value);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glChromiumParameterfCR(GLenum target, GLfloat value);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glChromiumParametervCR(GLenum target, GLenum type, GLsizei count, const GLvoid *values);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glGetChromiumParametervCR(GLenum target, GLuint index, GLenum type, GLsizei count, GLvoid *values);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_state_parameter */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* For virtual cursor feature (show_cursor) */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_cursor_position */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* To set bounding box from client app */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_bounding_box */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* To print a string to stdout */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_print_string */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* To query tilesort information */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_tilesort_info */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* To fetch name of first SPU on a node */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_head_spu_name */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* For gathering performance metrics */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_performance_info */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* To communicate window size changes */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_window_size */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* To send new tile information to a server */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_tile_info */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* For aggregate transfers */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_gather */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_saveframe */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_readback_barrier_size */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_server_id_sharing */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_server_matrix */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_window_position */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* XXX A better name would be glCompressedDrawPixelsCR() */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY glZPixCR(GLsizei width, GLsizei height, GLenum format,
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* GL_CR_zpix */
0a08bb004c627770553912c3b340c66c63ae1ac3vboxsync/*Allow to use glGetString to query real host GPU info*/
c62d2520ac91e12cf4665c936f490dd2064152d3vboxsync/*Global resource ids sharing*/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/**********************************************************************/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/***** Chromium-specific API *****/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/**********************************************************************/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Accepted by crCreateContext() and crCreateWindow() visBits parameter.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * Used to communicate visual attributes throughout Chromium.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Accepted by crSwapBuffers() flag parameter */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef GLint (APIENTRY *crCreateContextProc)(const char *dpyName, GLint visBits);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *crDestroyContextProc)(GLint context);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *crMakeCurrentProc)(GLint window, GLint context);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef GLint (APIENTRY *crGetCurrentContextProc)(void);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef GLint (APIENTRY *crGetCurrentWindowProc)(void);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *crSwapBuffersProc)(GLint window, GLint flags);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef GLint (APIENTRY *crWindowCreateProc)(const char *dpyName, GLint visBits);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *crWindowDestroyProc)(GLint window);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *crWindowSizeProc)(GLint window, GLint w, GLint h);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *crWindowPositionProc)(GLint window, GLint x, GLint y);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynctypedef void (APIENTRY *crWindowShowProc)( GLint window, GLint flag );
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern GLint APIENTRY crCreateContext(const char *dpyName, GLint visBits);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY crDestroyContext(GLint context);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY crMakeCurrent(GLint window, GLint context);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY crSwapBuffers(GLint window, GLint flags);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern GLint APIENTRY crWindowCreate(const char *dpyName, GLint visBits);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY crWindowSize(GLint window, GLint w, GLint h);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY crWindowPosition(GLint window, GLint x, GLint y);
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY crWindowVisibleRegion( GLint window, GLint cRects, void *pRects );
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncextern void APIENTRY crWindowShow( GLint window, GLint flag );
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncCR_PROC APIENTRY crGetProcAddress( const char *name );
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/**********************************************************************/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/***** Other useful stuff *****/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/**********************************************************************/
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define GET_PROC(NAME) wglGetProcAddress((const GLbyte *) (NAME))
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#define GET_PROC(NAME) glXGetProcAddressARB((const GLubyte *) (NAME))
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* For SGI, etc that don't have glXGetProcAddress(). */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync#endif /* __CHROMIUM_H__ */