port from perforce
This commit is contained in:
188
4kgfx/smallwin.h
Normal file
188
4kgfx/smallwin.h
Normal file
@@ -0,0 +1,188 @@
|
||||
#pragma once
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#define HANDLE void*
|
||||
#define DECLARE_HANDLE(name) typedef HANDLE name
|
||||
#define WINGDIAPI __declspec(dllimport)
|
||||
#define WINUSERAPI __declspec(dllimport)
|
||||
#define WINBASEAPI __declspec(dllimport)
|
||||
#define WINAPI __stdcall
|
||||
#define NULL 0
|
||||
#define APIENTRY WINAPI
|
||||
|
||||
#define PFD_DOUBLEBUFFER 0x00000001
|
||||
#define PFD_STEREO 0x00000002
|
||||
#define PFD_DRAW_TO_WINDOW 0x00000004
|
||||
#define PFD_DRAW_TO_BITMAP 0x00000008
|
||||
#define PFD_SUPPORT_GDI 0x00000010
|
||||
#define PFD_SUPPORT_OPENGL 0x00000020
|
||||
#define PFD_GENERIC_FORMAT 0x00000040
|
||||
#define PFD_NEED_PALETTE 0x00000080
|
||||
#define PFD_NEED_SYSTEM_PALETTE 0x00000100
|
||||
#define PFD_SWAP_EXCHANGE 0x00000200
|
||||
#define PFD_SWAP_COPY 0x00000400
|
||||
#define PFD_SWAP_LAYER_BUFFERS 0x00000800
|
||||
#define PFD_GENERIC_ACCELERATED 0x00001000
|
||||
#define PFD_SUPPORT_DIRECTDRAW 0x00002000
|
||||
#define PFD_DIRECT3D_ACCELERATED 0x00004000
|
||||
#define PFD_SUPPORT_COMPOSITION 0x00008000
|
||||
#define PFD_TYPE_RGBA 0
|
||||
#define PFD_TYPE_COLORINDEX 1
|
||||
|
||||
#define WS_OVERLAPPED 0x00000000L
|
||||
#define WS_POPUP 0x80000000L
|
||||
#define WS_CHILD 0x40000000L
|
||||
#define WS_MINIMIZE 0x20000000L
|
||||
#define WS_VISIBLE 0x10000000L
|
||||
#define WS_DISABLED 0x08000000L
|
||||
#define WS_CLIPSIBLINGS 0x04000000L
|
||||
#define WS_CLIPCHILDREN 0x02000000L
|
||||
#define WS_MAXIMIZE 0x01000000L
|
||||
#define WS_CAPTION 0x00C00000L
|
||||
#define WS_BORDER 0x00800000L
|
||||
#define WS_DLGFRAME 0x00400000L
|
||||
#define WS_VSCROLL 0x00200000L
|
||||
#define WS_HSCROLL 0x00100000L
|
||||
#define WS_SYSMENU 0x00080000L
|
||||
#define WS_THICKFRAME 0x00040000L
|
||||
#define WS_GROUP 0x00020000L
|
||||
#define WS_TABSTOP 0x00010000L
|
||||
|
||||
#define CDS_UPDATEREGISTRY 0x00000001
|
||||
#define CDS_TEST 0x00000002
|
||||
#define CDS_FULLSCREEN 0x00000004
|
||||
#define CDS_GLOBAL 0x00000008
|
||||
#define CDS_SET_PRIMARY 0x00000010
|
||||
#define CDS_VIDEOPARAMETERS 0x00000020
|
||||
|
||||
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
|
||||
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
|
||||
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
|
||||
#define WGL_CONTEXT_FLAGS_ARB 0x2094
|
||||
|
||||
typedef int (WINAPI *PROC)();
|
||||
typedef unsigned long DWORD;
|
||||
typedef unsigned short WORD;
|
||||
typedef unsigned short USHORT;
|
||||
typedef unsigned char BYTE;
|
||||
typedef char CHAR;
|
||||
typedef unsigned int UINT;
|
||||
typedef long LONG;
|
||||
typedef const char* LPCSTR;
|
||||
typedef void VOID;
|
||||
typedef float FLOAT;
|
||||
typedef __int64 INT64;
|
||||
typedef int INT;
|
||||
typedef int INT32;
|
||||
typedef long BOOL;
|
||||
typedef void *HDC;
|
||||
typedef void *HGLRC;
|
||||
typedef void *HWND;
|
||||
typedef void *HMENU;
|
||||
typedef void *HINSTANCE;
|
||||
typedef void *LPVOID;
|
||||
|
||||
typedef struct tagRECT
|
||||
{
|
||||
LONG left;
|
||||
LONG top;
|
||||
LONG right;
|
||||
LONG bottom;
|
||||
} RECT;
|
||||
|
||||
typedef struct _POINTL
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
} POINTL, *PPOINTL;
|
||||
|
||||
typedef struct _devicemodeA {
|
||||
BYTE dmDeviceName[32];
|
||||
WORD dmSpecVersion;
|
||||
WORD dmDriverVersion;
|
||||
WORD dmSize;
|
||||
WORD dmDriverExtra;
|
||||
DWORD dmFields;
|
||||
union {
|
||||
struct {
|
||||
short dmOrientation;
|
||||
short dmPaperSize;
|
||||
short dmPaperLength;
|
||||
short dmPaperWidth;
|
||||
short dmScale;
|
||||
short dmCopies;
|
||||
short dmDefaultSource;
|
||||
short dmPrintQuality;
|
||||
} a;
|
||||
struct {
|
||||
POINTL dmPosition;
|
||||
DWORD dmDisplayOrientation;
|
||||
DWORD dmDisplayFixedOutput;
|
||||
} b;
|
||||
} c;
|
||||
short dmColor;
|
||||
short dmDuplex;
|
||||
short dmYResolution;
|
||||
short dmTTOption;
|
||||
short dmCollate;
|
||||
BYTE dmFormName[32];
|
||||
WORD dmLogPixels;
|
||||
DWORD dmBitsPerPel;
|
||||
DWORD dmPelsWidth;
|
||||
DWORD dmPelsHeight;
|
||||
union {
|
||||
DWORD dmDisplayFlags;
|
||||
DWORD dmNup;
|
||||
};
|
||||
DWORD dmDisplayFrequency;
|
||||
} DEVMODE;
|
||||
|
||||
typedef struct tagPIXELFORMATDESCRIPTOR
|
||||
{
|
||||
WORD nSize;
|
||||
WORD nVersion;
|
||||
DWORD dwFlags;
|
||||
BYTE iPixelType;
|
||||
BYTE cColorBits;
|
||||
BYTE cRedBits;
|
||||
BYTE cRedShift;
|
||||
BYTE cGreenBits;
|
||||
BYTE cGreenShift;
|
||||
BYTE cBlueBits;
|
||||
BYTE cBlueShift;
|
||||
BYTE cAlphaBits;
|
||||
BYTE cAlphaShift;
|
||||
BYTE cAccumBits;
|
||||
BYTE cAccumRedBits;
|
||||
BYTE cAccumGreenBits;
|
||||
BYTE cAccumBlueBits;
|
||||
BYTE cAccumAlphaBits;
|
||||
BYTE cDepthBits;
|
||||
BYTE cStencilBits;
|
||||
BYTE cAuxBuffers;
|
||||
BYTE iLayerType;
|
||||
BYTE bReserved;
|
||||
DWORD dwLayerMask;
|
||||
DWORD dwVisibleMask;
|
||||
DWORD dwDamageMask;
|
||||
} PIXELFORMATDESCRIPTOR;
|
||||
|
||||
__declspec(dllimport) int WINAPI wglGetProcAddress(LPCSTR);
|
||||
__declspec(dllimport) HGLRC WINAPI wglCreateContext(HDC);
|
||||
__declspec(dllimport) long WINAPI wglMakeCurrent(HDC, HGLRC);
|
||||
__declspec(dllimport) HDC WINAPI GetDC(HWND hWnd);
|
||||
__declspec(dllimport) HWND WINAPI CreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
|
||||
__declspec(dllimport) long WINAPI SetPixelFormat(HDC hdc, int format, const PIXELFORMATDESCRIPTOR * ppfd);
|
||||
__declspec(dllimport) int WINAPI ChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR *ppfd);
|
||||
__declspec(dllimport) int WINAPI ShowCursor(long bShow);
|
||||
__declspec(dllimport) long WINAPI SwapBuffers(HDC);
|
||||
__declspec(dllimport) short WINAPI GetAsyncKeyState(int vKey);
|
||||
__declspec(dllimport) __declspec(noreturn) void WINAPI ExitProcess(unsigned int uExitCode);
|
||||
__declspec(dllimport) long WINAPI ChangeDisplaySettingsA(DEVMODE* lpDevMode, DWORD dwFlags);
|
||||
__declspec(dllimport) void WINAPI OutputDebugStringA(LPCSTR lpOutputString);
|
||||
__declspec(dllimport) void WINAPI DebugBreak(VOID);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user