1533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney/*
2533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * Copyright © 2014 Jon Turney
3533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney *
4533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * Permission is hereby granted, free of charge, to any person obtaining a
5533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * copy of this software and associated documentation files (the "Software"),
6533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * to deal in the Software without restriction, including without limitation
7533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * and/or sell copies of the Software, and to permit persons to whom the
9533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * Software is furnished to do so, subject to the following conditions:
10533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney *
11533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * The above copyright notice and this permission notice (including the next
12533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * paragraph) shall be included in all copies or substantial portions of the
13533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * Software.
14533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney *
15533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney * IN THE SOFTWARE.
22533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney */
23533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney
24533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney#ifndef windowsgl_internal_h
25533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney#define windowsgl_internal_h
26533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney
27533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney#include "windowsgl.h"
28533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney
29533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney#include <X11/Xmd.h> // for BOOL
30533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney#include <X11/Xwindows.h> // as this doesn't provide one
31533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney#include <GL/gl.h>
32533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney#include <GL/wglext.h>
33533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney
34533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turneystruct _windowsContext
35533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney{
36533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   struct glx_config *config;
37533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   windowsContext *shareContext;
38533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   HGLRC ctx;
39533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   int pxfi;
40533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney};
41533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney
42533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turneystruct windowsdrawable_callbacks
43533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney{
44533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   int type; // WINDOW, PIXMAP, PBUFFER
45533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   HDC (*getdc) (windowsDrawable *d);
46533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   void (*releasedc) (windowsDrawable *d, HDC dc);
47533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney};
48533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney
49533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turneystruct _windowsDrawable
50533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney{
51533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   int pxfi; // 0 if not yet set
52533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   struct windowsdrawable_callbacks *callbacks;
53533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney
54533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   // for type WINDOW
55533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   HWND hWnd;
56533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney
57533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   // for type PIXMAP
58533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   HANDLE hSection;
59533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   HDC dibDC;
60533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   HBITMAP hDIB;
61533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   HBITMAP hOldDIB;
62533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney
63533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   // for type PBUFFER
64533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney   HPBUFFERARB hPbuffer;
65533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney};
66533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney
67533b3530c1292a39ea12437d1376c77bc7e584b9Jon Turney#endif /* windowsgl_internal_h */
68