Abstract interface for scene objects managed by a GLWindow.
More...
#include <gl.hpp>
|
| | GLObject ()=default |
| virtual | ~GLObject ()=default |
| virtual void | load (GLWindow *win)=0 |
| | Load GPU resources (textures, shaders, geometry).
|
| virtual void | draw (GLWindow *win)=0 |
| | Render the scene for the current frame.
|
| virtual void | event (GLWindow *window, SDL_Event &e)=0 |
| | Handle an SDL event.
|
| virtual void | resize (gl::GLWindow *win, int w, int h) |
| | Called when the window is resized (optional).
|
Abstract interface for scene objects managed by a GLWindow.
Derived classes implement load(), draw(), event(), and optionally resize() to participate in the GLWindow render/event loop. Attach an instance via GLWindow::setObject().
Definition at line 593 of file gl.hpp.
◆ GLObject()
| gl::GLObject::GLObject |
( |
| ) |
|
|
default |
◆ ~GLObject()
| virtual gl::GLObject::~GLObject |
( |
| ) |
|
|
virtualdefault |
◆ draw()
| virtual void gl::GLObject::draw |
( |
GLWindow * | win | ) |
|
|
pure virtual |
Render the scene for the current frame.
- Parameters
-
◆ event()
| virtual void gl::GLObject::event |
( |
GLWindow * | window, |
|
|
SDL_Event & | e ) |
|
pure virtual |
Handle an SDL event.
- Parameters
-
| window | Parent window. |
| e | SDL event. |
◆ load()
| virtual void gl::GLObject::load |
( |
GLWindow * | win | ) |
|
|
pure virtual |
Load GPU resources (textures, shaders, geometry).
- Parameters
-
◆ resize()
| virtual void gl::GLObject::resize |
( |
gl::GLWindow * | win, |
|
|
int | w, |
|
|
int | h ) |
|
inlinevirtual |
Called when the window is resized (optional).
- Parameters
-
| win | Parent window. |
| w | New width. |
| h | New height. |
Definition at line 623 of file gl.hpp.
The documentation for this class was generated from the following file: