Fix typo
[mesa.git] / src / mesa / drivers / windows / wmesadef.h
1 /* File name : wmesadef.h
2 * Version : 2.3
3 *
4 * Header file for display driver for Mesa 2.3 under
5 * Windows95, WindowsNT and Win32
6 *
7 * Copyright (C) 1996- Li Wei
8 * Address : Institute of Artificial Intelligence
9 * : & Robotics
10 * : Xi'an Jiaotong University
11 * Email : liwei@aiar.xjtu.edu.cn
12 * Web page : http://sun.aiar.xjtu.edu.cn
13 *
14 * This file and its associations are partially based on the
15 * Windows NT driver for Mesa, written by Mark Leaming
16 * (mark@rsinc.com).
17 */
18
19 /*
20 * $Log: wmesadef.h,v $
21 * Revision 1.1 1999/08/19 00:55:42 jtg
22 * Initial revision
23 *
24 * Revision 1.3 1999/01/03 03:08:57 brianp
25 * Ted Jump's changes
26 *
27 * Initial version 1997/6/14 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
28 */
29
30 /*
31 * $Log: wmesadef.h,v $
32 * Revision 1.1 1999/08/19 00:55:42 jtg
33 * Initial revision
34 *
35 * Revision 1.3 1999/01/03 03:08:57 brianp
36 * Ted Jump's changes
37 *
38 * Revision 2.1 1996/11/15 10:54:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
39 * a new element added to wmesa_context :
40 * dither_flag
41 */
42
43 /*
44 * $Log: wmesadef.h,v $
45 * Revision 1.1 1999/08/19 00:55:42 jtg
46 * Initial revision
47 *
48 * Revision 1.3 1999/01/03 03:08:57 brianp
49 * Ted Jump's changes
50 *
51 * Revision 2.0 1996/11/15 10:54:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
52 * Initial revision
53 */
54
55
56
57 #ifndef DDMESADEF_H
58 #define DDMESADEF_H
59
60 #include <windows.h>
61 #include <GL\gl.h>
62 #include "context.h"
63 #ifdef DDRAW
64 #include <ddraw.h>
65 #endif
66 //#include "profile.h"
67
68 #define REDBITS 0x03
69 #define REDSHIFT 0x00
70 #define GREENBITS 0x03
71 #define GREENSHIFT 0x03
72 #define BLUEBITS 0x02
73 #define BLUESHIFT 0x06
74
75 typedef struct _dibSection{
76 HDC hDC;
77 HANDLE hFileMap;
78 BOOL fFlushed;
79 LPVOID base;
80 }WMDIBSECTION, *PWMDIBSECTION;
81
82
83 typedef struct wmesa_context{
84 GLcontext *gl_ctx; /* The core GL/Mesa context */
85 GLvisual *gl_visual; /* Describes the buffers */
86 GLframebuffer *gl_buffer; /* Depth, stencil, accum, etc buffers */
87
88
89 HWND Window;
90 HDC hDC;
91 HPALETTE hPalette;
92 HPALETTE hOldPalette;
93 HPEN hPen;
94 HPEN hOldPen;
95 HCURSOR hOldCursor;
96 COLORREF crColor;
97 // 3D projection stuff
98 RECT drawRect;
99 UINT uiDIBoffset;
100 // OpenGL stuff
101 HPALETTE hGLPalette;
102 GLuint width;
103 GLuint height;
104 GLuint ScanWidth;
105 GLboolean db_flag; //* double buffered?
106 GLboolean rgb_flag; //* RGB mode?
107 GLboolean dither_flag; //* use dither when 256 color mode for RGB?
108 GLuint depth; //* bits per pixel (1, 8, 24, etc)
109 ULONG pixel; // current color index or RGBA pixel value
110 ULONG clearpixel; //* pixel for clearing the color buffers
111 PBYTE ScreenMem; // WinG memory
112 BITMAPINFO *IndexFormat;
113 HPALETTE hPal; // Current Palette
114 HPALETTE hPalHalfTone;
115
116
117 WMDIBSECTION dib;
118 BITMAPINFO bmi;
119 HBITMAP hbmDIB;
120 HBITMAP hOldBitmap;
121 HBITMAP Old_Compat_BM;
122 HBITMAP Compat_BM; // Bitmap for double buffering
123 PBYTE pbPixels;
124 int nColors;
125 BYTE cColorBits;
126 int pixelformat;
127
128 #ifdef DDRAW
129 LPDIRECTDRAW lpDD; // DirectDraw object
130 // LPDIRECTDRAW2 lpDD2; // DirectDraw object
131 LPDIRECTDRAWSURFACE lpDDSPrimary; // DirectDraw primary surface
132 LPDIRECTDRAWSURFACE lpDDSOffScreen; // DirectDraw off screen surface
133 LPDIRECTDRAWPALETTE lpDDPal; // DirectDraw palette
134 BOOL bActive; // is application active?
135 DDSURFACEDESC ddsd;
136 int fullScreen;
137 int gMode ;
138 #endif
139 RECT rectOffScreen;
140 RECT rectSurface;
141 HWND hwnd;
142 DWORD pitch;
143 PBYTE addrOffScreen;
144 //#ifdef PROFILE
145 // MESAPROF profile;
146 //#endif
147 } *PWMC;
148
149
150 #define PAGE_FILE 0xffffffff
151
152
153
154 #endif