VizKit
3.3.7
|
The platform specific core operations of the graphics layer are bundled with this class. More...
#include <VisualGraphicsCore.h>
Public Member Functions | |
bool | setupContext () |
Sets up an OpenGL context of the operating system. | |
void | cleanupContext () |
Cleans up the OpenGL graphics context. | |
uint16 | setCurrentContext (void) |
Sets the current context to the one that has been set up before with the setupContext() call. | |
void | setPlatformView (VISUAL_PLATFORM_VIEW aView) |
Keeps a reference to the platform specific view for internal use. | |
const VISUAL_PLATFORM_VIEW | getPlatformView (void) |
Returns the platform specific view for rendering. | |
void | refreshCanvasRect (void) |
Updates the dimensions of the canvas according to the current dimensions of the platform view. | |
PixelRect | getCanvasRect (void) |
Returns the current dimensions of the canvas. | |
void | finishGLDrawing () |
Ends the GL drawing by flushing, finishing and swaping the buffer content. | |
float | getScreenScaleFactor () |
Returns the screen scale factor. | |
Static Public Member Functions | |
static VisualGraphicsCore * | getInstance (void) |
Returns a pointer to the instance. | |
static void | dispose (void) |
Cleans up the Visual Graphics Core singleton class. | |
Private Member Functions | |
VisualGraphicsCore () | |
The constructor. | |
~VisualGraphicsCore () | |
The destructor. | |
VisualGraphicsCore (const VisualGraphicsCore &other) | |
Copy constructor. | |
VisualGraphicsCore & | operator= (const VisualGraphicsCore &other) |
Assignment operator. | |
Private Attributes | |
VISUAL_PLATFORM_VIEW | platformView |
The platform specific view. | |
PixelRect | canvasRect |
The canvas rect is the area to draw in, measured in pixels. | |
Static Private Attributes | |
static VisualGraphicsCore * | theVisualGraphicsCore = NULL |
VisualGraphicsCore is a singleton class. |
The platform specific core operations of the graphics layer are bundled with this class.
VisualGraphics is the only class that accesses VisualGraphicsCore. VisualGraphicsCore is a singleton class.
VisualGraphicsCore::VisualGraphicsCore | ( | ) | [private] |
The constructor.
VisualGraphicsCore is a singleton class. The constructor is private. New instance of class can only be created internally.
VisualGraphicsCore::~VisualGraphicsCore | ( | ) | [private] |
The destructor.
VisualGraphicsCore is a singleton class. The destructor is private. Instance of class can only be deleted internally.
VizKit::VisualGraphicsCore::VisualGraphicsCore | ( | const VisualGraphicsCore & | other | ) | [private] |
Copy constructor.
other | Another VisualGraphicsCore. |
void VisualGraphicsCore::cleanupContext | ( | ) |
Cleans up the OpenGL graphics context.
void VisualGraphicsCore::dispose | ( | void | ) | [static] |
Cleans up the Visual Graphics Core singleton class.
void VisualGraphicsCore::finishGLDrawing | ( | ) |
Ends the GL drawing by flushing, finishing and swaping the buffer content.
Every executed drawing command should show its result on screen. The function is called at the end of each RenderMessage.
Returns the current dimensions of the canvas.
VisualGraphicsCore * VisualGraphicsCore::getInstance | ( | void | ) | [static] |
Returns a pointer to the instance.
Initializes the Visual Graphics Core class if neccessary. The visual graphics core class is of singleton type.
const VISUAL_PLATFORM_VIEW VisualGraphicsCore::getPlatformView | ( | void | ) |
Returns the platform specific view for rendering.
float VisualGraphicsCore::getScreenScaleFactor | ( | ) |
Returns the screen scale factor.
Retina displays on the Mac have a scren scale factor of 2.0.
VisualGraphicsCore& VizKit::VisualGraphicsCore::operator= | ( | const VisualGraphicsCore & | other | ) | [private] |
Assignment operator.
void VisualGraphicsCore::refreshCanvasRect | ( | void | ) |
Updates the dimensions of the canvas according to the current dimensions of the platform view.
Sets the current context to the one that has been set up before with the setupContext() call.
void VisualGraphicsCore::setPlatformView | ( | VISUAL_PLATFORM_VIEW | aView | ) |
Keeps a reference to the platform specific view for internal use.
aView | A platform specific view. |
bool VisualGraphicsCore::setupContext | ( | ) |
Sets up an OpenGL context of the operating system.
OS windowing system and OpenGL get connected.
The canvas rect is the area to draw in, measured in pixels.
The platform specific view.
On Mac it is defined as NSView*. On Windows it is defined as HWND.
VisualGraphicsCore * VisualGraphicsCore::theVisualGraphicsCore = NULL [static, private] |
VisualGraphicsCore is a singleton class.
Pointer to private instance is handled internally.