home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mesa5.zip / mesa5src.zip / os2mesadef.h < prev    next >
Text File  |  2002-12-11  |  4KB  |  130 lines

  1. /*     File name       :       os2mesadef.h
  2.  */
  3.  
  4.  
  5. #ifndef DDMESADEF_H
  6. #define DDMESADEF_H
  7.  
  8. #include <dive.h>
  9.  
  10. #include "GL\gl.h"
  11. #include "context.h"
  12.  
  13. #define REDBITS                0x03
  14. #define REDSHIFT       0x00
  15. #define GREENBITS      0x03
  16. #define GREENSHIFT     0x03
  17. #define BLUEBITS       0x02
  18. #define BLUESHIFT      0x06
  19.  
  20. //typedef struct _dibSection{
  21. //       HDC             hDC;
  22. //       void *  hFileMap;
  23. //       BOOL    fFlushed;
  24. //       void *  base;
  25. //}WMDIBSECTION, *PWMDIBSECTION;
  26.  
  27. typedef struct _memoryBuffer
  28. {
  29.   PBYTE  pBmpBuffer;
  30.   int LbmpBuff;
  31.   int bNx,bNy;
  32.   int BytesPerBmpPixel;
  33.   BITMAPINFO2    bmi_mem;
  34.  HDC hdcMem;
  35.  HPS hpsMem;
  36.  
  37. } MEMBUF, *PMEMBUF;
  38.  
  39.  
  40. struct VideoDevConfigCaps
  41. { int  sts;
  42.   LONG Caps[CAPS_DEVICE_POLYSET_POINTS];
  43. };
  44.  
  45.  
  46. typedef struct wmesa_context{
  47.     GLcontext *gl_ctx;         /* The core GL/Mesa context */
  48.     GLvisual *gl_visual;               /* Describes the buffers */
  49.     GLframebuffer *gl_buffer;  /* Depth, stencil, accum, etc buffers */
  50.     HAB             hab; 
  51.     HWND            Window;
  52.     HDC             hDC;
  53.     HPAL            hPalette;
  54.     HPAL            hOldPalette;
  55.  
  56. // Dive variables
  57.     int             useDive;
  58.     HDIVE           hDive;
  59.     DIVE_CAPS       DiveCaps;          //    = {0};
  60.     FOURCC          fccFormats[100];   //    = {0};
  61.     BOOL            bDiveHaveBuffer;   //    = FALSE;
  62.     ULONG           ulDiveBufferNumber;// = 0;
  63.     int             xDiveScr,yDiveScr; // left low corner
  64. //??    HPEN                hPen;
  65. //??    HPEN                hOldPen;
  66. //??    HCURSOR             hOldCursor;
  67. //??    COLORREF            crColor;
  68.  
  69.     // 3D projection stuff
  70.  
  71.     RECTL                drawRect;
  72.     UINT                uiDIBoffset;
  73.     // OpenGL stuff
  74.  
  75.     HPAL            hGLPalette;
  76.        GLuint                          width;
  77.        GLuint                          height;
  78.        GLuint                          ScanWidth;
  79.        GLboolean                       db_flag;        // * double buffered?
  80.        GLboolean                       rgb_flag;       // * RGB mode?
  81.        GLboolean                       dither_flag;    // * use dither when 256 color mode for RGB?
  82.        GLuint                          depth;          // * bits per pixel (1, 8, 24, etc)
  83.        ULONG                           pixel;  // current color index or RGBA pixel value
  84.        ULONG                           clearpixel; // * pixel for clearing the color buffers
  85.        PBYTE                           ScreenMem; // WinG memory
  86.        BITMAPINFO                      *IndexFormat;
  87.        HPS                         hps;  // (current ?) presentation space handle
  88.        HPAL                        hPal; // Current Palette
  89.        HPAL                        hPalHalfTone;
  90.  
  91. //       WMDIBSECTION            dib;
  92. //       HBITMAP             hbmDIB;
  93.  
  94.     MEMBUF               memb;
  95.     BITMAPINFOHEADER2    bmi;
  96.     HBITMAP              hbm;
  97.  
  98.     HBITMAP             hOldBitmap;
  99.        HBITMAP                         Old_Compat_BM;
  100.        HBITMAP                         Compat_BM;            // Bitmap for double buffering
  101.     PBYTE               pbPixels;
  102.     int                 nColors;
  103.     int                 nColorBits;
  104.        int                                     pixelformat;
  105.  
  106.         RECTL                                  rectOffScreen;
  107.        RECTL                                   rectSurface;
  108.        HWND                                    hwnd;
  109.        int                                   pitch;
  110.        PBYTE                                   addrOffScreen;
  111.  
  112. }  *PWMC;
  113.  
  114.  
  115.  
  116.  
  117. struct DISPLAY_OPTIONS {
  118.        int  stereo;
  119.        int  fullScreen;
  120.        int      mode;
  121.        int      bpp;
  122. };
  123.  
  124.  
  125. #define PAGE_FILE              0xffffffff
  126.  
  127.  
  128.  
  129. #endif
  130.