Direct3D Rendering framework. More...
#include <framework.hpp>
Public Types | |
typedef Framework_Parameters | Parameters |
Framework parameters. | |
Public Member Functions | |
Framework (const Parameters ¶meters=Parameters()) | |
Initialize framework (constructor). | |
~Framework () | |
Destroy framework (destructor). | |
void | run () |
Run main loop. | |
bool | frame () |
Single step. | |
void | quit () |
Quit main loop. | |
Friends | |
class | Window |
Direct3D Rendering framework.
Application framework for window creation, Direct3D initialization, rendering and event handling.
For more information, see Framework
cube.cpp, empty.cpp, empty_class.cpp, input.cpp, and torus.cpp.
tk11::Framework::Framework | ( | const Parameters & | parameters = Parameters() |
) |
Initialize framework (constructor).
This constructor creates the window, the Direct3D device and all other resources. The application must set up a structure with parameters before constructing a Framework object. In particular, callbacks must be set in the Parameters structure, or the application will not be able to render anything.
parameters | Framework parameters |
Direct3D_Error | Thrown if initialization of Direct3D failed | |
Failed_To_Register_Window_Class | Thrown if window class of target window could not be created |
tk11::Framework::~Framework | ( | ) |
Destroy framework (destructor).
Must have an explicit destructor to avoid warning C4150 and make sure, implementation object is destroyed.
bool tk11::Framework::frame | ( | ) |
Single step.
Performs a single iteration of the main loop. Handles all pending GUI messages and then renders a single frame.
If the application was signaled to exit (because WM_QUIT was posted, see documentation of run() for more information), then this method returns false
.
false
if application was signaled to exit, true
otherwise void tk11::Framework::quit | ( | ) |
Quit main loop.
Forces the main loop of the framework to exit. This method may be called from within callbacks.
void tk11::Framework::run | ( | ) |
Run main loop.
This method does not return until the application exits. It calls frame() in a loop until the application exits.
Application exit is signaled by posting the WM_QUIT message to the message queue of the thread of the main loop. For more information, see the Windows API function PostQuitMessage(). Note that WM_QUIT is posted automatically when the target window is closed by the user.