demOS

- Main Page
- Modules
- Data Structures
- Files

- File List

All Data Structures Files Modules Pages
WINDOW.H
Go to the documentation of this file.
1 /*------------------------------------------------------------------------------ -----------------
2 Copyright J.Hubert 2015
3
4 This file is part of demOS
5
6 demOS is free software: you can redistribute it and/or modify it under the terms of
7 the GNU Lesser General Public License as published by the Free Software Foundation,
8 either version 3 of the License, or (at your option) any later version.
9
10 demOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY ;
11 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 See the GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License along with demOS.
15 If not, see <http://www.gnu.org/licenses/>.
16 ------------------------------------------------------------------------------------------------- */
17
25 #ifndef WINWOW_H
26 #define WINDOW_H
27
28 #ifndef __TOS__
29
30 #include "DEMOSDK\BASTYPES.H"
31
32 #define WINDOW_CENTER -1
33
34 #define MOUSE_LBUT 0x01
35 #define MOUSE_RBUT 0x02
36 #define MOUSE_MBUT 0x04
37
38 #define KEY_HOME 0xF0
39 #define KEY_END 0xF1
40 #define KEY_PAGEUP 0xF2
41 #define KEY_PAGEDOWN 0xF3
42 #define KEY_INSERT 0xF4
43 #define KEY_DELETE 0xF5
44 #define KEY_UP 0xF6
45 #define KEY_DOWN 0xF7
46 #define KEY_LEFT 0xF8
47 #define KEY_RIGHT 0xF9
48
49 #define CONTROLKEY_CTRL 0x01000
50 #define CONTROLKEY_ALT 0x02000
51 #define CONTROLKEY_ALTGR 0x03000
52 #define CONTROLKEY_SHIFT 0x08000
53
54
55 STRUCT(WINinitParam)
56 {
57 s32 x;
58 s32 y;
59 u32 w;
60 u32 h;
61 void* hInstance;
62 char* title;
63 };
64
65 PREDECLARE_STRUCT(WINdow);
66
67 WINdow* WINconstruct (WINinitParam* _initParam);
68 void WINdestroy (WINdow* _m);
69 void WINwaitLoop (WINdow* _m);
70 void WINclear (WINdow* _m);
71 void WINdrawImage (WINdow* _m, void* _image, u32 _width, u32 _height, u32 _nbBitsPerPixel, u8* _palette, u32 _x, u32 _y);
72 void WINfilledRectangle (WINdow* _m,s32 _iX1, s32 _iY1, s32 _iX2, s32 _iY2);
73 void WINline (WINdow* _m,s32 _iX1, s32 _iY1, s32 _iX2, s32 _iY2);
74 void WInpoint (WINdow* _m,s32 _iX, s32 _iY);
75 void WINrectangle (WINdow* _m,s32 _iX1, s32 _iY1, s32 _iX2, s32 _iY2);
76 void WINsetColor (WINdow* _m,u8 _uiR, u8 _uiG, u8 _uiB);
77 void WINtext (WINdow* _m,s32 _iX, s32 _iY, char* _string);
78 void WINrender (WINdow* _m, u32 _waitms);
79 bool WINisClosed (WINdow* _m);
80 void WINgetMouse (WINdow* _m,s32* _piX, s32* _piY, s32* _piK, s32* _z);
81 bool WINisKeyHit (WINdow* _m);
82 u32 WINgetKey (WINdow* _m);
83 u32 WINgetControlKeys (WINdow* _m);
84
85 #endif // __TOS__
86
87 #endif
WINinitParam
Definition: WINDOW.H:55
BASTYPES.H
BASTYPES