[3597] | 1 | /* $Id: wmesadef.h,v 1.3 2000-05-23 20:35:00 jeroen Exp $ */
|
---|
[2938] | 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 $
|
---|
[3597] | 22 | * Revision 1.3 2000-05-23 20:35:00 jeroen
|
---|
[2962] | 23 | * *** empty log message ***
|
---|
| 24 | *
|
---|
[3597] | 25 | * Revision 1.2 2000/03/01 18:49:40 jeroen
|
---|
| 26 | * *** empty log message ***
|
---|
| 27 | *
|
---|
[2962] | 28 | * Revision 1.1 2000/02/29 00:48:44 sandervl
|
---|
[2938] | 29 | * created
|
---|
| 30 | *
|
---|
| 31 | * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
|
---|
| 32 | * Imported sources
|
---|
| 33 | *
|
---|
| 34 | * Revision 1.3 1999/01/03 03:08:57 brianp
|
---|
| 35 | * Ted Jump's changes
|
---|
| 36 | *
|
---|
| 37 | * Initial version 1997/6/14 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
|
---|
| 38 | */
|
---|
| 39 |
|
---|
| 40 | /*
|
---|
| 41 | * $Log: wmesadef.h,v $
|
---|
[3597] | 42 | * Revision 1.3 2000-05-23 20:35:00 jeroen
|
---|
[2962] | 43 | * *** empty log message ***
|
---|
| 44 | *
|
---|
[3597] | 45 | * Revision 1.2 2000/03/01 18:49:40 jeroen
|
---|
| 46 | * *** empty log message ***
|
---|
| 47 | *
|
---|
[2962] | 48 | * Revision 1.1 2000/02/29 00:48:44 sandervl
|
---|
[2938] | 49 | * created
|
---|
| 50 | *
|
---|
| 51 | * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
|
---|
| 52 | * Imported sources
|
---|
| 53 | *
|
---|
| 54 | * Revision 1.3 1999/01/03 03:08:57 brianp
|
---|
| 55 | * Ted Jump's changes
|
---|
| 56 | *
|
---|
| 57 | * Revision 2.1 1996/11/15 10:54:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
|
---|
| 58 | * a new element added to wmesa_context :
|
---|
| 59 | * dither_flag
|
---|
| 60 | */
|
---|
| 61 |
|
---|
| 62 | /*
|
---|
| 63 | * $Log: wmesadef.h,v $
|
---|
[3597] | 64 | * Revision 1.3 2000-05-23 20:35:00 jeroen
|
---|
[2962] | 65 | * *** empty log message ***
|
---|
| 66 | *
|
---|
[3597] | 67 | * Revision 1.2 2000/03/01 18:49:40 jeroen
|
---|
| 68 | * *** empty log message ***
|
---|
| 69 | *
|
---|
[2962] | 70 | * Revision 1.1 2000/02/29 00:48:44 sandervl
|
---|
[2938] | 71 | * created
|
---|
| 72 | *
|
---|
| 73 | * Revision 1.1.1.1 1999/08/19 00:55:42 jtg
|
---|
| 74 | * Imported sources
|
---|
| 75 | *
|
---|
| 76 | * Revision 1.3 1999/01/03 03:08:57 brianp
|
---|
| 77 | * Ted Jump's changes
|
---|
| 78 | *
|
---|
| 79 | * Revision 2.0 1996/11/15 10:54:00 CST by Li Wei(liwei@aiar.xjtu.edu.cn)
|
---|
| 80 | * Initial revision
|
---|
| 81 | */
|
---|
| 82 |
|
---|
| 83 |
|
---|
| 84 |
|
---|
| 85 | #ifndef DDMESADEF_H
|
---|
| 86 | #define DDMESADEF_H
|
---|
| 87 |
|
---|
| 88 | #if defined(DDRAW)
|
---|
[21479] | 89 | #include <ddraw.h>
|
---|
[2938] | 90 | #endif
|
---|
| 91 |
|
---|
| 92 | #define REDBITS 0x03
|
---|
| 93 | #define REDSHIFT 0x00
|
---|
| 94 | #define GREENBITS 0x03
|
---|
| 95 | #define GREENSHIFT 0x03
|
---|
| 96 | #define BLUEBITS 0x02
|
---|
| 97 | #define BLUESHIFT 0x06
|
---|
| 98 |
|
---|
[3597] | 99 | typedef HANDLE ULONG;
|
---|
| 100 |
|
---|
[2938] | 101 | typedef struct _dibSection{
|
---|
[3597] | 102 | HDC hDC;
|
---|
[2938] | 103 | HANDLE hFileMap;
|
---|
| 104 | BOOL fFlushed;
|
---|
| 105 | LPVOID base;
|
---|
| 106 | }WMDIBSECTION, *PWMDIBSECTION;
|
---|
| 107 |
|
---|
[2962] | 108 | typedef struct tagMY_RECTL
|
---|
| 109 | {
|
---|
| 110 | LONG xLeft,xRight,yBottom,yTop;
|
---|
| 111 | }MY_RECTL;
|
---|
[2938] | 112 |
|
---|
| 113 | typedef struct wmesa_context{
|
---|
[2962] | 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;
|
---|
[3597] | 122 | PVOID ppFrameBuffer; /* FrameBuffer address - used for DIRECT access to screen only */
|
---|
[2962] | 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;
|
---|
[3597] | 132 | GLint awidth,aheight;/* Allocated w/h for ImageBuffer */
|
---|
[2962] | 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;
|
---|
[2938] | 147 |
|
---|
[2962] | 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*/
|
---|
[3597] | 151 |
|
---|
| 152 | /* 3D projection stuff */
|
---|
[2962] | 153 | RECT drawRect;
|
---|
| 154 | UINT uiDIBoffset;
|
---|
[3597] | 155 | /* OpenGL stuff */
|
---|
[2962] | 156 | HPALETTE hGLPalette;
|
---|
[3597] | 157 | PBYTE ScreenMem; /* WinG memory */
|
---|
| 158 | BITMAPINFO *IndexFormat;
|
---|
| 159 | HPALETTE hPal; /* Current Palette */
|
---|
| 160 | HPALETTE hPalHalfTone;
|
---|
| 161 |
|
---|
| 162 |
|
---|
| 163 | WMDIBSECTION dib;
|
---|
[2962] | 164 | BITMAPINFO bmi;
|
---|
| 165 | HBITMAP hbmDIB;
|
---|
| 166 | HBITMAP hOldBitmap;
|
---|
[3597] | 167 | HBITMAP Old_Compat_BM;
|
---|
| 168 | HBITMAP Compat_BM;/* Bitmap for double buffering*/
|
---|
| 169 |
|
---|
[2962] | 170 | HWND Window;
|
---|
[2938] | 171 | HDC hDC;
|
---|
| 172 | HPALETTE hPalette;
|
---|
| 173 | HPALETTE hOldPalette;
|
---|
| 174 | HPEN hPen;
|
---|
| 175 | HPEN hOldPen;
|
---|
| 176 | HCURSOR hOldCursor;
|
---|
| 177 | COLORREF crColor;
|
---|
| 178 | #ifdef DDRAW
|
---|
[2962] | 179 | LPDIRECTDRAW lpDD; /* DirectDraw object */
|
---|
| 180 | // LPDIRECTDRAW2 lpDD2; /* DirectDraw object*/
|
---|
| 181 | LPDIRECTDRAWSURFACE lpDDSPrimary; /* DirectDraw primary surface*/
|
---|
[2938] | 182 | LPDIRECTDRAWSURFACE lpDDSOffScreen; // DirectDraw off screen surface
|
---|
| 183 | LPDIRECTDRAWPALETTE lpDDPal; // DirectDraw palette
|
---|
[2962] | 184 | BOOL bActive; /* is application active? */
|
---|
[2938] | 185 | DDSURFACEDESC ddsd;
|
---|
| 186 | int fullScreen;
|
---|
| 187 | int gMode ;
|
---|
| 188 | #endif
|
---|
| 189 | RECT rectOffScreen;
|
---|
| 190 | RECT rectSurface;
|
---|
| 191 | HWND hwnd;
|
---|
| 192 | DWORD pitch;
|
---|
| 193 | PBYTE addrOffScreen;
|
---|
[2962] | 194 | /* #ifdef PROFILE */
|
---|
| 195 | /* MESAPROF profile; */
|
---|
| 196 | /* #endif */
|
---|
[2938] | 197 | } *PWMC;
|
---|
| 198 |
|
---|
| 199 |
|
---|
| 200 | #define PAGE_FILE 0xffffffff
|
---|
| 201 |
|
---|
| 202 |
|
---|
| 203 |
|
---|
| 204 | #endif
|
---|