11b5d61b8Smrg/*
21b5d61b8Smrg * Copyright © 2014 Jon TURNEY
31b5d61b8Smrg *
41b5d61b8Smrg * Permission is hereby granted, free of charge, to any person obtaining a
51b5d61b8Smrg * copy of this software and associated documentation files (the "Software"),
61b5d61b8Smrg * to deal in the Software without restriction, including without limitation
71b5d61b8Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
81b5d61b8Smrg * and/or sell copies of the Software, and to permit persons to whom the
91b5d61b8Smrg * Software is furnished to do so, subject to the following conditions:
101b5d61b8Smrg *
111b5d61b8Smrg * The above copyright notice and this permission notice (including the next
121b5d61b8Smrg * paragraph) shall be included in all copies or substantial portions of the
131b5d61b8Smrg * Software.
141b5d61b8Smrg *
151b5d61b8Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
161b5d61b8Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
171b5d61b8Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
181b5d61b8Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
191b5d61b8Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
201b5d61b8Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
211b5d61b8Smrg * IN THE SOFTWARE.
221b5d61b8Smrg */
231b5d61b8Smrg
241b5d61b8Smrg#ifndef indirect_h
251b5d61b8Smrg#define indirect_h
261b5d61b8Smrg
271b5d61b8Smrg#include <X11/Xwindows.h>
281b5d61b8Smrg#include <GL/wglext.h>
291b5d61b8Smrg#include <glx/extension_string.h>
301b5d61b8Smrg
311b5d61b8Smrg/* ---------------------------------------------------------------------- */
321b5d61b8Smrg/*
331b5d61b8Smrg *   structure definitions
341b5d61b8Smrg */
351b5d61b8Smrg
361b5d61b8Smrgtypedef struct __GLXWinContext __GLXWinContext;
371b5d61b8Smrgtypedef struct __GLXWinDrawable __GLXWinDrawable;
381b5d61b8Smrgtypedef struct __GLXWinScreen glxWinScreen;
391b5d61b8Smrgtypedef struct __GLXWinConfig GLXWinConfig;
401b5d61b8Smrg
411b5d61b8Smrgstruct __GLXWinContext {
421b5d61b8Smrg    __GLXcontext base;
431b5d61b8Smrg    HGLRC ctx;                  /* Windows GL Context */
441b5d61b8Smrg    __GLXWinContext *shareContext;      /* Context with which we will share display lists and textures */
451b5d61b8Smrg    HWND hwnd;                  /* For detecting when HWND has changed */
461b5d61b8Smrg};
471b5d61b8Smrg
481b5d61b8Smrgstruct __GLXWinDrawable {
491b5d61b8Smrg    __GLXdrawable base;
501b5d61b8Smrg    __GLXWinContext *drawContext;
511b5d61b8Smrg    __GLXWinContext *readContext;
521b5d61b8Smrg
531b5d61b8Smrg    /* If this drawable is GLX_DRAWABLE_PBUFFER */
541b5d61b8Smrg    HPBUFFERARB hPbuffer;
551b5d61b8Smrg
561b5d61b8Smrg    /* If this drawable is GLX_DRAWABLE_PIXMAP */
571b5d61b8Smrg    HDC dibDC;
581b5d61b8Smrg    HANDLE hSection;            /* file mapping handle */
591b5d61b8Smrg    HBITMAP hDIB;
601b5d61b8Smrg    HBITMAP hOldDIB;            /* original DIB for DC */
611b5d61b8Smrg    void *pOldBits;             /* original pBits for this drawable's pixmap */
621b5d61b8Smrg};
631b5d61b8Smrg
641b5d61b8Smrgstruct __GLXWinScreen {
651b5d61b8Smrg    __GLXscreen base;
661b5d61b8Smrg
671b5d61b8Smrg    Bool has_WGL_ARB_multisample;
681b5d61b8Smrg    Bool has_WGL_ARB_pixel_format;
691b5d61b8Smrg    Bool has_WGL_ARB_pbuffer;
701b5d61b8Smrg    Bool has_WGL_ARB_render_texture;
711b5d61b8Smrg    Bool has_WGL_ARB_make_current_read;
72ed6184dfSmrg    Bool has_WGL_ARB_framebuffer_sRGB;
731b5d61b8Smrg
741b5d61b8Smrg    /* wrapped screen functions */
751b5d61b8Smrg    RealizeWindowProcPtr RealizeWindow;
761b5d61b8Smrg    UnrealizeWindowProcPtr UnrealizeWindow;
771b5d61b8Smrg    CopyWindowProcPtr CopyWindow;
781b5d61b8Smrg};
791b5d61b8Smrg
801b5d61b8Smrgstruct __GLXWinConfig {
811b5d61b8Smrg    __GLXconfig base;
821b5d61b8Smrg    int pixelFormatIndex;
831b5d61b8Smrg};
841b5d61b8Smrg
851b5d61b8Smrg/* ---------------------------------------------------------------------- */
861b5d61b8Smrg/*
871b5d61b8Smrg *   function prototypes
881b5d61b8Smrg */
891b5d61b8Smrg
901b5d61b8Smrgvoid
911b5d61b8SmrgglxWinDeferredCreateDrawable(__GLXWinDrawable *draw, __GLXconfig *config);
921b5d61b8Smrg
931b5d61b8Smrg#endif /* indirect_h */
94