1848b8605Smrg/* 2848b8605Smrg * Mesa 3-D graphics library 3848b8605Smrg * 4848b8605Smrg * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. 5848b8605Smrg * 6848b8605Smrg * Permission is hereby granted, free of charge, to any person obtaining a 7848b8605Smrg * copy of this software and associated documentation files (the "Software"), 8848b8605Smrg * to deal in the Software without restriction, including without limitation 9848b8605Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10848b8605Smrg * and/or sell copies of the Software, and to permit persons to whom the 11848b8605Smrg * Software is furnished to do so, subject to the following conditions: 12848b8605Smrg * 13848b8605Smrg * The above copyright notice and this permission notice shall be included 14848b8605Smrg * in all copies or substantial portions of the Software. 15848b8605Smrg * 16848b8605Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17848b8605Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18848b8605Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19848b8605Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20848b8605Smrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21848b8605Smrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22848b8605Smrg * OTHER DEALINGS IN THE SOFTWARE. 23848b8605Smrg */ 24848b8605Smrg 25848b8605Smrg 26848b8605Smrg#ifndef _GLAPI_PRIV_H 27848b8605Smrg#define _GLAPI_PRIV_H 28848b8605Smrg 29b8e80941Smrg 30848b8605Smrg#define GL_GLEXT_PROTOTYPES 31848b8605Smrg#include "GL/gl.h" 32848b8605Smrg#include "GL/glext.h" 33848b8605Smrg 34848b8605Smrgtypedef int GLclampx; 35848b8605Smrg 36848b8605Smrg#include "glapi/glapi.h" 37848b8605Smrg 38848b8605Smrg 39b8e80941Smrg#ifdef __cplusplus 40b8e80941Smrgextern "C" { 41b8e80941Smrg#endif 42848b8605Smrg 43848b8605Smrg/* entrypoint */ 44848b8605Smrg 45848b8605Smrgextern void 46848b8605Smrginit_glapi_relocs_once(void); 47848b8605Smrg 48848b8605Smrg 49848b8605Smrgextern _glapi_proc 50848b8605Smrggenerate_entrypoint(unsigned int functionOffset); 51848b8605Smrg 52848b8605Smrg 53848b8605Smrgextern void 54848b8605Smrgfill_in_entrypoint_offset(_glapi_proc entrypoint, unsigned int offset); 55848b8605Smrg 56848b8605Smrg 57848b8605Smrgextern _glapi_proc 58848b8605Smrgget_entrypoint_address(unsigned int functionOffset); 59848b8605Smrg 60848b8605Smrg 61848b8605Smrg/** 62848b8605Smrg * Size (in bytes) of dispatch function (entrypoint). 63848b8605Smrg */ 64848b8605Smrg#if defined(USE_X86_ASM) 65848b8605Smrg# if defined(GLX_USE_TLS) 66848b8605Smrg# define DISPATCH_FUNCTION_SIZE 16 67848b8605Smrg# else 68b8e80941Smrg# define DISPATCH_FUNCTION_SIZE 32 69848b8605Smrg# endif 70848b8605Smrg#endif 71848b8605Smrg 72848b8605Smrg#if defined(USE_X64_64_ASM) 73848b8605Smrg# if defined(GLX_USE_TLS) 74848b8605Smrg# define DISPATCH_FUNCTION_SIZE 16 75848b8605Smrg# endif 76848b8605Smrg#endif 77848b8605Smrg 78848b8605Smrg 79848b8605Smrg/** 80848b8605Smrg * Number of extension functions which we can dynamically add at runtime. 81848b8605Smrg * 82848b8605Smrg * Number of extension functions is also subject to the size of backing exec 83848b8605Smrg * mem we allocate. For the common case of dispatch stubs with size 16 bytes, 84848b8605Smrg * the two limits will be hit simultaneously. For larger dispatch function 85848b8605Smrg * sizes, MAX_EXTENSION_FUNCS is effectively reduced. 86848b8605Smrg */ 87848b8605Smrg#define MAX_EXTENSION_FUNCS 256 88848b8605Smrg 89848b8605Smrg 90b8e80941Smrg#ifdef __cplusplus 91b8e80941Smrg} 92b8e80941Smrg#endif 93b8e80941Smrg 94848b8605Smrg#endif 95