Basic Renderer
|
An abstraction of the view the scene is drawn into. More...
#include <View.h>
Public Types | |
typedef int | UIView |
typedef int | BView |
Public Member Functions | |
View () | |
Constructor. More... | |
virtual | ~View () |
Virtual destructor. More... | |
bool | initView (std::string windowTitle=bRenderer::DEFAULT_WINDOW_TITLE()) |
Do all necessary initializations for the view to be ready to run (returns true in the case of success) More... | |
bool | initView (bool fullscreen, std::string windowTitle=bRenderer::DEFAULT_WINDOW_TITLE()) |
Do all necessary initializations for the view to be ready to run (returns true in the case of success) More... | |
bool | initView (GLint width, GLint height, bool fullscreen=false, std::string windowTitle=bRenderer::DEFAULT_WINDOW_TITLE()) |
Do all necessary initializations for the view to be ready to run (returns true in the case of success) More... | |
void | terminateView () |
Terminate the view. More... | |
bool | isInitialized () |
Returns true if the view has already been initialized. More... | |
bool | isRunning () |
Returns true if the view is running. More... | |
bool | isFullscreen () |
Returns true if the view runs in full screen mode. More... | |
GLint | getWidth () |
Returns the width of the view in pixels. More... | |
GLint | getHeight () |
Returns the height of the view in pixels. More... | |
void | getSize (GLint *width, GLint *height) |
Gets the size of the view in pixels. More... | |
GLint | getViewportWidth () |
Returns the width of the OpenGL viewport in pixels. More... | |
GLint | getViewportHeight () |
Returns the height of the OpenGL viewport in pixels. More... | |
void | getViewportSize (GLint *width, GLint *height) |
Gets the size of the OpenGL viewport in pixels. More... | |
GLfloat | getAspectRatio () |
Returns the aspect ratio of the view. More... | |
GLint | getPositionX () |
Returns the x position of the view in pixels. More... | |
GLint | getPositionY () |
Returns the y position of the view in pixels. More... | |
void | getPosition (GLint *x, GLint *y) |
Gets the position of the upper left corner of the view. More... | |
GLFWwindow * | getWindow () |
Returns the GLFW window. More... | |
BView * | getUIView () |
Returns the UIView on iOS (only usable in Objective C) More... | |
void | attachToUIView (UIView *view) |
Attaches (adds as a subview) the underlying UIView to a UIView of your choosing. More... | |
void | setFullscreen (bool fullscreen) |
Set fullscreen mode. More... | |
void | setWidth (GLint width) |
Sets the width of the view in pixels. More... | |
void | setHeight (GLint height) |
Sets the height of the view in pixels. More... | |
void | setSize (GLint width, GLint height) |
Sets the size of the view in pixels. More... | |
void | setViewportSize (GLint width, GLint height) |
Sets the size of the OpenGL viewport in pixels. More... | |
void | setPosition (GLint x, GLint y) |
Sets the position of the upper left corner of the view. More... | |
void | setContextCurrent () |
Sets the context of this view to be current. More... | |
void | bindFramebuffer () |
Bind the framebuffer (on iOS only) More... | |
void | presentBuffer () |
Displays the buffer to the screen. More... | |
Static Public Member Functions | |
static GLint | getScreenWidth () |
Returns the width of the screen in pixels. More... | |
static GLint | getScreenHeight () |
Returns the height of the screen in pixels. More... | |
static void | getScreenSize (GLint *width, GLint *height) |
Gets the size of the screen in pixels. More... | |
static void | clearScreen () |
Clears the screen. More... | |
An abstraction of the view the scene is drawn into.
The view class represents a window on desktop systems or a UIView on iOS. It possesses an OpenGL context and allows for a scene to be displayed to the screen.
typedef int View::BView |
typedef int View::UIView |
View::View | ( | ) |
Constructor.
|
virtual |
Virtual destructor.
void View::attachToUIView | ( | UIView * | view | ) |
Attaches (adds as a subview) the underlying UIView to a UIView of your choosing.
[in] | view | The UIView to attach the view to |
void View::bindFramebuffer | ( | ) |
Bind the framebuffer (on iOS only)
|
static |
Clears the screen.
GLfloat View::getAspectRatio | ( | ) |
Returns the aspect ratio of the view.
GLint View::getHeight | ( | ) |
Returns the height of the view in pixels.
void View::getPosition | ( | GLint * | x, |
GLint * | y | ||
) |
Gets the position of the upper left corner of the view.
[out] | x | The x position of the upper left corner of the view |
[out] | y | The y position of the upper left corner of the view |
GLint View::getPositionX | ( | ) |
Returns the x position of the view in pixels.
GLint View::getPositionY | ( | ) |
Returns the y position of the view in pixels.
|
static |
Returns the height of the screen in pixels.
|
static |
Gets the size of the screen in pixels.
[out] | width | The width of the screen |
[out] | height | The height of the screen |
|
static |
Returns the width of the screen in pixels.
void View::getSize | ( | GLint * | width, |
GLint * | height | ||
) |
Gets the size of the view in pixels.
[out] | width | The width of the view |
[out] | height | The height of the view |
BView* View::getUIView | ( | ) |
Returns the UIView on iOS (only usable in Objective C)
GLint View::getViewportHeight | ( | ) |
Returns the height of the OpenGL viewport in pixels.
void View::getViewportSize | ( | GLint * | width, |
GLint * | height | ||
) |
Gets the size of the OpenGL viewport in pixels.
[out] | width | The width in pixels |
[out] | height | The height in pixels |
GLint View::getViewportWidth | ( | ) |
Returns the width of the OpenGL viewport in pixels.
GLint View::getWidth | ( | ) |
Returns the width of the view in pixels.
GLFWwindow* View::getWindow | ( | ) |
Returns the GLFW window.
This function returns the window created using GLFW. This is useful if GLFW functionality is used within the application. On iOS this function returns an integer set to 0.
bool View::initView | ( | std::string | windowTitle = bRenderer::DEFAULT_WINDOW_TITLE() | ) |
Do all necessary initializations for the view to be ready to run (returns true in the case of success)
[in] | windowTitle | The title for the window on desktop systems (optional) |
bool View::initView | ( | bool | fullscreen, |
std::string | windowTitle = bRenderer::DEFAULT_WINDOW_TITLE() |
||
) |
Do all necessary initializations for the view to be ready to run (returns true in the case of success)
[in] | fullscreen | Decides whether or not the application runs in full screen mode |
[in] | windowTitle | The title for the window on desktop systems (optional) |
bool View::initView | ( | GLint | width, |
GLint | height, | ||
bool | fullscreen = false , |
||
std::string | windowTitle = bRenderer::DEFAULT_WINDOW_TITLE() |
||
) |
Do all necessary initializations for the view to be ready to run (returns true in the case of success)
[in] | width | The width of the view in pixels |
[in] | height | The height of the view in pixels |
[in] | fullscreen | Decides whether or not the application runs in full screen mode (optional) |
[in] | windowTitle | The title for the window on desktop systems (optional) |
bool View::isFullscreen | ( | ) |
Returns true if the view runs in full screen mode.
bool View::isInitialized | ( | ) |
Returns true if the view has already been initialized.
bool View::isRunning | ( | ) |
Returns true if the view is running.
void View::presentBuffer | ( | ) |
Displays the buffer to the screen.
void View::setContextCurrent | ( | ) |
Sets the context of this view to be current.
void View::setFullscreen | ( | bool | fullscreen | ) |
Set fullscreen mode.
[in] | fullscreen | Set true if full screen is desired |
void View::setHeight | ( | GLint | height | ) |
Sets the height of the view in pixels.
[in] | height | The height in pixels |
void View::setPosition | ( | GLint | x, |
GLint | y | ||
) |
Sets the position of the upper left corner of the view.
[in] | x | The x position of the upper left corner of the view |
[in] | y | The y position of the upper left corner of the view |
void View::setSize | ( | GLint | width, |
GLint | height | ||
) |
Sets the size of the view in pixels.
[in] | width | The width in pixels |
[in] | height | The height in pixels |
void View::setViewportSize | ( | GLint | width, |
GLint | height | ||
) |
Sets the size of the OpenGL viewport in pixels.
[in] | width | The width in pixels |
[in] | height | The height in pixels |
void View::setWidth | ( | GLint | width | ) |
Sets the width of the view in pixels.
[in] | width | The width in pixels |
void View::terminateView | ( | ) |
Terminate the view.