glxclient.h revision daf7fe69f7bd0caa955d30b43fc35b7ce0069b6b
1cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* 2dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) 3dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. 4dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * 5dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * Permission is hereby granted, free of charge, to any person obtaining a 6dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * copy of this software and associated documentation files (the "Software"), 7dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * to deal in the Software without restriction, including without limitation 8dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * and/or sell copies of the Software, and to permit persons to whom the 10dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * Software is furnished to do so, subject to the following conditions: 11dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * 12dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * The above copyright notice including the dates of first publication and 13dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * either this permission notice or a reference to 14dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * http://oss.sgi.com/projects/FreeB/ 15dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * shall be included in all copies or substantial portions of the Software. 16dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * 17dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 22dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * SOFTWARE. 24dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * 25dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * Except as contained in this notice, the name of Silicon Graphics, Inc. 26dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * shall not be used in advertising or otherwise to promote the sale, use or 27dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * other dealings in this Software without prior written authorization from 28dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson * Silicon Graphics, Inc. 29dc8058c3370588bfcad49fadace1691da47d58cdAdam Jackson */ 30cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 31cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/** 32cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \file glxclient.h 33cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Direct rendering support added by Precision Insight, Inc. 34cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * 35cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \author Kevin E. Martin <kevin@precisioninsight.com> 36cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 37cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 38cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#ifndef _GLX_client_h_ 39cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#define _GLX_client_h_ 40cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#define NEED_REPLIES 41cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#define NEED_EVENTS 42cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#include <X11/Xproto.h> 43cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#include <X11/Xlibint.h> 44cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#define GLX_GLXEXT_PROTOTYPES 45cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#include <GL/glx.h> 46cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#include <GL/glxext.h> 47cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#include <string.h> 48cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#include <stdlib.h> 49cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#include <stdio.h> 50ad919c30df71bc191be6f107385638b456da6a0fAdam Jackson#ifdef WIN32 51ad919c30df71bc191be6f107385638b456da6a0fAdam Jackson#include <stdint.h> 52ad919c30df71bc191be6f107385638b456da6a0fAdam Jackson#endif 53cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#include "GL/glxint.h" 54cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#include "GL/glxproto.h" 55cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#include "GL/internal/glcore.h" 564eb95ce807222bc31019b69156fab44aac72cfe7Brian#include "glapi/glapitable.h" 574a22ae8d446855d839cc199df8eb1b057045cb88Kristian Høgsberg#include "glxhash.h" 588363dff251fc38b044447bcb173d960b03073974RALOVICH, Kristóf#if defined( PTHREADS ) 5902986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick# include <pthread.h> 60cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#endif 61cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 62ec770150edff9a5955f52e538adc4bac94c92cadJeremy Huddleston#include "glxextensions.h" 63ec770150edff9a5955f52e538adc4bac94c92cadJeremy Huddleston 64a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul 65a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul/* If we build the library with gcc's -fvisibility=hidden flag, we'll 66a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul * use the PUBLIC macro to mark functions that are to be exported. 67a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul * 680896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf * We also need to define a USED attribute, so the optimizer doesn't 69a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul * inline a static function that we later use in an alias. - ajax 70a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul */ 71a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303 72a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul# define PUBLIC __attribute__((visibility("default"))) 73a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul# define USED __attribute__((used)) 74a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul#else 75a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul# define PUBLIC 76a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul# define USED 77a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul#endif 78a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul 79a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul 80a25e1aa0aab6bd278eefa7c0748b491c9c6ae62cBrian Paul 810896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf#define GLX_MAJOR_VERSION 1 /* current version numbers */ 820896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf#define GLX_MINOR_VERSION 4 83cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 84cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#define __GLX_MAX_TEXTURE_UNITS 32 85cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 86aceccda56b08338e217991e54607f1c9f18fc3e6Kristian Høgsbergtypedef struct __GLXscreenConfigsRec __GLXscreenConfigs; 87cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksontypedef struct __GLXcontextRec __GLXcontext; 88aceccda56b08338e217991e54607f1c9f18fc3e6Kristian Høgsbergtypedef struct __GLXdrawableRec __GLXdrawable; 89cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksontypedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate; 90cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksontypedef struct _glapi_table __GLapi; 91cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 92cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/************************************************************************/ 93cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 94cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#ifdef GLX_DIRECT_RENDERING 95cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 960896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf#define containerOf(ptr, type, member) \ 97aceccda56b08338e217991e54607f1c9f18fc3e6Kristian Høgsberg (type *)( (char *)ptr - offsetof(type,member) ) 98aceccda56b08338e217991e54607f1c9f18fc3e6Kristian Høgsberg 99cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#include <GL/internal/dri_interface.h> 100cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 101cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 102cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/** 103cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Display dependent methods. This structure is initialized during the 104cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \c driCreateDisplay call. 105cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 106425f9ed44e576aef27f7ab98968043f7f180d0fdKristian Høgsbergtypedef struct __GLXDRIdisplayRec __GLXDRIdisplay; 10792d2a78f8d2d56cfadb4cb5323adec32fe73e353Kristian Høgsbergtypedef struct __GLXDRIscreenRec __GLXDRIscreen; 10820b9230ce1b96ca246850a8088caeffc3f391a0cKristian Høgsbergtypedef struct __GLXDRIdrawableRec __GLXDRIdrawable; 109020c64b2cf2973b5cb41e233d2bfbd85f1b699f7Kristian Høgsbergtypedef struct __GLXDRIcontextRec __GLXDRIcontext; 11092d2a78f8d2d56cfadb4cb5323adec32fe73e353Kristian Høgsberg 111e82dd8c6e1fa2fff5b960de26961080ba5e9651dKristian Høgsberg#include "glxextensions.h" 112e82dd8c6e1fa2fff5b960de26961080ba5e9651dKristian Høgsberg 1130896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófstruct __GLXDRIdisplayRec 1140896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf{ 115cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 116cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Method to destroy the private DRI display data. 117cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 1180896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf void (*destroyDisplay) (__GLXDRIdisplay * display); 119a1ea6f6198d80f716936a308cfab235f18a014e1Kristian Høgsberg 1200896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXDRIscreen *(*createScreen) (__GLXscreenConfigs * psc, int screen, 1210896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXdisplayPrivate * priv); 12292d2a78f8d2d56cfadb4cb5323adec32fe73e353Kristian Høgsberg}; 12392d2a78f8d2d56cfadb4cb5323adec32fe73e353Kristian Høgsberg 124daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnesstruct __GLXDRIscreenRec { 125daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes 126daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes void (*destroyScreen)(__GLXscreenConfigs *psc); 127daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes 128daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes __GLXDRIcontext *(*createContext)(__GLXscreenConfigs *psc, 129daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes const __GLcontextModes *mode, 130daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes GLXContext gc, 131daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes GLXContext shareList, int renderType); 132daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes 133daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc, 134daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes XID drawable, 135daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes GLXDrawable glxDrawable, 136daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes const __GLcontextModes *modes); 137daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes 138daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes int64_t (*swapBuffers)(__GLXDRIdrawable *pdraw, int64_t target_msc, 139daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes int64_t divisor, int64_t remainder); 140daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes void (*copySubBuffer)(__GLXDRIdrawable *pdraw, 141daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes int x, int y, int width, int height); 142daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes void (*waitX)(__GLXDRIdrawable *pdraw); 143daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes void (*waitGL)(__GLXDRIdrawable *pdraw); 144daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes int (*getDrawableMSC)(__GLXscreenConfigs *psc, __GLXDRIdrawable *pdraw, 145daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes int64_t *ust, int64_t *msc, int64_t *sbc); 146daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes int (*waitForMSC)(__GLXDRIdrawable *pdraw, int64_t target_msc, 147daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes int64_t divisor, int64_t remainder, int64_t *ust, 148daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes int64_t *msc, int64_t *sbc); 149daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes int (*waitForSBC)(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust, 150daf7fe69f7bd0caa955d30b43fc35b7ce0069b6bJesse Barnes int64_t *msc, int64_t *sbc); 15120b9230ce1b96ca246850a8088caeffc3f391a0cKristian Høgsberg}; 15220b9230ce1b96ca246850a8088caeffc3f391a0cKristian Høgsberg 1530896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófstruct __GLXDRIcontextRec 1540896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf{ 1550896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf void (*destroyContext) (__GLXDRIcontext * context, 1560896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXscreenConfigs * psc, Display * dpy); 1570896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf Bool(*bindContext) (__GLXDRIcontext * context, __GLXDRIdrawable * pdraw, 1580896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXDRIdrawable * pread); 1590896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf 1600896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf void (*unbindContext) (__GLXDRIcontext * context); 161020c64b2cf2973b5cb41e233d2bfbd85f1b699f7Kristian Høgsberg}; 162020c64b2cf2973b5cb41e233d2bfbd85f1b699f7Kristian Høgsberg 1630896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófstruct __GLXDRIdrawableRec 1640896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf{ 1650896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf void (*destroyDrawable) (__GLXDRIdrawable * drawable); 1669110425c72e45f618131b559eba883fd6c5536b4Kristian Høgsberg 1670896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf XID xDrawable; 1680896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf XID drawable; 1690896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXscreenConfigs *psc; 1700896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLenum textureTarget; 1710896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __DRIdrawable *driDrawable; 1720896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLenum textureFormat; /* EXT_texture_from_pixmap support */ 173cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson}; 174cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 175cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* 176cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** Function to create and DRI display data and initialize the display 177cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** dependent methods. 178cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson*/ 1790896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern __GLXDRIdisplay *driswCreateDisplay(Display * dpy); 1800896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern __GLXDRIdisplay *driCreateDisplay(Display * dpy); 1810896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern __GLXDRIdisplay *dri2CreateDisplay(Display * dpy); 182cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 1830896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void DRI_glXUseXFont(Font font, int first, int count, int listbase); 184cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 185cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* 186cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** Functions to obtain driver configuration information from a direct 187cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** rendering client application 188cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson*/ 1890896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern const char *glXGetScreenDriver(Display * dpy, int scrNum); 190cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 1910896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern const char *glXGetDriverConfig(const char *driverName); 192cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 193cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#endif 194cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 195cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/************************************************************************/ 196cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 197cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#define __GL_CLIENT_ATTRIB_STACK_DEPTH 16 198cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 1990896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóftypedef struct __GLXpixelStoreModeRec 2000896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf{ 2010896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLboolean swapEndian; 2020896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLboolean lsbFirst; 2030896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLuint rowLength; 2040896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLuint imageHeight; 2050896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLuint imageDepth; 2060896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLuint skipRows; 2070896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLuint skipPixels; 2080896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLuint skipImages; 2090896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLuint alignment; 210cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson} __GLXpixelStoreMode; 211cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 212cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 2130896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóftypedef struct __GLXattributeRec 2140896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf{ 2150896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLuint mask; 216cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 217cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 218fdb07636f2e6324c5250cd5ee97778b7f5933beaIan Romanick * Pixel storage state. Most of the pixel store mode state is kept 219fdb07636f2e6324c5250cd5ee97778b7f5933beaIan Romanick * here and used by the client code to manage the packing and 220fdb07636f2e6324c5250cd5ee97778b7f5933beaIan Romanick * unpacking of data sent to/received from the server. 221cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 2220896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXpixelStoreMode storePack, storeUnpack; 223cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 224cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 225fdb07636f2e6324c5250cd5ee97778b7f5933beaIan Romanick * Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically 226fdb07636f2e6324c5250cd5ee97778b7f5933beaIan Romanick * disabled? 227cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 2280896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLboolean NoDrawArraysProtocol; 2290896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf 230cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 231fdb07636f2e6324c5250cd5ee97778b7f5933beaIan Romanick * Vertex Array storage state. The vertex array component 232fdb07636f2e6324c5250cd5ee97778b7f5933beaIan Romanick * state is stored here and is used to manage the packing of 233fdb07636f2e6324c5250cd5ee97778b7f5933beaIan Romanick * DrawArrays data sent to the server. 234cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 2350896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf struct array_state_vector *array_state; 236cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson} __GLXattribute; 237cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 2380896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóftypedef struct __GLXattributeMachineRec 2390896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf{ 2400896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]; 2410896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXattribute **stackPointer; 242cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson} __GLXattributeMachine; 243cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 244cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/** 245cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * GLX state that needs to be kept on the client. One of these records 246cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * exist for each context that has been made current by this client. 247cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 2480896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófstruct __GLXcontextRec 2490896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf{ 250cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 251cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \name Drawing command buffer. 252cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * 253cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Drawing commands are packed into this buffer before being sent as a 254cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * single GLX protocol request. The buffer is sent when it overflows or 255cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * is flushed by \c __glXFlushRenderBuffer. \c pc is the next location 256cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * in the buffer to be filled. \c limit is described above in the buffer 257cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * slop discussion. 258cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * 259cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Commands that require large amounts of data to be transfered will 260cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * also use this buffer to hold a header that describes the large 261cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * command. 262cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * 263cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * These must be the first 6 fields since they are static initialized 264cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * in the dummy context in glxext.c 265cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 2660896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@{ */ 2670896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLubyte *buf; 2680896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLubyte *pc; 2690896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLubyte *limit; 2700896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLubyte *bufEnd; 2710896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLint bufSize; 2720896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@} */ 273cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 274cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 275cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * The XID of this rendering context. When the context is created a 276cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * new XID is allocated. This is set to None when the context is 277cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * destroyed but is still current to some thread. In this case the 278cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * context will be freed on next MakeCurrent. 279cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 2800896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf XID xid; 281cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 282cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 283cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * The XID of the \c shareList context. 284cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 2850896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf XID share_xid; 286cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 287cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 288cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Screen number. 289cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 2900896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLint screen; 2910896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXscreenConfigs *psc; 292cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 293cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 294cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \c GL_TRUE if the context was created with ImportContext, which 295cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * means the server-side context was created by another X client. 296cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 2970896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLboolean imported; 298cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 299cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 300cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * The context tag returned by MakeCurrent when this context is made 301cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * current. This tag is used to identify the context that a thread has 302cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * current so that proper server context management can be done. It is 303cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * used for all context specific commands (i.e., \c Render, \c RenderLarge, 304cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old 305cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * context)). 306cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3070896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLXContextTag currentContextTag; 308cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 309cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 310cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \name Rendering mode 311cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * 312cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * The rendering mode is kept on the client as well as the server. 313cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * When \c glRenderMode is called, the buffer associated with the 314cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * previous rendering mode (feedback or select) is filled. 315cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3160896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@{ */ 3170896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLenum renderMode; 3180896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLfloat *feedbackBuf; 3190896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLuint *selectBuf; 3200896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@} */ 321cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 322cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 323cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * This is \c GL_TRUE if the pixel unpack modes are such that an image 324cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * can be unpacked from the clients memory by just copying. It may 325cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * still be true that the server will have to do some work. This 326cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * just promises that a straight copy will fetch the correct bytes. 327cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3280896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLboolean fastImageUnpack; 329cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 330cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 331cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Fill newImage with the unpacked form of \c oldImage getting it 332cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * ready for transport to the server. 333cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3340896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf void (*fillImage) (__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, 3350896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLenum, const GLvoid *, GLubyte *, GLubyte *); 336cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 337cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 33829206ae569c4c784ec6884084b4bd8631f66b866Ian Romanick * Client side attribs. 339cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3400896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXattributeMachine attributes; 341cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 342cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 343cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Client side error code. This is set when client side gl API 344cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * routines need to set an error because of a bad enumerant or 345cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * running out of memory, etc. 346cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3470896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLenum error; 348cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 349cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 350ae2c31ed669abab66a8c4b68d8d746e94b9ebf28Xiang, Haihao * Whether this context does direct rendering. 351ae2c31ed669abab66a8c4b68d8d746e94b9ebf28Xiang, Haihao */ 3520896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf Bool isDirect; 353ae2c31ed669abab66a8c4b68d8d746e94b9ebf28Xiang, Haihao 354ae2c31ed669abab66a8c4b68d8d746e94b9ebf28Xiang, Haihao /** 355cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \c dpy of current display for this context. Will be \c NULL if not 356cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * current to any display, or if this is the "dummy context". 357cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3580896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf Display *currentDpy; 359cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 360cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 361cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * The current drawable for this context. Will be None if this 362cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * context is not current to any drawable. currentReadable is below. 363cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3640896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLXDrawable currentDrawable; 365cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 366cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 367cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \name GL Constant Strings 368cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * 369cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Constant strings that describe the server implementation 370cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * These pertain to GL attributes, not to be confused with 371cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * GLX versioning attributes. 372cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3730896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@{ */ 3740896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLubyte *vendor; 3750896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLubyte *renderer; 3760896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLubyte *version; 3770896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLubyte *extensions; 3780896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@} */ 379cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 380cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 381cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Record the dpy this context was created on for later freeing 382cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3830896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf Display *createDpy; 384cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 385cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 386cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Maximum small render command size. This is the smaller of 64k and 387cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * the size of the above buffer. 388cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3890896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLint maxSmallRenderCommandSize; 390cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 391cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 392cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Major opcode for the extension. Copied here so a lookup isn't 393cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * needed. 394cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 3950896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLint majorOpcode; 396cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 397cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 398286ce2719395485ffafb38097fa2551b066acd96Kristian Høgsberg * Pointer to the mode used to create this context. 399cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 4000896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __GLcontextModes *mode; 4014a22ae8d446855d839cc199df8eb1b057045cb88Kristian Høgsberg 402286ce2719395485ffafb38097fa2551b066acd96Kristian Høgsberg#ifdef GLX_DIRECT_RENDERING 4030896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXDRIcontext *driContext; 4040896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __DRIcontext *__driContext; 405cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#endif 406cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 407cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 408cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * The current read-drawable for this context. Will be None if this 409cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * context is not current to any drawable. 410cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * 411cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \since Internal API version 20030606. 412cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 4130896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLXDrawable currentReadable; 414cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 4150896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /** 416cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Pointer to client-state data that is private to libGL. This is only 417cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * used for indirect rendering contexts. 418cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * 419cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * No internal API version change was made for this change. Client-side 420cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * drivers should NEVER use this data or even care that it exists. 421cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 4220896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf void *client_state_private; 423fdb07636f2e6324c5250cd5ee97778b7f5933beaIan Romanick 424cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 425cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Stored value for \c glXQueryContext attribute \c GLX_RENDER_TYPE. 426cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 427cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson int renderType; 4280896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf 429cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 430cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \name Raw server GL version 431cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * 432cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * True core GL version supported by the server. This is the raw value 433cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * returned by the server, and it may not reflect what is actually 434cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * supported (or reported) by the client-side library. 435cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 4360896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@{ */ 437cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson int server_major; /**< Major version number. */ 438cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson int server_minor; /**< Minor version number. */ 4390896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@} */ 440fdb07636f2e6324c5250cd5ee97778b7f5933beaIan Romanick 44196fd3df59a161957876bfd7a49992e5a2130370cThomas Hellstrom /** 44296fd3df59a161957876bfd7a49992e5a2130370cThomas Hellstrom * Thread ID we're currently current in. Zero if none. 44396fd3df59a161957876bfd7a49992e5a2130370cThomas Hellstrom */ 44496fd3df59a161957876bfd7a49992e5a2130370cThomas Hellstrom unsigned long thread_id; 44596fd3df59a161957876bfd7a49992e5a2130370cThomas Hellstrom 4460896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf char gl_extension_bits[__GL_EXT_BYTES]; 447cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson}; 448cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 4490896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf#define __glXSetError(gc,code) \ 4500896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf if (!(gc)->error) { \ 4510896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf (gc)->error = code; \ 4520896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf } 453cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 454cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern void __glFreeAttributeState(__GLXcontext *); 455cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 456cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/************************************************************************/ 457cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 458cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/** 459cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * The size of the largest drawing command known to the implementation 460cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * that will use the GLXRender GLX command. In this case it is 461cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \c glPolygonStipple. 462cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 4630896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf#define __GLX_MAX_SMALL_RENDER_CMD_SIZE 156 464cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 465cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/** 466cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * To keep the implementation fast, the code uses a "limit" pointer 467cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * to determine when the drawing command buffer is too full to hold 468cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * another fixed size command. This constant defines the amount of 469cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * space that must always be available in the drawing command buffer 470cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * at all times for the implementation to work. It is important that 471cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * the number be just large enough, but not so large as to reduce the 472cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * efficacy of the buffer. The "+32" is just to keep the code working 473cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * in case somebody counts wrong. 474cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 4750896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf#define __GLX_BUFFER_LIMIT_SIZE (__GLX_MAX_SMALL_RENDER_CMD_SIZE + 32) 476cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 477cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/** 478cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * This implementation uses a smaller threshold for switching 479cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * to the RenderLarge protocol than the protcol requires so that 480cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * large copies don't occur. 481cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 4820896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf#define __GLX_RENDER_CMD_SIZE_LIMIT 4096 483cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 484cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/** 485cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * One of these records exists per screen of the display. It contains 486cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * a pointer to the config data for that screen (if the screen supports GL). 487cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 4880896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófstruct __GLXscreenConfigsRec 4890896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf{ 490cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 491cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * GLX extension string reported by the X-server. 492cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 4930896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const char *serverGLXexts; 494cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 495cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 496cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * GLX extension string to be reported to applications. This is the 497cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * set of extensions that the application can actually use. 498cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 4990896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf char *effectiveGLXexts; 500cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 501cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#ifdef GLX_DIRECT_RENDERING 502cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 503cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Per screen direct rendering interface functions and data. 504cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 5050896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __DRIscreen *__driScreen; 5060896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRIcoreExtension *core; 5070896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRIlegacyExtension *legacy; 5080896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRIswrastExtension *swrast; 5090896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRIdri2Extension *dri2; 5100896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __glxHashTable *drawHash; 5110896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf Display *dpy; 5120896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf int scr, fd; 5130896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf void *driver; 514ac3e838fa748c8c8a6ffc04d1ab13da71f75f103Kristian Høgsberg 5150896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXDRIscreen *driScreen; 51653dc86363665b9b22f042c5d950b7de0ed02b4c8Kristian Høgsberg 5170896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRIconfig **driver_configs; 518ce0ad53281f236424a72ae021f293a3a5ca69217RALOVICH, Kristóf 519ac3e838fa748c8c8a6ffc04d1ab13da71f75f103Kristian Høgsberg#ifdef __DRI_COPY_SUB_BUFFER 5200896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRIcopySubBufferExtension *driCopySubBuffer; 521ac3e838fa748c8c8a6ffc04d1ab13da71f75f103Kristian Høgsberg#endif 522ac3e838fa748c8c8a6ffc04d1ab13da71f75f103Kristian Høgsberg 523efaf90b03e8b69e04909bce071f8ef6b65cc0e9dKristian Høgsberg#ifdef __DRI_SWAP_CONTROL 5240896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRIswapControlExtension *swapControl; 525efaf90b03e8b69e04909bce071f8ef6b65cc0e9dKristian Høgsberg#endif 526efaf90b03e8b69e04909bce071f8ef6b65cc0e9dKristian Høgsberg 52778a6aa57a0155d72280dd91c05513c847bf76f3bKristian Høgsberg#ifdef __DRI_ALLOCATE 5280896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRIallocateExtension *allocate; 52978a6aa57a0155d72280dd91c05513c847bf76f3bKristian Høgsberg#endif 53078a6aa57a0155d72280dd91c05513c847bf76f3bKristian Høgsberg 531a7a0a2beb54dcb78d7e0ab64cf2f5a6ede8191a4Kristian Høgsberg#ifdef __DRI_FRAME_TRACKING 5320896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRIframeTrackingExtension *frameTracking; 533a7a0a2beb54dcb78d7e0ab64cf2f5a6ede8191a4Kristian Høgsberg#endif 534a7a0a2beb54dcb78d7e0ab64cf2f5a6ede8191a4Kristian Høgsberg 535106a6f29bbdc71982afd629bdf89369cefd1459eKristian Høgsberg#ifdef __DRI_MEDIA_STREAM_COUNTER 5360896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRImediaStreamCounterExtension *msc; 537e82dd8c6e1fa2fff5b960de26961080ba5e9651dKristian Høgsberg#endif 538e82dd8c6e1fa2fff5b960de26961080ba5e9651dKristian Høgsberg 539e82dd8c6e1fa2fff5b960de26961080ba5e9651dKristian Høgsberg#ifdef __DRI_TEX_BUFFER 5400896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRItexBufferExtension *texBuffer; 541106a6f29bbdc71982afd629bdf89369cefd1459eKristian Høgsberg#endif 542106a6f29bbdc71982afd629bdf89369cefd1459eKristian Høgsberg 54365562453fba69e862d5e3b381d18db9c40d9353cAlan Hourihane#ifdef __DRI2_FLUSH 5440896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const __DRI2flushExtension *f; 54565562453fba69e862d5e3b381d18db9c40d9353cAlan Hourihane#endif 54665562453fba69e862d5e3b381d18db9c40d9353cAlan Hourihane 547cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#endif 548cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 549cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 5506c533ea2d1953152f7d95d6c984e0d287edb46c2Kristian Høgsberg * Linked list of glx visuals and fbconfigs for this screen. 551cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 5520896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLcontextModes *visuals, *configs; 553c39bf5e273a4995a279ae2af59fc29e06ab47e29Ian Romanick 554cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 555cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Per-screen dynamic GLX extension tracking. The \c direct_support 556cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * field only contains enough bits for 64 extensions. Should libGL 557cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * ever need to track more than 64 GLX extensions, we can safely grow 558cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * this field. The \c __GLXscreenConfigs structure is not used outside 559cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * libGL. 560cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 5610896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@{ */ 5620896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf unsigned char direct_support[8]; 5630896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLboolean ext_list_first_time; 5640896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@} */ 565cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 566aceccda56b08338e217991e54607f1c9f18fc3e6Kristian Høgsberg}; 567cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 568cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/** 569cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Per display private data. One of these records exists for each display 570cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * that is using the OpenGL (GLX) extension. 571cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 5720896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófstruct __GLXdisplayPrivateRec 5730896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf{ 574cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 575cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Back pointer to the display 576cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 5770896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf Display *dpy; 578cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 579cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 580cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * The \c majorOpcode is common to all connections to the same server. 581cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * It is also copied into the context structure. 582cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 5830896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf int majorOpcode; 584cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 585cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 586cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \name Server Version 587cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * 588cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Major and minor version returned by the server during initialization. 589cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 5900896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@{ */ 5910896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf int majorVersion, minorVersion; 5920896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@} */ 593cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 594cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 595cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * \name Storage for the servers GLX vendor and versions strings. 5960896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf * 597cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * These are the same for all screens on this display. These fields will 598cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * be filled in on demand. 599cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 6000896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@{ */ 6010896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const char *serverGLXvendor; 6020896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const char *serverGLXversion; 6030896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf /*@} */ 604cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 605cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 606cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Configurations of visuals for all screens on this display. 607cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Also, per screen data which now includes the server \c GLX_EXTENSION 608cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * string. 609cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 6100896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXscreenConfigs *screenConfigs; 611cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 612cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#ifdef GLX_DIRECT_RENDERING 613cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson /** 614cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson * Per display direct rendering interface functions and data. 615cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson */ 6160896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXDRIdisplay *driswDisplay; 6170896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXDRIdisplay *driDisplay; 6180896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __GLXDRIdisplay *dri2Display; 619cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#endif 620cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson}; 621cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 622aceccda56b08338e217991e54607f1c9f18fc3e6Kristian Høgsberg 6230896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern GLubyte *__glXFlushRenderBuffer(__GLXcontext *, GLubyte *); 624cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 6250896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void __glXSendLargeChunk(__GLXcontext * gc, GLint requestNumber, 6260896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLint totalRequests, 6270896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const GLvoid * data, GLint dataLen); 628cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 629cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint, 6300896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const GLvoid *, GLint); 631cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 632cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* Initialize the GLX extension for dpy */ 6330896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern __GLXdisplayPrivate *__glXInitialize(Display *); 634cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 635df2c9424d3b625d6e97528c74051257bc5630a67Brian Paulextern void __glXPreferEGL(int state); 636df2c9424d3b625d6e97528c74051257bc5630a67Brian Paul 637cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/************************************************************************/ 638cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 639cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern int __glXDebug; 640cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 641cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* This is per-thread storage in an MT environment */ 6428363dff251fc38b044447bcb173d960b03073974RALOVICH, Kristóf#if defined( PTHREADS ) 64302986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick 6440896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void __glXSetCurrentContext(__GLXcontext * c); 64502986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick 64602986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick# if defined( GLX_USE_TLS ) 64702986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick 6480896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern __thread void *__glX_tls_Context 6490896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf __attribute__ ((tls_model("initial-exec"))); 65002986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick 6510896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf# define __glXGetCurrentContext() __glX_tls_Context 65202986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick 65302986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick# else 65402986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick 65502986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanickextern __GLXcontext *__glXGetCurrentContext(void); 65602986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick 65702986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick# endif /* defined( GLX_USE_TLS ) */ 65802986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick 659cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#else 66002986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick 661cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern __GLXcontext *__glXcurrentContext; 6620896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf#define __glXGetCurrentContext() __glXcurrentContext 6630896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf#define __glXSetCurrentContext(gc) __glXcurrentContext = gc 66402986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick 6658363dff251fc38b044447bcb173d960b03073974RALOVICH, Kristóf#endif /* defined( PTHREADS ) */ 666cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 667df04ffbf025994abd59e26c8439e77bb340ef20bGeorge Sapountzisextern void __glXSetCurrentContextNull(void); 668df04ffbf025994abd59e26c8439e77bb340ef20bGeorge Sapountzis 6690896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void __glXFreeContext(__GLXcontext *); 670df04ffbf025994abd59e26c8439e77bb340ef20bGeorge Sapountzis 671cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 672cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* 673cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** Global lock for all threads in this address space using the GLX 674cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** extension 675cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson*/ 6768363dff251fc38b044447bcb173d960b03073974RALOVICH, Kristóf#if defined( PTHREADS ) 67702986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanickextern pthread_mutex_t __glXmutex; 67802986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick#define __glXLock() pthread_mutex_lock(&__glXmutex) 67902986cb2cc1b1d47b26a653e9ae0fa508365f616Ian Romanick#define __glXUnlock() pthread_mutex_unlock(&__glXmutex) 680cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#else 681cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#define __glXLock() 682cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#define __glXUnlock() 683cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#endif 684cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 685cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* 686cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** Setup for a command. Initialize the extension for dpy if necessary. 687cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson*/ 6880896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern CARD8 __glXSetupForCommand(Display * dpy); 689cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 690cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/************************************************************************/ 691cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 692cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* 693cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** Data conversion and packing support. 694cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson*/ 695cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 6965f1f229f8da255ca9b390da1757ad781978cf619Ian Romanickextern const GLuint __glXDefaultPixelStore[9]; 6975f1f229f8da255ca9b390da1757ad781978cf619Ian Romanick 6985f1f229f8da255ca9b390da1757ad781978cf619Ian Romanick/* Send an image to the server using RenderLarge. */ 6990896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void __glXSendLargeImage(__GLXcontext * gc, GLint compsize, GLint dim, 7000896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLint width, GLint height, GLint depth, 7010896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLenum format, GLenum type, 7020896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const GLvoid * src, GLubyte * pc, 7030896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLubyte * modes); 7045f1f229f8da255ca9b390da1757ad781978cf619Ian Romanick 705cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* Return the size, in bytes, of some pixel data */ 7065f1f229f8da255ca9b390da1757ad781978cf619Ian Romanickextern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum, GLenum); 707cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 708cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* Return the number of elements per group of a specified format*/ 709cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern GLint __glElementsPerGroup(GLenum format, GLenum type); 710cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 711cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* Return the number of bytes per element, based on the element type (other 712cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** than GL_BITMAP). 713cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson*/ 714cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern GLint __glBytesPerElement(GLenum type); 715cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 716cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* 717cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** Fill the transport buffer with the data from the users buffer, 718cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** applying some of the pixel store modes (unpack modes) to the data 719cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** first. As a side effect of this call, the "modes" field is 720cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** updated to contain the modes needed by the server to decode the 721cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** sent data. 722cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson*/ 7230896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void __glFillImage(__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, 7240896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLenum, const GLvoid *, GLubyte *, GLubyte *); 725cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 726cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* Copy map data with a stride into a packed buffer */ 727cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *); 728cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *); 729cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint, 7300896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const GLfloat *, GLfloat *); 731cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint, 7320896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf const GLdouble *, GLdouble *); 733cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 734cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* 735cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** Empty an image out of the reply buffer into the clients memory applying 736cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** the pack modes to pack back into the clients requested format. 737cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson*/ 7380896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void __glEmptyImage(__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, 7390896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf GLenum, const GLubyte *, GLvoid *); 740cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 741cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 742cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* 743e2060348630b59a446bac7f734fdde40033093abKristof Ralovich** Allocate and Initialize Vertex Array client state, and free. 744cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson*/ 745e2060348630b59a446bac7f734fdde40033093abKristof Ralovichextern void __glXInitVertexArrayState(__GLXcontext *); 746e2060348630b59a446bac7f734fdde40033093abKristof Ralovichextern void __glXFreeVertexArrayState(__GLXcontext *); 747cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 748cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* 749cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** Inform the Server of the major and minor numbers and of the client 750cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** libraries extension string. 751cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson*/ 7520896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void __glXClientInfo(Display * dpy, int opcode); 753cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 754cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/************************************************************************/ 755cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 756cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* 757cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson** Declarations that should be in Xlib 758cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson*/ 759cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#ifdef __GL_USE_OUR_PROTOTYPES 7600896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void _XFlush(Display *); 7610896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern Status _XReply(Display *, xReply *, int, Bool); 7620896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void _XRead(Display *, void *, long); 7630896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void _XSend(Display *, const void *, long); 764cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#endif 765cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 766cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 7670896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern void __glXInitializeVisualConfigFromTags(__GLcontextModes * config, 7680896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf int count, const INT32 * bp, 7690896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf Bool tagged_only, 7700896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf Bool fbconfig_style_tags); 771cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 7720896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern char *__glXQueryServerString(Display * dpy, int opcode, 7730896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf CARD32 screen, CARD32 name); 7740896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern char *__glXGetString(Display * dpy, int opcode, 7750896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf CARD32 screen, CARD32 name); 7765444424562781a0a40559db40dfe9b97286dc9daRALOVICH, Kristóf 777cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern char *__glXstrdup(const char *str); 778cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 779cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 780cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern const char __glXGLClientVersion[]; 781cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jacksonextern const char __glXGLClientExtensions[]; 782cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 783cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson/* Get the unadjusted system time */ 7840896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristófextern int __glXGetUST(int64_t * ust); 785cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson 786286ce2719395485ffafb38097fa2551b066acd96Kristian Høgsbergextern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable, 7870896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf int32_t * numerator, 7880896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf int32_t * denominator); 789fc5b57b71375ef6c117482be036b442c2cb8ab23Ian Romanick 790286ce2719395485ffafb38097fa2551b066acd96Kristian Høgsberg#ifdef GLX_DIRECT_RENDERING 791286ce2719395485ffafb38097fa2551b066acd96Kristian HøgsbergGLboolean 7920896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf__driGetMscRateOML(__DRIdrawable * draw, 7930896268b97674d009d609476acfa1eed5dfea350RALOVICH, Kristóf int32_t * numerator, int32_t * denominator, void *private); 794286ce2719395485ffafb38097fa2551b066acd96Kristian Høgsberg#endif 795286ce2719395485ffafb38097fa2551b066acd96Kristian Høgsberg 796cb3610e37c4c0a40520441b8515d044dabcc8854Adam Jackson#endif /* !__GLX_client_h__ */ 797