Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
55 pj 1
/* $Id: wmesa.h,v 1.1 2003-02-28 11:41:57 pj Exp $ */
2
 
3
/*
4
 * Mesa 3-D graphics library
5
 * Version:  3.0
6
 * Copyright (C) 1995-1998  Brian Paul
7
 *
8
 * This library is free software; you can redistribute it and/or
9
 * modify it under the terms of the GNU Library General Public
10
 * License as published by the Free Software Foundation; either
11
 * version 2 of the License, or (at your option) any later version.
12
 *
13
 * This library is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 * Library General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU Library General Public
19
 * License along with this library; if not, write to the Free
20
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
 *
22
 */
23
 
24
 
25
/*
26
 * $Log: not supported by cvs2svn $
27
 * Revision 1.2  2002/04/23 18:23:32  kschultz
28
 * Fix up alpha buffer handling for Windows.
29
 * - add two new Pixel Format Descriptors that do not have alpha bits to
30
 * mirror the two that do.
31
 * - add logic to wglChoosePixelFormat to match PFD's with respect to alpha.
32
 * - Create/clear software alpha buffer as required.
33
 * Now a wgl or GLUT program can control the creation of a software alpha
34
 * buffer via the PFD or GLUT parms, respectively.
35
 *
36
 * Revision 1.1.1.1  1999/08/19 00:55:40  jtg
37
 * Imported sources
38
 *
39
 * Revision 3.2  1999/01/03 02:54:45  brianp
40
 * updated per Ted Jump
41
 *
42
 * Revision 3.1  1998/12/01 02:34:27  brianp
43
 * applied Mark Kilgard's patches from November 30, 1998
44
 *
45
 * Revision 3.0  1998/02/20 05:06:59  brianp
46
 * initial rev
47
 *
48
 */
49
 
50
 
51
/*
52
 * Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us)
53
 * Updated by Li Wei (liwei@aiar.xjtu.edu.cn)
54
 *
55
 *
56
 ***************************************************************
57
 *                     WMesa                                   *
58
 *                     version 2.3                             *       
59
 *                                                             *
60
 *                        By                                   *
61
 *                      Li Wei                                 *
62
 *       Institute of Artificial Intelligence & Robotics       *
63
 *       Xi'an Jiaotong University                             *
64
 *       Email: liwei@aiar.xjtu.edu.cn                         *
65
 *       Web page: http://sun.aiar.xjtu.edu.cn                 *
66
 *                                                             *
67
 *             July 7th, 1997                                  *
68
 ***************************************************************
69
 */
70
 
71
 
72
#ifndef WMESA_H
73
#define WMESA_H
74
 
75
 
76
#ifdef __cplusplus
77
extern "C" {
78
#endif
79
 
80
 
81
#include "gl\gl.h"
82
 
83
#pragma warning (disable:4273)
84
#pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
85
#pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
86
#pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
87
#pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */
88
#pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
89
#pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */
90
#if (MESA_WARNQUIET>1)
91
#       pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
92
#endif
93
 
94
/*
95
 * This is the WMesa context 'handle':
96
 */
97
typedef struct wmesa_context *WMesaContext;
98
 
99
 
100
 
101
/*
102
 * Create a new WMesaContext for rendering into a window.  You must
103
 * have already created the window of correct visual type and with an
104
 * appropriate colormap.
105
 *
106
 * Input:
107
 *         hWnd - Window handle
108
 *         Pal  - Palette to use
109
 *         rgb_flag - GL_TRUE = RGB mode,
110
 *                    GL_FALSE = color index mode
111
 *         db_flag - GL_TRUE = double-buffered,
112
 *                   GL_FALSE = single buffered
113
 *         alpha_flag - GL_TRUE = create software alpha buffer,
114
 *                      GL_FALSE = no software alpha buffer
115
 *
116
 * Note: Indexed mode requires double buffering under Windows.
117
 *
118
 * Return:  a WMesa_context or NULL if error.
119
 */
120
extern WMesaContext WMesaCreateContext(HWND hWnd,HPALETTE* pPal,
121
                                       GLboolean rgb_flag,
122
                                       GLboolean db_flag,
123
                                       GLboolean alpha_flag);
124
 
125
 
126
/*
127
 * Destroy a rendering context as returned by WMesaCreateContext()
128
 */
129
/*extern void WMesaDestroyContext( WMesaContext ctx );*/
130
extern void WMesaDestroyContext( void );
131
 
132
 
133
 
134
/*
135
 * Make the specified context the current one.
136
 */
137
extern void WMesaMakeCurrent( WMesaContext ctx );
138
 
139
 
140
/*
141
 * Return a handle to the current context.
142
 */
143
extern WMesaContext WMesaGetCurrentContext( void );
144
 
145
 
146
/*
147
 * Swap the front and back buffers for the current context.  No action
148
 * taken if the context is not double buffered.
149
 */
150
extern void WMesaSwapBuffers(void);
151
 
152
 
153
/*
154
 * In indexed color mode we need to know when the palette changes.
155
 */
156
extern void WMesaPaletteChange(HPALETTE Pal);
157
 
158
extern void WMesaMove(void);
159
 
160
 
161
 
162
#ifdef __cplusplus
163
}
164
#endif
165
 
166
 
167
#endif
168