1 | /*
|
---|
2 | * Mesa 3-D graphics library
|
---|
3 | * Version: 3.0
|
---|
4 | * Copyright (C) 1995-1998 Brian Paul
|
---|
5 | *
|
---|
6 | * This library is free software; you can redistribute it and/or
|
---|
7 | * modify it under the terms of the GNU Library General Public
|
---|
8 | * License as published by the Free Software Foundation; either
|
---|
9 | * version 2 of the License, or (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This library is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | * Library General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU Library General Public
|
---|
17 | * License along with this library; if not, write to the Free
|
---|
18 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
19 | *
|
---|
20 | */
|
---|
21 |
|
---|
22 |
|
---|
23 | /*
|
---|
24 | * Windows driver by: Mark E. Peterson ([email protected])
|
---|
25 | * Updated by Li Wei ([email protected])
|
---|
26 | *
|
---|
27 | *
|
---|
28 | ***************************************************************
|
---|
29 | * WMesa *
|
---|
30 | * version 2.3 *
|
---|
31 | * *
|
---|
32 | * By *
|
---|
33 | * Li Wei *
|
---|
34 | * Institute of Artificial Intelligence & Robotics *
|
---|
35 | * Xi'an Jiaotong University *
|
---|
36 | * Email: [email protected] *
|
---|
37 | * Web page: http://sun.aiar.xjtu.edu.cn *
|
---|
38 | * *
|
---|
39 | * July 7th, 1997 *
|
---|
40 | ***************************************************************
|
---|
41 | */
|
---|
42 |
|
---|
43 |
|
---|
44 | #ifndef WMESA_H
|
---|
45 | #define WMESA_H
|
---|
46 |
|
---|
47 |
|
---|
48 | #ifdef __cplusplus
|
---|
49 | extern "C" {
|
---|
50 | #endif
|
---|
51 |
|
---|
52 |
|
---|
53 | #include "GL/gl.h"
|
---|
54 |
|
---|
55 | #if defined(_MSV_VER) && !defined(__GNUC__)
|
---|
56 | # pragma warning (disable:4273)
|
---|
57 | # pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
|
---|
58 | # pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
|
---|
59 | # pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
|
---|
60 | # pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */
|
---|
61 | # pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
|
---|
62 | # pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */
|
---|
63 | # if (MESA_WARNQUIET>1)
|
---|
64 | # pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
|
---|
65 | # endif
|
---|
66 | #endif
|
---|
67 |
|
---|
68 | /*
|
---|
69 | * This is the WMesa context 'handle':
|
---|
70 | */
|
---|
71 | typedef struct wmesa_context *WMesaContext;
|
---|
72 |
|
---|
73 |
|
---|
74 |
|
---|
75 | /*
|
---|
76 | * Create a new WMesaContext for rendering into a window. You must
|
---|
77 | * have already created the window of correct visual type and with an
|
---|
78 | * appropriate colormap.
|
---|
79 | *
|
---|
80 | * Input:
|
---|
81 | * hDC - Windows device or memory context
|
---|
82 | * Pal - Palette to use
|
---|
83 | * rgb_flag - GL_TRUE = RGB mode,
|
---|
84 | * GL_FALSE = color index mode
|
---|
85 | * db_flag - GL_TRUE = double-buffered,
|
---|
86 | * GL_FALSE = single buffered
|
---|
87 | * alpha_flag - GL_TRUE = create software alpha buffer,
|
---|
88 | * GL_FALSE = no software alpha buffer
|
---|
89 | *
|
---|
90 | * Note: Indexed mode requires double buffering under Windows.
|
---|
91 | *
|
---|
92 | * Return: a WMesa_context or NULL if error.
|
---|
93 | */
|
---|
94 | extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal,
|
---|
95 | GLboolean rgb_flag,
|
---|
96 | GLboolean db_flag,
|
---|
97 | GLboolean alpha_flag);
|
---|
98 |
|
---|
99 |
|
---|
100 | /*
|
---|
101 | * Destroy a rendering context as returned by WMesaCreateContext()
|
---|
102 | */
|
---|
103 | extern void WMesaDestroyContext( WMesaContext ctx );
|
---|
104 |
|
---|
105 |
|
---|
106 |
|
---|
107 | /*
|
---|
108 | * Make the specified context the current one.
|
---|
109 | */
|
---|
110 | extern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc );
|
---|
111 |
|
---|
112 |
|
---|
113 | /*
|
---|
114 | * Return a handle to the current context.
|
---|
115 | */
|
---|
116 | extern WMesaContext WMesaGetCurrentContext( void );
|
---|
117 |
|
---|
118 |
|
---|
119 | /*
|
---|
120 | * Swap the front and back buffers for the current context. No action
|
---|
121 | * taken if the context is not double buffered.
|
---|
122 | */
|
---|
123 | extern void WMesaSwapBuffers(HDC hdc);
|
---|
124 |
|
---|
125 |
|
---|
126 | /*
|
---|
127 | * In indexed color mode we need to know when the palette changes.
|
---|
128 | */
|
---|
129 | extern void WMesaPaletteChange(HPALETTE Pal);
|
---|
130 |
|
---|
131 | extern void WMesaMove(void);
|
---|
132 |
|
---|
133 | void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx);
|
---|
134 |
|
---|
135 | #ifdef __cplusplus
|
---|
136 | }
|
---|
137 | #endif
|
---|
138 |
|
---|
139 |
|
---|
140 | #endif
|
---|
141 |
|
---|