| 1 | /* $Id: wmesadef.h,v 1.3 2000-05-23 20:35:00 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.3  2000-05-23 20:35:00  jeroen | 
|---|
| 23 | * *** empty log message *** | 
|---|
| 24 | * | 
|---|
| 25 | * Revision 1.2  2000/03/01 18:49:40  jeroen | 
|---|
| 26 | * *** empty log message *** | 
|---|
| 27 | * | 
|---|
| 28 | * Revision 1.1  2000/02/29 00:48:44  sandervl | 
|---|
| 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 $ | 
|---|
| 42 | * Revision 1.3  2000-05-23 20:35:00  jeroen | 
|---|
| 43 | * *** empty log message *** | 
|---|
| 44 | * | 
|---|
| 45 | * Revision 1.2  2000/03/01 18:49:40  jeroen | 
|---|
| 46 | * *** empty log message *** | 
|---|
| 47 | * | 
|---|
| 48 | * Revision 1.1  2000/02/29 00:48:44  sandervl | 
|---|
| 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 $ | 
|---|
| 64 | * Revision 1.3  2000-05-23 20:35:00  jeroen | 
|---|
| 65 | * *** empty log message *** | 
|---|
| 66 | * | 
|---|
| 67 | * Revision 1.2  2000/03/01 18:49:40  jeroen | 
|---|
| 68 | * *** empty log message *** | 
|---|
| 69 | * | 
|---|
| 70 | * Revision 1.1  2000/02/29 00:48:44  sandervl | 
|---|
| 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) | 
|---|
| 89 | #ifdef __WIN32OS2__ | 
|---|
| 90 | #define __WINE_DD_OBJ_BASE_H/* Don't include dd_obj_base.h, or the file won't*/ | 
|---|
| 91 | #endif                                 /* compile due to redefined symbols.*/ | 
|---|
| 92 | #include <ddraw.h>          /* Is this a bug in the Odin DDRAW implementation??*/ | 
|---|
| 93 | #endif | 
|---|
| 94 |  | 
|---|
| 95 | #define REDBITS         0x03 | 
|---|
| 96 | #define REDSHIFT        0x00 | 
|---|
| 97 | #define GREENBITS       0x03 | 
|---|
| 98 | #define GREENSHIFT      0x03 | 
|---|
| 99 | #define BLUEBITS        0x02 | 
|---|
| 100 | #define BLUESHIFT       0x06 | 
|---|
| 101 |  | 
|---|
| 102 | typedef HANDLE ULONG; | 
|---|
| 103 |  | 
|---|
| 104 | typedef struct _dibSection{ | 
|---|
| 105 | HDC     hDC; | 
|---|
| 106 | HANDLE  hFileMap; | 
|---|
| 107 | BOOL    fFlushed; | 
|---|
| 108 | LPVOID  base; | 
|---|
| 109 | }WMDIBSECTION, *PWMDIBSECTION; | 
|---|
| 110 |  | 
|---|
| 111 | typedef struct tagMY_RECTL | 
|---|
| 112 | { | 
|---|
| 113 | LONG xLeft,xRight,yBottom,yTop; | 
|---|
| 114 | }MY_RECTL; | 
|---|
| 115 |  | 
|---|
| 116 | typedef struct wmesa_context{ | 
|---|
| 117 | /* This defs *MUST* be at the TOP, since some structure definitions below  */ | 
|---|
| 118 | /* are NOT correct!! This is because of the fact that wmesa is WIN based,  */ | 
|---|
| 119 | /* whereas this file is OS/2 based. If we put this stuff at the end of the */ | 
|---|
| 120 | /* structure the offsets to for example the hDiveInstance will be          */ | 
|---|
| 121 | /* interpreted differently in this file and in wmesa.c.                    */ | 
|---|
| 122 | #ifdef DIVE | 
|---|
| 123 | ULONG               hDiveInstance; /* This actually is a DIVE Handle   */ | 
|---|
| 124 | ULONG               BackBufferNumber; | 
|---|
| 125 | PVOID               ppFrameBuffer; /* FrameBuffer address - used for DIRECT access to screen only */ | 
|---|
| 126 | ULONG               ScanLineBytes,ScanLines; | 
|---|
| 127 | POINT               WinPos; | 
|---|
| 128 | WNDPROC             hWndProc; | 
|---|
| 129 | BOOL                DiveSoftwareBlit;/* If BlitSetup failed do it in SW*/ | 
|---|
| 130 | ULONG               NumClipRects;  /* Clip-info is maintained here     */ | 
|---|
| 131 | MY_RECTL            rctls[50]; | 
|---|
| 132 | HRGN                hrgn; | 
|---|
| 133 | HDC                 hps; | 
|---|
| 134 | BOOL                BackBufferOwnAllocation; | 
|---|
| 135 | GLint               awidth,aheight;/* Allocated w/h for ImageBuffer    */ | 
|---|
| 136 | #endif | 
|---|
| 137 | PBYTE               pbPixels; | 
|---|
| 138 | int                 nColors; | 
|---|
| 139 | BYTE                cColorBits; | 
|---|
| 140 | int                 pixelformat; | 
|---|
| 141 | GLboolean           db_flag;       /* double buffered?                 */ | 
|---|
| 142 | GLboolean           rgb_flag;      /* RGB mode?                        */ | 
|---|
| 143 | GLboolean           dither_flag;/* use dither when 256 color mode for RGB?*/ | 
|---|
| 144 | GLuint              depth;         /* bits per pixel (1, 8, 24, etc)   */ | 
|---|
| 145 | ULONG               pixel;   /* current color index or RGBA pixel value*/ | 
|---|
| 146 | ULONG               clearpixel; //* pixel for clearing the color buffers*/ | 
|---|
| 147 | GLuint              width; | 
|---|
| 148 | GLuint              height; | 
|---|
| 149 | unsigned long       ScanWidth; | 
|---|
| 150 |  | 
|---|
| 151 | GLcontext          *gl_ctx;                 /* The core GL/Mesa context*/ | 
|---|
| 152 | GLvisual           *gl_visual;                 /* Describes the buffers*/ | 
|---|
| 153 | GLframebuffer      *gl_buffer;    /* Depth, stencil, accum, etc buffers*/ | 
|---|
| 154 |  | 
|---|
| 155 | /* 3D projection stuff */ | 
|---|
| 156 | RECT                drawRect; | 
|---|
| 157 | UINT                uiDIBoffset; | 
|---|
| 158 | /* OpenGL stuff                     */ | 
|---|
| 159 | HPALETTE            hGLPalette; | 
|---|
| 160 | PBYTE                           ScreenMem; /* WinG memory              */ | 
|---|
| 161 | BITMAPINFO                      *IndexFormat; | 
|---|
| 162 | HPALETTE                        hPal;      /* Current Palette          */ | 
|---|
| 163 | HPALETTE                        hPalHalfTone; | 
|---|
| 164 |  | 
|---|
| 165 |  | 
|---|
| 166 | WMDIBSECTION            dib; | 
|---|
| 167 | BITMAPINFO          bmi; | 
|---|
| 168 | HBITMAP             hbmDIB; | 
|---|
| 169 | HBITMAP             hOldBitmap; | 
|---|
| 170 | HBITMAP                         Old_Compat_BM; | 
|---|
| 171 | HBITMAP                         Compat_BM;/* Bitmap for double buffering*/ | 
|---|
| 172 |  | 
|---|
| 173 | HWND                Window; | 
|---|
| 174 | HDC                 hDC; | 
|---|
| 175 | HPALETTE            hPalette; | 
|---|
| 176 | HPALETTE            hOldPalette; | 
|---|
| 177 | HPEN                hPen; | 
|---|
| 178 | HPEN                hOldPen; | 
|---|
| 179 | HCURSOR             hOldCursor; | 
|---|
| 180 | COLORREF            crColor; | 
|---|
| 181 | #ifdef DDRAW | 
|---|
| 182 | LPDIRECTDRAW            lpDD;  /* DirectDraw object                */ | 
|---|
| 183 | //      LPDIRECTDRAW2            lpDD2;                /* DirectDraw object*/ | 
|---|
| 184 | LPDIRECTDRAWSURFACE     lpDDSPrimary; /* DirectDraw primary surface*/ | 
|---|
| 185 | LPDIRECTDRAWSURFACE     lpDDSOffScreen; // DirectDraw off screen surface | 
|---|
| 186 | LPDIRECTDRAWPALETTE     lpDDPal;        // DirectDraw palette | 
|---|
| 187 | BOOL                    bActive;       /* is application active?   */ | 
|---|
| 188 | DDSURFACEDESC           ddsd; | 
|---|
| 189 | int                                     fullScreen; | 
|---|
| 190 | int                                 gMode ; | 
|---|
| 191 | #endif | 
|---|
| 192 | RECT                                    rectOffScreen; | 
|---|
| 193 | RECT                                    rectSurface; | 
|---|
| 194 | HWND                                    hwnd; | 
|---|
| 195 | DWORD                                   pitch; | 
|---|
| 196 | PBYTE                                   addrOffScreen; | 
|---|
| 197 | /* #ifdef PROFILE                   */ | 
|---|
| 198 | /* MESAPROF        profile;         */ | 
|---|
| 199 | /* #endif                           */ | 
|---|
| 200 | }  *PWMC; | 
|---|
| 201 |  | 
|---|
| 202 |  | 
|---|
| 203 | #define PAGE_FILE               0xffffffff | 
|---|
| 204 |  | 
|---|
| 205 |  | 
|---|
| 206 |  | 
|---|
| 207 | #endif | 
|---|