cppgfx  0.1.0
C++17 educational graphics library
Events

All cppgfx functions you can override, including Events. More...

Functions

virtual void cppgfx::App::setup ()=0
 This function is called once at the beginning of the program. More...
 
virtual void cppgfx::App::update ()=0
 This function is called repeatedly until the program is terminated. More...
 
virtual void cppgfx::App::cleanup ()
 This function is called once at the end of the program. More...
 
virtual bool cppgfx::App::onWindowClose ()
 This function can be used to intercept the window close event. More...
 
virtual void cppgfx::App::onTextInput (const sf::Event::TextEvent &event)
 This function is called when keys on the keyboard are pressed. To be used for text input. More...
 
virtual void cppgfx::App::onKeyPressed (const sf::Event::KeyEvent &event)
 This function is called when keys on the keyboard are pressed. To be used for key bindings, not text. More...
 
virtual void cppgfx::App::onKeyReleased (const sf::Event::KeyEvent &event)
 This function is called when keys on the keyboard are released. More...
 
virtual void cppgfx::App::onMousePressed (const sf::Event::MouseButtonEvent &event)
 This function is called when a mouse button is pressed. More...
 
virtual void cppgfx::App::onMouseReleased (const sf::Event::MouseButtonEvent &event)
 This function is called when a mouse button is released. More...
 
virtual void cppgfx::App::onMouseMoved (const sf::Event::MouseMoveEvent &event)
 This function is called when the mouse is moved. More...
 
virtual void cppgfx::App::onMouseWheel (const sf::Event::MouseWheelScrollEvent &event)
 This function is called when the mouse wheel is scrolled. More...
 
virtual void cppgfx::App::onMouseEnter ()
 This function is called when the mouse enters the window. More...
 
virtual void cppgfx::App::onMouseLeave ()
 This function is called when the mouse leaves the window. More...
 
virtual void cppgfx::App::onWindowResize ()
 This function is called when the window is resized. More...
 
virtual void cppgfx::App::onWindowFocus ()
 This function is called when the window is focused. More...
 
virtual void cppgfx::App::onWindowUnfocus ()
 This function is called when the window loses focus. More...
 

Detailed Description

All cppgfx functions you can override, including Events.

Function Documentation

◆ cleanup()

virtual void cppgfx::App::cleanup ( )
inlinevirtual

This function is called once at the end of the program.

It can be overridden in your class which inherits from cppgfx::App.

◆ onKeyPressed()

virtual void cppgfx::App::onKeyPressed ( const sf::Event::KeyEvent &  event)
inlinevirtual

This function is called when keys on the keyboard are pressed. To be used for key bindings, not text.

This function is to be used if you want to capture key events that are tied to specific keys. If you want the user to write text, use onTextInput() instead. It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onKeyReleased()

virtual void cppgfx::App::onKeyReleased ( const sf::Event::KeyEvent &  event)
inlinevirtual

This function is called when keys on the keyboard are released.

It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onMouseEnter()

virtual void cppgfx::App::onMouseEnter ( )
inlinevirtual

This function is called when the mouse enters the window.

It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onMouseLeave()

virtual void cppgfx::App::onMouseLeave ( )
inlinevirtual

This function is called when the mouse leaves the window.

It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onMouseMoved()

virtual void cppgfx::App::onMouseMoved ( const sf::Event::MouseMoveEvent &  event)
inlinevirtual

This function is called when the mouse is moved.

It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onMousePressed()

virtual void cppgfx::App::onMousePressed ( const sf::Event::MouseButtonEvent &  event)
inlinevirtual

This function is called when a mouse button is pressed.

It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onMouseReleased()

virtual void cppgfx::App::onMouseReleased ( const sf::Event::MouseButtonEvent &  event)
inlinevirtual

This function is called when a mouse button is released.

It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onMouseWheel()

virtual void cppgfx::App::onMouseWheel ( const sf::Event::MouseWheelScrollEvent &  event)
inlinevirtual

This function is called when the mouse wheel is scrolled.

It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onTextInput()

virtual void cppgfx::App::onTextInput ( const sf::Event::TextEvent &  event)
inlinevirtual

This function is called when keys on the keyboard are pressed. To be used for text input.

This function is to be used if you want the user to type text on the keyboard. If you want to capture key events with key bindings, use onKeyPressed() instead. It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onWindowClose()

virtual bool cppgfx::App::onWindowClose ( )
inlinevirtual

This function can be used to intercept the window close event.

This function is called when the window wants to be closed. Using this function, you can decide if you really want to close it or continue, by returning true or false. Returning true will close the window immediately, returning false will ignore the event. It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onWindowFocus()

virtual void cppgfx::App::onWindowFocus ( )
inlinevirtual

This function is called when the window is focused.

It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onWindowResize()

virtual void cppgfx::App::onWindowResize ( )
inlinevirtual

This function is called when the window is resized.

It can optionally be overridden in your class which inherits from cppgfx::App.

◆ onWindowUnfocus()

virtual void cppgfx::App::onWindowUnfocus ( )
inlinevirtual

This function is called when the window loses focus.

It can optionally be overridden in your class which inherits from cppgfx::App.

◆ setup()

virtual void cppgfx::App::setup ( )
pure virtual

This function is called once at the beginning of the program.

It must be overridden in your class which inherits from cppgfx::App.

◆ update()

virtual void cppgfx::App::update ( )
pure virtual

This function is called repeatedly until the program is terminated.

It must be overridden in your class which inherits from cppgfx::App.