source: trunk/src/opengl/mesa/wmesadef.h@ 2963

Last change on this file since 2963 was 2962, checked in by jeroen, 25 years ago

* empty log message *

File size: 6.7 KB
Line 
1/* $Id: wmesadef.h,v 1.2 2000-03-01 18:49:40 jeroen 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.2 2000-03-01 18:49:40 jeroen
23 * *** empty log message ***
24 *
25 * Revision 1.1 2000/02/29 00:48:44 sandervl
26 * created
27 *
28 * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
29 * Imported sources
30 *
31 * Revision 1.3 1999/01/03 03:08:57 brianp
32 * Ted Jump's changes
33 *
34 * Initial version 1997/6/14 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
35 */
36
37/*
38 * $Log: wmesadef.h,v $
39 * Revision 1.2 2000-03-01 18:49:40 jeroen
40 * *** empty log message ***
41 *
42 * Revision 1.1 2000/02/29 00:48:44 sandervl
43 * created
44 *
45 * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
46 * Imported sources
47 *
48 * Revision 1.3 1999/01/03 03:08:57 brianp
49 * Ted Jump's changes
50 *
51 * Revision 2.1 1996/11/15 10:54:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
52 * a new element added to wmesa_context :
53 * dither_flag
54 */
55
56/*
57 * $Log: wmesadef.h,v $
58 * Revision 1.2 2000-03-01 18:49:40 jeroen
59 * *** empty log message ***
60 *
61 * Revision 1.1 2000/02/29 00:48:44 sandervl
62 * created
63 *
64 * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
65 * Imported sources
66 *
67 * Revision 1.3 1999/01/03 03:08:57 brianp
68 * Ted Jump's changes
69 *
70 * Revision 2.0 1996/11/15 10:54:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
71 * Initial revision
72 */
73
74
75
76#ifndef DDMESADEF_H
77#define DDMESADEF_H
78
79#ifdef __WIN32OS2__/* Nope, we use this hdr in DIVE code, so instead include*/
80 /* os2win.h in the source if it is needed! */
81//#include <os2win.h>
82#else
83#include <windows.h>
84#endif
85
86#if defined(DDRAW)
87#include <ddraw.h>
88#endif
89
90//#include "gl.h"
91//#include "context.h"
92//#include "profile.h"
93
94#define REDBITS 0x03
95#define REDSHIFT 0x00
96#define GREENBITS 0x03
97#define GREENSHIFT 0x03
98#define BLUEBITS 0x02
99#define BLUESHIFT 0x06
100
101typedef struct _dibSection{
102 HDC hDC;
103 HANDLE hFileMap;
104 BOOL fFlushed;
105 LPVOID base;
106}WMDIBSECTION, *PWMDIBSECTION;
107
108typedef struct tagMY_RECTL
109 {
110 LONG xLeft,xRight,yBottom,yTop;
111 }MY_RECTL;
112
113typedef struct wmesa_context{
114 /* This defs *MUST* be at the TOP, since some structure definitions below */
115 /* are NOT correct!! This is because of the fact that wmesa is WIN based, */
116 /* whereas this file is OS/2 based. If we put this stuff at the end of the */
117 /* structure the offsets to for example the hDiveInstance will be */
118 /* interpreted differently in this file and in wmesa.c. */
119#ifdef DIVE
120 ULONG hDiveInstance; /* This actually is a DIVE Handle */
121 ULONG BackBufferNumber;
122 PVOID ppFrameBuffer;
123 ULONG ScanLineBytes,ScanLines;
124 POINT WinPos;
125 WNDPROC hWndProc;
126 BOOL DiveSoftwareBlit;/* If BlitSetup failed do it in SW*/
127 ULONG NumClipRects; /* Clip-info is maintained here */
128 MY_RECTL rctls[50];
129 HRGN hrgn;
130 HDC hps;
131 BOOL BackBufferOwnAllocation;
132 GLint awidth,aheight; /* Allocated w/h for ImageBuffer */
133#endif
134 PBYTE pbPixels;
135 int nColors;
136 BYTE cColorBits;
137 int pixelformat;
138 GLboolean db_flag; /* double buffered? */
139 GLboolean rgb_flag; /* RGB mode? */
140 GLboolean dither_flag;/* use dither when 256 color mode for RGB?*/
141 GLuint depth; /* bits per pixel (1, 8, 24, etc) */
142 ULONG pixel; /* current color index or RGBA pixel value*/
143 ULONG clearpixel; //* pixel for clearing the color buffers*/
144 GLuint width;
145 GLuint height;
146 unsigned long ScanWidth;
147
148 GLcontext *gl_ctx; /* The core GL/Mesa context*/
149 GLvisual *gl_visual; /* Describes the buffers*/
150 GLframebuffer *gl_buffer; /* Depth, stencil, accum, etc buffers*/
151 RECT drawRect;
152 UINT uiDIBoffset;
153 PBYTE ScreenMem; /* WinG memory */
154 HPALETTE hPal; /* Current Palette */
155 HPALETTE hPalHalfTone;
156 HPALETTE hGLPalette;
157 WMDIBSECTION dib;
158 BITMAPINFO *IndexFormat;
159 BITMAPINFO bmi;
160 HBITMAP hbmDIB;
161 HBITMAP hOldBitmap;
162 HBITMAP Old_Compat_BM;
163 HBITMAP Compat_BM; /* Bitmap for double buffering */
164 HWND Window;
165 HDC hDC;
166 HPALETTE hPalette;
167 HPALETTE hOldPalette;
168 HPEN hPen;
169 HPEN hOldPen;
170 HCURSOR hOldCursor;
171 COLORREF crColor;
172#ifdef DDRAW
173 LPDIRECTDRAW lpDD; /* DirectDraw object */
174// LPDIRECTDRAW2 lpDD2; /* DirectDraw object*/
175 LPDIRECTDRAWSURFACE lpDDSPrimary; /* DirectDraw primary surface*/
176 LPDIRECTDRAWSURFACE lpDDSOffScreen; // DirectDraw off screen surface
177 LPDIRECTDRAWPALETTE lpDDPal; // DirectDraw palette
178 BOOL bActive; /* is application active? */
179 DDSURFACEDESC ddsd;
180 int fullScreen;
181 int gMode ;
182#endif
183 RECT rectOffScreen;
184 RECT rectSurface;
185 HWND hwnd;
186 DWORD pitch;
187 PBYTE addrOffScreen;
188 /* #ifdef PROFILE */
189 /* MESAPROF profile; */
190 /* #endif */
191} *PWMC;
192
193
194#define PAGE_FILE 0xffffffff
195
196
197
198#endif
Note: See TracBrowser for help on using the repository browser.