merge gfx-opt branch
[drnoksnes] / gx.h
1
2 // The following ifdef block is the standard way of creating macros which make exporting 
3 // from a DLL simpler. All files within this DLL are compiled with the GXDLL_EXPORTS
4 // symbol defined on the command line. this symbol should not be defined on any project
5 // that uses this DLL. This way any other project whose source files include this file see 
6 // GXDLL_API functions as being imported from a DLL, wheras this DLL sees symbols
7 // defined with this macro as being exported.
8
9 #ifdef GXDLL_EXPORTS
10 #define GXDLL_API __declspec(dllexport)
11 #else
12 #define GXDLL_API __declspec(dllimport)
13 #endif
14
15 struct GXDisplayProperties {
16         DWORD cxWidth;
17         DWORD cyHeight;                 // notice lack of 'th' in the word height.
18         long cbxPitch;                  // number of bytes to move right one x pixel - can be negative.
19         long cbyPitch;                  // number of bytes to move down one y pixel - can be negative.
20         long cBPP;                              // # of bits in each pixel
21         DWORD ffFormat;                 // format flags.
22 };
23
24 struct GXKeyList {
25         short vkUp;                             // key for up
26         POINT ptUp;                             // x,y position of key/button.  Not on screen but in screen coordinates.
27         short vkDown;
28         POINT ptDown;
29         short vkLeft;
30         POINT ptLeft;
31         short vkRight;
32         POINT ptRight;
33         short vkA;
34         POINT ptA;
35         short vkB;
36         POINT ptB;
37         short vkC;
38         POINT ptC;
39         short vkStart;
40         POINT ptStart;
41 };
42
43 struct GXScreenRect {
44         DWORD dwTop;
45         DWORD dwLeft;
46         DWORD dwWidth;
47         DWORD dwHeight;
48 };
49
50 GXDLL_API int GXOpenDisplay(HWND hWnd, DWORD dwFlags);
51 GXDLL_API int GXCloseDisplay();
52 GXDLL_API void * GXBeginDraw();
53 GXDLL_API int GXEndDraw();
54 GXDLL_API int GXOpenInput();
55 GXDLL_API int GXCloseInput();
56 //The following two lines modified by Dan East to make this header C compatible:
57 //Added "struct" to the following two prototypes:
58 GXDLL_API struct GXDisplayProperties GXGetDisplayProperties();
59 GXDLL_API struct GXKeyList GXGetDefaultKeys(int iOptions);
60 GXDLL_API int GXSuspend();
61 GXDLL_API int GXResume();
62 GXDLL_API int GXSetViewport( DWORD dwTop, DWORD dwHeight, DWORD dwReserved1, DWORD dwReserved2 );
63 GXDLL_API BOOL GXIsDisplayDRAMBuffer();
64
65
66 // Although these flags can be unrelated they still
67 // have unique values.
68
69 #define GX_FULLSCREEN   0x01            // for OpenDisplay()
70 #define GX_NORMALKEYS   0x02
71 #define GX_LANDSCAPEKEYS        0x03
72
73 #ifndef kfLandscape
74         #define kfLandscape     0x8                     // Screen is rotated 270 degrees
75         #define kfPalette       0x10            // Pixel values are indexes into a palette
76         #define kfDirect        0x20            // Pixel values contain actual level information
77         #define kfDirect555     0x40            // 5 bits each for red, green and blue values in a pixel.
78         #define kfDirect565     0x80            // 5 red bits, 6 green bits and 5 blue bits per pixel
79         #define kfDirect888     0x100           // 8 bits each for red, green and blue values in a pixel.
80         #define kfDirect444     0x200           // 4 red, 4 green, 4 blue
81         #define kfDirectInverted 0x400
82 #endif
83