summaryrefslogtreecommitdiff
path: root/include/GL/wmesa.h
blob: 03d2383d37d7c37ea3b5ea197bccad463fb48779 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
 * Mesa 3-D graphics library
 * Copyright (C) 1995-1998  Brian Paul
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */


/*
 * Windows driver by: Mark E. Peterson (markp@ic.mankato.mn.us)
 * Updated by Li Wei (liwei@aiar.xjtu.edu.cn)
 *
 *
 ***************************************************************
 *                     WMesa                                   *
 *                     version 2.3                             *	
 *                                                             *
 *                        By                                   *
 *                      Li Wei                                 *
 *       Institute of Artificial Intelligence & Robotics       *
 *       Xi'an Jiaotong University                             *
 *       Email: liwei@aiar.xjtu.edu.cn                         * 
 *       Web page: http://sun.aiar.xjtu.edu.cn                 *
 *                                                             *
 *	       July 7th, 1997				       *
 ***************************************************************
 */


#ifndef WMESA_H
#define WMESA_H


#ifdef __cplusplus
extern "C" {
#endif


#include "GL/gl.h"

#if defined(_MSV_VER) && !defined(__GNUC__)
#  pragma warning (disable:4273)
#  pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
#  pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
#  pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
#  pragma warning( disable : 4013 ) /* 'function' undefined; assuming extern returning int */
#  pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
#  pragma warning( disable : 4273 ) /* 'identifier' : inconsistent DLL linkage. dllexport assumed */
#  if (MESA_WARNQUIET>1)
#    pragma warning( disable : 4146 ) /* unary minus operator applied to unsigned type, result still unsigned */
#  endif
#endif

/*
 * This is the WMesa context 'handle':
 */
typedef struct wmesa_context *WMesaContext;



/*
 * Create a new WMesaContext for rendering into a window.  You must
 * have already created the window of correct visual type and with an
 * appropriate colormap.
 *
 * Input:
 *         hDC - Windows device or memory context
 *         Pal  - Palette to use
 *         rgb_flag - GL_TRUE = RGB mode,
 *                    GL_FALSE = color index mode
 *         db_flag - GL_TRUE = double-buffered,
 *                   GL_FALSE = single buffered
 *         alpha_flag - GL_TRUE = create software alpha buffer,
 *                      GL_FALSE = no software alpha buffer
 *
 * Note: Indexed mode requires double buffering under Windows.
 *
 * Return:  a WMesa_context or NULL if error.
 */
extern WMesaContext WMesaCreateContext(HDC hDC,HPALETTE* pPal,
                                       GLboolean rgb_flag,
                                       GLboolean db_flag,
                                       GLboolean alpha_flag);


/*
 * Destroy a rendering context as returned by WMesaCreateContext()
 */
extern void WMesaDestroyContext( WMesaContext ctx );



/*
 * Make the specified context the current one.
 */
extern void WMesaMakeCurrent( WMesaContext ctx, HDC hdc );


/*
 * Return a handle to the current context.
 */
extern WMesaContext WMesaGetCurrentContext( void );


/*
 * Swap the front and back buffers for the current context.  No action
 * taken if the context is not double buffered.
 */
extern void WMesaSwapBuffers(HDC hdc);


/*
 * In indexed color mode we need to know when the palette changes.
 */
extern void WMesaPaletteChange(HPALETTE Pal);

extern void WMesaMove(void);

void WMesaShareLists(WMesaContext ctx_to_share, WMesaContext ctx);

#ifdef __cplusplus
}
#endif


#endif