It's a graphical window, holds the contexts for GL and SDL. More...
#include <Window.hpp>
Collaboration diagram for BARE2D::Window:Public Member Functions | |
| Window () | |
| ~Window () | |
| void | create (unsigned int flags) |
| This is a graphical window. It holds information about the GL context, as well as the SDL window context. Takes some flags on creation (SDL_WindowFlags): More... | |
| void | setTitle (std::string newTitle) |
| Sets the title of the window. More... | |
| void | setSize (unsigned int width, unsigned int height) |
| Sets the size of the window (defaults to 600x400) More... | |
| void | swapBuffer () |
| Swaps the buffer of the SDL window - used to draw to one while the other displays, so no flickering is seen. More... | |
| unsigned int | getWidth () const |
| Returns the width of the window. More... | |
| unsigned int | getHeight () const |
| Returns the height of the window. More... | |
Private Attributes | |
| SDL_Window * | m_SDLWindow = nullptr |
| SDL_GLContext | m_GLContext = nullptr |
| unsigned int | m_width = 600 |
| unsigned int | m_height = 400 |
| std::string | m_title = "BARE2D Window" |
It's a graphical window, holds the contexts for GL and SDL.
Definition at line 13 of file Window.hpp.
| BARE2D::Window::Window | ( | ) |
Definition at line 9 of file Window.cpp.
| BARE2D::Window::~Window | ( | ) |
Definition at line 13 of file Window.cpp.
References m_GLContext, and m_SDLWindow.
| void BARE2D::Window::create | ( | unsigned int | flags | ) |
This is a graphical window. It holds information about the GL context, as well as the SDL window context. Takes some flags on creation (SDL_WindowFlags):
Definition at line 20 of file Window.cpp.
References BARE2D::GLEW_FAILURE, m_GLContext, m_height, m_SDLWindow, m_title, m_width, BARE2D::SDL_FAILURE, and BARE2D::throwFatalError().
Referenced by BARE2D::App::init().
Here is the call graph for this function:
Here is the caller graph for this function:| unsigned int BARE2D::Window::getHeight | ( | ) | const |
Returns the height of the window.
Definition at line 97 of file Window.cpp.
References m_height.
Referenced by BARE2D::App::draw().
Here is the caller graph for this function:| unsigned int BARE2D::Window::getWidth | ( | ) | const |
Returns the width of the window.
Definition at line 93 of file Window.cpp.
References m_width.
Referenced by BARE2D::App::draw().
Here is the caller graph for this function:| void BARE2D::Window::setSize | ( | unsigned int | width, |
| unsigned int | height | ||
| ) |
Sets the size of the window (defaults to 600x400)
| width | |
| height |
Definition at line 77 of file Window.cpp.
References m_height, m_SDLWindow, and m_width.
| void BARE2D::Window::setTitle | ( | std::string | newTitle | ) |
Sets the title of the window.
| newTitle | The new title to be set! |
Definition at line 72 of file Window.cpp.
References m_SDLWindow, and m_title.
| void BARE2D::Window::swapBuffer | ( | ) |
Swaps the buffer of the SDL window - used to draw to one while the other displays, so no flickering is seen.
Definition at line 89 of file Window.cpp.
References m_SDLWindow.
Referenced by BARE2D::App::run().
Here is the caller graph for this function:
|
private |
Definition at line 76 of file Window.hpp.
|
private |
Definition at line 78 of file Window.hpp.
Referenced by create(), getHeight(), and setSize().
|
private |
Definition at line 75 of file Window.hpp.
Referenced by create(), setSize(), setTitle(), swapBuffer(), and ~Window().
|
private |
Definition at line 79 of file Window.hpp.
Referenced by create(), and setTitle().
|
private |
Definition at line 78 of file Window.hpp.
Referenced by create(), getWidth(), and setSize().