1 /* File name : wmesadef.h
4 * Header file for display driver for Mesa 2.3 under
5 * Windows95, WindowsNT and Win32
7 * Copyright (C) 1996- Li Wei
8 * Address : Institute of Artificial Intelligence
10 * : Xi'an Jiaotong University
11 * Email : liwei@aiar.xjtu.edu.cn
12 * Web page : http://sun.aiar.xjtu.edu.cn
14 * This file and its associations are partially based on the
15 * Windows NT driver for Mesa, written by Mark Leaming
21 * Revision 1.1.1.1 1999/08/19 00:55:42 jt
24 * Revision 1.3 1999/01/03 03:08:57 brian
27 * Initial version 1997/6/14 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
32 * Revision 1.1.1.1 1999/08/19 00:55:42 jt
35 * Revision 1.3 1999/01/03 03:08:57 brian
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 :
45 * Revision 1.1.1.1 1999/08/19 00:55:42 jt
48 * Revision 1.3 1999/01/03 03:08:57 brian
51 * Revision 2.0 1996/11/15 10:54:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
60 // uncomment this to use DirectDraw driver
62 // uncomment this to use a pointer to a function for setting the pixels
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
76 #define DIRECTDRAW_VERSION 0x0100
79 //#include "profile.h"
83 #define GREENBITS 0x03
84 #define GREENSHIFT 0x03
86 #define BLUESHIFT 0x06
88 typedef struct _dibSection
{
93 }WMDIBSECTION
, *PWMDIBSECTION
;
95 #ifdef COMPILE_SETPIXEL
97 typedef void (*SETPIXELTYPE
)(struct wmesa_context
*pwc
, int iScanLine
, int iPixel
, BYTE r
, BYTE g
, BYTE b
);
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 */
109 HPALETTE hOldPalette
;
114 // 3D projection stuff
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
;
138 HBITMAP Old_Compat_BM
;
139 HBITMAP Compat_BM
; // Bitmap for double buffering
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
162 #ifdef COMPILE_SETPIXEL
163 SETPIXELTYPE wmSetPixel
;
164 #endif // COMPILE_SETPIXEL
171 #define PAGE_FILE 0xffffffff