test version of startmenu root with big icons
[reactos.git] / reactos / lib / mesa32 / src / drivers / windows / gdi / 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.1.1 1999/08/19 00:55:42 jt
22 * Imported source
23
24 * Revision 1.3 1999/01/03 03:08:57 brian
25 * Ted Jump's change
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.1.1 1999/08/19 00:55:42 jt
33 * Imported source
34
35 * Revision 1.3 1999/01/03 03:08:57 brian
36 * Ted Jump's change
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.1.1 1999/08/19 00:55:42 jt
46 * Imported source
47
48 * Revision 1.3 1999/01/03 03:08:57 brian
49 * Ted Jump's change
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 // uncomment this to use DirectDraw driver
61 //#define DDRAW 1
62 // uncomment this to use a pointer to a function for setting the pixels
63 // in the buffer
64 #define COMPILE_SETPIXEL 1
65 // uncomment this to enable the fast win32 rasterizers ( commented out for MesaGL 4.0 )
66 // #define FAST_RASTERIZERS 1
67 // uncomment this to enable setting function pointers once inside of
68 // WMesaCreateContext instead of on every call to wmesa_update_state()
69 #define SET_FPOINTERS_ONCE 1
70
71
72 #include <windows.h>
73 #include <GL/gl.h>
74 #include "context.h"
75 #ifdef DDRAW
76 #define DIRECTDRAW_VERSION 0x0100
77 #include <ddraw.h>
78 #endif
79 //#include "profile.h"
80
81 #define REDBITS 0x03
82 #define REDSHIFT 0x00
83 #define GREENBITS 0x03
84 #define GREENSHIFT 0x03
85 #define BLUEBITS 0x02
86 #define BLUESHIFT 0x06
87
88 typedef struct _dibSection{
89 HDC hDC;
90 HANDLE hFileMap;
91 BOOL fFlushed;
92 LPVOID base;
93 }WMDIBSECTION, *PWMDIBSECTION;
94
95 #ifdef COMPILE_SETPIXEL
96 struct wmesa_context;
97 typedef void (*SETPIXELTYPE)(struct wmesa_context *pwc, int iScanLine, int iPixel, BYTE r, BYTE g, BYTE b);
98 #endif
99
100 typedef struct wmesa_context{
101 GLcontext *gl_ctx; /* The core GL/Mesa context */
102 GLvisual *gl_visual; /* Describes the buffers */
103 GLframebuffer *gl_buffer; /* Depth, stencil, accum, etc buffers */
104
105
106 HWND Window;
107 HDC hDC;
108 HPALETTE hPalette;
109 HPALETTE hOldPalette;
110 HPEN hPen;
111 HPEN hOldPen;
112 HCURSOR hOldCursor;
113 COLORREF crColor;
114 // 3D projection stuff
115 RECT drawRect;
116 UINT uiDIBoffset;
117 // OpenGL stuff
118 HPALETTE hGLPalette;
119 GLuint width;
120 GLuint height;
121 GLuint ScanWidth;
122 GLboolean db_flag; //* double buffered?
123 GLboolean rgb_flag; //* RGB mode?
124 GLboolean dither_flag; //* use dither when 256 color mode for RGB?
125 GLuint depth; //* bits per pixel (1, 8, 24, etc)
126 ULONG pixel; // current color index or RGBA pixel value
127 ULONG clearpixel; //* pixel for clearing the color buffers
128 PBYTE ScreenMem; // WinG memory
129 BITMAPINFO *IndexFormat;
130 HPALETTE hPal; // Current Palette
131 HPALETTE hPalHalfTone;
132
133
134 WMDIBSECTION dib;
135 BITMAPINFO bmi;
136 HBITMAP hbmDIB;
137 HBITMAP hOldBitmap;
138 HBITMAP Old_Compat_BM;
139 HBITMAP Compat_BM; // Bitmap for double buffering
140 PBYTE pbPixels;
141 int nColors;
142 BYTE cColorBits;
143 int pixelformat;
144
145 #ifdef DDRAW
146 LPDIRECTDRAW lpDD; // DirectDraw object
147 // LPDIRECTDRAW2 lpDD2; // DirectDraw object
148 LPDIRECTDRAWSURFACE lpDDSPrimary; // DirectDraw primary surface
149 LPDIRECTDRAWSURFACE lpDDSOffScreen; // DirectDraw off screen surface
150 LPDIRECTDRAWPALETTE lpDDPal; // DirectDraw palette
151 BOOL bActive; // is application active?
152 DDSURFACEDESC ddsd; // surface description
153 int fullScreen; // fullscreen ?
154 int gMode ; // fullscreen mode
155 LONG oldWndProc; // old Window proc. we need to hook WM_MOVE message to update the drawing rectangle
156 #endif
157 RECT rectOffScreen;
158 RECT rectSurface;
159 HWND hwnd;
160 DWORD pitch;
161 PBYTE addrOffScreen;
162 #ifdef COMPILE_SETPIXEL
163 SETPIXELTYPE wmSetPixel;
164 #endif // COMPILE_SETPIXEL
165 //#ifdef PROFILE
166 // MESAPROF profile;
167 //#endif
168 } *PWMC;
169
170
171 #define PAGE_FILE 0xffffffff
172
173
174
175 #endif