home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 5 / MA_Cover_5.iso / ppc / mesa / src / wmesadef.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-31  |  3.5 KB  |  135 lines

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