os2 video: updates to my_gradd.h
authorOzkan Sezer
Wed, 21 Oct 2020 23:28:02 +0300
changeset 1418569e84b7a2d21
parent 14181 5e54294cae9e
child 14186 ee7543aa2fa5
os2 video: updates to my_gradd.h
src/video/os2/my_gradd.h
     1.1 --- a/src/video/os2/my_gradd.h	Tue Oct 20 11:51:23 2020 -0700
     1.2 +++ b/src/video/os2/my_gradd.h	Wed Oct 21 23:28:02 2020 +0300
     1.3 @@ -25,10 +25,29 @@
     1.4  
     1.5  #define VMI_CMD_INITPROC 1
     1.6  #define VMI_CMD_TERMPROC 3
     1.7 +#define VMI_CMD_QUERYMODES 5
     1.8 +#define VMI_CMD_SETMODE 6
     1.9 +#define VMI_CMD_PALETTE 7
    1.10  #define VMI_CMD_BITBLT 8
    1.11 +#define VMI_CMD_LINE  9
    1.12  #define VMI_CMD_REQUESTHW 14
    1.13  #define VMI_CMD_QUERYCURRENTMODE 0x1001
    1.14  
    1.15 +#define QUERYMODE_NUM_MODES 0x01
    1.16 +#define QUERYMODE_MODE_DATA 0x02
    1.17 +
    1.18 +typedef struct _HWPALETTEINFO {
    1.19 +  ULONG     ulLength;         /* Size of the HWPALETTEINFO data structure, in bytes. */
    1.20 +  ULONG     fFlags;           /* Palette flag. */
    1.21 +  ULONG     ulStartIndex;     /* Starting palette index. */
    1.22 +  ULONG     ulNumEntries;     /* Number of palette slots to query or set. */
    1.23 +  PRGB2     pRGBs;            /* Pointer to the array of RGB values. */
    1.24 +} HWPALETTEINFO;
    1.25 +typedef HWPALETTEINFO *PHWPALETTEINFO;
    1.26 +
    1.27 +#define PALETTE_GET 0x01
    1.28 +#define PALETTE_SET 0x02
    1.29 +
    1.30  typedef struct _BMAPINFO {
    1.31    ULONG     ulLength;         /* Length of the BMAPINFO data structure, in bytes. */
    1.32    ULONG     ulType;           /* Description of the Blt. */
    1.33 @@ -43,6 +62,44 @@
    1.34  #define BMAP_VRAM 0
    1.35  #define BMAP_MEMORY 1
    1.36  
    1.37 +typedef struct _LINEPACK {
    1.38 +  ULONG        ulStyleStep;   /* Value to be added to ulStyleValue. */
    1.39 +  ULONG        ulStyleValue;  /* Style value at the current pel. */
    1.40 +  ULONG        ulFlags;       /* Flags used for the LINEPACK data structure. */
    1.41 +  struct _LINEPACK *plpkNext; /* Pointer to next LINEPACK data structure. */
    1.42 +  ULONG        ulAbsDeltaX;   /* Clipped Bresenham Delta X, absolute. */
    1.43 +  ULONG        ulAbsDeltaY;   /* Clipped Bresenham Delta Y, absolute. */
    1.44 +  POINTL       ptlClipStart;  /* Pointer to location for device to perform Bresenham algorithm. */
    1.45 +  POINTL       ptlClipEnd;    /* Ending location for Bresenham algorithm (see ptlClipStart). */
    1.46 +  POINTL       ptlStart;      /* Pointer to starting location for line. */
    1.47 +  POINTL       ptlEnd;        /* Ending location for line. */
    1.48 +  LONG         lClipStartError;/* Standard Bresenham error at the clipped start point. */
    1.49 +} LINEPACK;
    1.50 +typedef LINEPACK *PLINEPACK;
    1.51 +
    1.52 +typedef struct _LINEINFO {
    1.53 +  ULONG         ulLength;     /* Length of LINEINFO data structure. */
    1.54 +  ULONG         ulType;       /* Defines line type. */
    1.55 +  ULONG         ulStyleMask;  /* A 32-bit style mask. */
    1.56 +  ULONG         cLines;       /* Count of lines to be drawn. */
    1.57 +  ULONG         ulFGColor;    /* Line Foreground color. */
    1.58 +  ULONG         ulBGColor;    /* Line Background color. */
    1.59 +  USHORT        usForeROP;    /* Line Foreground mix. */
    1.60 +  USHORT        usBackROP;    /* Line Background mix. */
    1.61 +  PBMAPINFO     pDstBmapInfo; /* Pointer to destination surface bit map. */
    1.62 +  PLINEPACK     alpkLinePack; /* Pointer to LINEPACK data structure. */
    1.63 +  PRECTL        prclBounds;   /* Pointer to bounding rect of a clipped line. */
    1.64 +} LINEINFO;
    1.65 +typedef LINEINFO *PLINEINFO;
    1.66 +
    1.67 +#define LINE_DO_FIRST_PEL 0x02
    1.68 +#define LINE_DIR_Y_POSITIVE 0x04
    1.69 +#define LINE_HORIZONTAL 0x08
    1.70 +#define LINE_DIR_X_POSITIVE 0x20
    1.71 +#define LINE_VERTICAL 0x1000
    1.72 +#define LINE_DO_LAST_PEL 0x4000
    1.73 +#define LINE_SOLID 0x01
    1.74 +
    1.75  typedef struct _BLTRECT {
    1.76    ULONG     ulXOrg;           /* X origin of the destination Blt. */
    1.77    ULONG     ulYOrg;           /* Y origin of the destination Blt. */
    1.78 @@ -102,4 +159,13 @@
    1.79  
    1.80  #define REQUEST_HW 0x01
    1.81  
    1.82 +/*
    1.83 +BOOL GreDeath(HDC hdc, PVOID pInstance, LONG lFunction);
    1.84 +LONG GreResurrection(HDC hdc, LONG cbVmem, PULONG pReserved, PVOID pInstance, LONG lFunction);
    1.85 +*/
    1.86 +#define GreDeath(h) (BOOL)Gre32Entry3((ULONG)(h), 0, 0x40B7L)
    1.87 +#define GreResurrection(h,n,r) (LONG)Gre32Entry5((ULONG)(h), (ULONG)(n), (ULONG)(r), 0, 0x40B8L)
    1.88 +ULONG _System Gre32Entry3(ULONG, ULONG, ULONG);
    1.89 +ULONG _System Gre32Entry5(ULONG, ULONG, ULONG, ULONG, ULONG);
    1.90 +
    1.91  #endif /* my_gradd_h_ */