mElite
1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
|
A basic class for an OpenGL application. More...
#include <OpenGLApplication.h>
Public Member Functions | |
virtual | ~OpenGLApplication (void) |
Static Public Member Functions | |
static OpenGLApplication * | create (const char *class_name) |
Create the derived application class and return a pointer to the OpenGLApplication base class. | |
Protected Member Functions | |
OpenGLApplication (const char *className) | |
Constructs an OpenGLApplication with a given name. | |
virtual bool | initialize ()=0 |
virtual void | deinitialize ()=0 |
virtual void | update (DWORD milliseconds)=0 |
virtual void | draw ()=0 |
OpenGLWindow * | getWindow (void) |
Return the window that belongs tho this application instance. | |
void | fastMode () |
Disables face culling, lighting and the depth testing. | |
void | fullMode () |
Enables face culling, lighting and the depth testing. | |
void | terminate () |
This function is called if the application quits by sending the appropriate window message and stopping the main program loop. | |
void | toggleFullscreen () |
Switches between fullscreen and windowed displaymode. | |
void | resizeDraw (bool enable) |
Enable or disable resizing while changing window size. | |
void | setFrameLimit (unsigned int framesPerSecond) |
Sets frame limit. If the computer is faster than the frame limit, it is supposed not to render again. | |
unsigned int | getFrameLimit () |
Gets frame limit. | |
FrameCounter * | getFrameCounter () |
Gets frame counter. | |
Friends | |
int WINAPI | WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) |
LRESULT CALLBACK | WndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
The window procedure handles the window messages for this application. | |
A basic class for an OpenGL application.
Contains basic Windows related functions such as the message handler and important members used for graphic programming, such as screen width. Can toggle between full screen and windowed mode.
Supports virtual methods to draw a scene and update the datastructures in each frame.
Definition at line 25 of file OpenGLApplication.h.
|
virtual |
Destructor
Definition at line 102 of file OpenGLApplication.cpp.
|
protected |
Constructs an OpenGLApplication with a given name.
Initializes the main data structures, such as the world, the textures and the object list.
className | Name of the window class that will belong to this application. |
Definition at line 79 of file OpenGLApplication.cpp.
|
static |
Create the derived application class and return a pointer to the OpenGLApplication base class.
className | Name of the window class. |
|
protectedpure virtual |
Implemented in App.
|
protectedpure virtual |
Implemented in App.
|
protected |
Disables face culling, lighting and the depth testing.
Very useful for 2D elements, as text or display-elements. It's supposed to use it not so often, as the switching costs time.
Definition at line 116 of file OpenGLApplication.cpp.
|
protected |
Enables face culling, lighting and the depth testing.
Definition at line 126 of file OpenGLApplication.cpp.
|
protected |
|
protected |
Gets frame limit.
Definition at line 152 of file OpenGLApplication.cpp.
|
protected |
Return the window that belongs tho this application instance.
Definition at line 159 of file OpenGLApplication.cpp.
|
protectedpure virtual |
Implemented in App.
|
protected |
Enable or disable resizing while changing window size.
draw | the status of disabling or resizing |
Definition at line 167 of file OpenGLApplication.cpp.
|
protected |
Sets frame limit. If the computer is faster than the frame limit, it is supposed not to render again.
framesPerSecond | The frames per second. |
Definition at line 369 of file OpenGLApplication.cpp.
|
protected |
This function is called if the application quits by sending the appropriate window message and stopping the main program loop.
The only thing that has to be done is to delete the window. Other things are done within the destructor.
Definition at line 179 of file OpenGLApplication.cpp.
|
protected |
Switches between fullscreen and windowed displaymode.
Definition at line 187 of file OpenGLApplication.cpp.
|
protectedpure virtual |
Implemented in App.
|
friend |
Definition at line 27 of file OpenGLApplication.cpp.
|
friend |
The window procedure handles the window messages for this application.
If an window is being created we get the instance and save it. Otherwise all messages are passed to the message handler in the class.
hWnd | Handle for the window |
uMsg | The message that is to be handled |
wParam | Additional information |
lParam | More additional information |
Definition at line 49 of file OpenGLApplication.cpp.