tk11::Framework Class Reference
[Framework]

Direct3D Rendering framework. More...

#include <framework.hpp>

Collaboration diagram for tk11::Framework:
Collaboration graph
[legend]

List of all members.

Public Types

typedef Framework_Parameters Parameters
 Framework parameters.

Public Member Functions

 Framework (const Parameters &parameters=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

Detailed Description

Direct3D Rendering framework.

Application framework for window creation, Direct3D initialization, rendering and event handling.

For more information, see Framework

Examples:

cube.cpp, empty.cpp, empty_class.cpp, input.cpp, and torus.cpp.


Constructor & Destructor Documentation

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:
parameters Framework parameters
Exceptions:
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.


Member Function Documentation

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 .

Returns:
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.

Examples:
empty.cpp.

The documentation for this class was generated from the following file:
Tk11 Direct3D 11 Toolkit version 0.2 (SourceForge)
Copyright Florian Winter 2010 - 2010. Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Generated on Sun Apr 11 20:23:03 2010 for Tk11 by  doxygen 1.6.3