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