00001 /******************** 00002 * * 00003 * NeHeGL Header * 00004 * * 00005 ********************************************************************************** 00006 * * 00007 * You Need To Provide The Following Functions: * 00008 * * 00009 * BOOL Initialize (GL_Window* window, Keys* keys); * 00010 * Performs All Your Initialization * 00011 * Returns TRUE If Initialization Was Successful, FALSE If Not * 00012 * 'window' Is A Parameter Used In Calls To NeHeGL * 00013 * 'keys' Is A Structure Containing The Up/Down Status Of keys * 00014 * * 00015 * void Deinitialize (void); * 00016 * Performs All Your DeInitialization * 00017 * * 00018 * void Update (DWORD milliseconds); * 00019 * Perform Motion Updates * 00020 * 'milliseconds' Is The Number Of Milliseconds Passed Since The Last Call * 00021 * With Whatever Accuracy GetTickCount() Provides * 00022 * * 00023 * void Draw (void); * 00024 * Perform All Your Scene Drawing * 00025 * * 00026 *********************************************************************************/ 00027 00028 #ifndef GL_FRAMEWORK__INCLUDED 00029 #define GL_FRAMEWORK__INCLUDED 00030 00031 00032 #include <windows.h> // Header File For Windows 00033 00034 typedef struct { // Structure For Keyboard Stuff 00035 BOOL keyDown [256]; // Holds TRUE / FALSE For Each Key 00036 } Keys; // Keys 00037 00038 typedef struct { // Contains Information Vital To Applications 00039 HINSTANCE hInstance; // Application Instance 00040 const char* className; // Application ClassName 00041 } Application; // Application 00042 00043 typedef struct { // Window Creation Info 00044 Application* application; // Application Structure 00045 char* title; // Window Title 00046 int width; // Width 00047 int height; // Height 00048 int bitsPerPixel; // Bits Per Pixel 00049 BOOL isFullScreen; // FullScreen? 00050 } GL_WindowInit; // GL_WindowInit 00051 00052 typedef struct { // Contains Information Vital To A Window 00053 Keys* keys; // Key Structure 00054 HWND hWnd; // Window Handle 00055 HDC hDC; // Device Context 00056 HGLRC hRC; // Rendering Context 00057 GL_WindowInit init; // Window Init 00058 BOOL isVisible; // Window Visible? 00059 DWORD lastTickCount; // Tick Counter 00060 } GL_Window; // GL_Window 00061 00062 void TerminateApplication (GL_Window* window); // Terminate The Application 00063 00064 void ToggleFullscreen (GL_Window* window); // Toggle Fullscreen / Windowed Mode 00065 00066 int wgl_init( GL_Window *window, Application *application, Keys *keys, 00067 int res_image_width, int res_image_height ); 00068 void wgl_deinit(GL_Window *window, Application *application, Keys *keys); 00069 00070 // These Are The Function You Must Provide 00071 BOOL Initialize (GL_Window* window, Keys* keys); // Performs All Your Initialization 00072 00073 void Deinitialize (void); // Performs All Your DeInitialization 00074 00075 void Update (DWORD milliseconds); // Perform Motion Updates 00076 00077 void Draw (void); // Perform All Your Scene Drawing 00078 00079 #endif // GL_FRAMEWORK__INCLUDED