-
Notifications
You must be signed in to change notification settings - Fork 0
/
openGLFramework.h
88 lines (69 loc) · 3.81 KB
/
openGLFramework.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/********************
* *
* NeHeGL Header *
* *
**********************************************************************************
* *
* You Need To Provide The Following Functions: *
* *
* BOOL Initialize (GL_Window* window, Keys* keys); *
* Performs All Your Initialization *
* Returns TRUE If Initialization Was Successful, FALSE If Not *
* 'window' Is A Parameter Used In Calls To NeHeGL *
* 'keys' Is A Structure Containing The Up/Down Status Of keys *
* *
* void Deinitialize (void); *
* Performs All Your DeInitialization *
* *
* void Update (DWORD milliseconds); *
* Perform Motion Updates *
* 'milliseconds' Is The Number Of Milliseconds Passed Since The Last Call *
* With Whatever Accuracy GetTickCount() Provides *
* *
* void DrawScene(void); *
* Perform All Your Scene Drawing *
* *
*********************************************************************************/
#ifndef GL_FRAMEWORK__INCLUDED
#define GL_FRAMEWORK__INCLUDED
#include <windows.h> // Header File For Windows
typedef struct { // Structure For Keyboard Stuff
BOOL keyDown [256]; // Holds TRUE / FALSE For Each Key
} Keys; // Keys
typedef struct { // Contains Information Vital To Applications
HINSTANCE hInstance; // Application Instance
const char* className; // Application ClassName
} Application; // Application
typedef struct { // Window Creation Info
Application* application; // Application Structure
char* title; // Window Title
int width; // Width
int height; // Height
int bitsPerPixel; // Bits Per Pixel
BOOL isFullScreen; // FullScreen?
} GL_WindowInit; // GL_WindowInit
typedef struct { // Contains Information Vital To A Window
Keys* keys; // Key Structure
HWND hWnd; // Window Handle
HDC hDC; // Device Context
HGLRC hRC; // Rendering Context
GL_WindowInit init; // Window Init
BOOL isVisible; // Window Visible?
DWORD lastTickCount; // Tick Counter
} GL_Window; // GL_Window
void TerminateApplication (GL_Window* window); // Terminate The Application
void ToggleFullscreen (GL_Window* window); // Toggle Fullscreen / Windowed Mode
// These Are The Function You Must Provide
BOOL Initialize (GL_Window* window, Keys* keys); // Performs All Your Initialization
void Deinitialize (void); // Performs All Your DeInitialization
void Update (DWORD milliseconds); // Perform Motion Updates
void keyProcess(void); // Perform Keyboard Processing
void DrawScene(void); // Perform All Your Scene Drawing
//-----------------
extern int mouse_x;
extern int mouse_y;
extern char appTitle[]; // Stores Program Title
extern int screenInfo[3]; // Stores Screen Info (w,h,bpp)
extern GL_Window* g_window;
extern Keys* g_keys;
#endif // GL_FRAMEWORK__INCLUDED