Blackcomb  prealpha
Engine-ish
Public Member Functions | Public Attributes | List of all members
blackcomb::base::AppBase Class Reference

A convenient base for any Blackcomb application. More...

#include <AppBase.h>

Public Member Functions

 AppBase (std::string winTitle=base::DefaultWinName)
 
base::WindowgetWindow ()
 A getter for the window, since the window is lazily generated.
 
virtual void run ()
 Call this function to run your application. More...
 
virtual void updatePreClear ()
 Called once per frame after run() is called, before calling glClear.
 
virtual void update ()
 Called once per frame after run() is called, after calling glClear. More...
 
virtual void processInput ()
 Input handling code. More...
 
virtual void destroy ()
 Called when the application is closing. More...
 

Public Attributes

float deltaTime = 0.0f
 
float lastFrame = static_cast<float>(glfwGetTime())
 

Detailed Description

A convenient base for any Blackcomb application.

Member Function Documentation

◆ destroy()

void blackcomb::base::AppBase::destroy ( )
virtual

Called when the application is closing.

Libraries should probably be cleaned up here.

◆ processInput()

void blackcomb::base::AppBase::processInput ( )
virtual

Input handling code.

Run once per frame after run() is called.

◆ run()

void blackcomb::base::AppBase::run ( )
virtual

Call this function to run your application.

Starts a loop that every frame updates delta time, handles input, clears colour and depth bits, calls update(), swaps the buffers, and polls for events. Can be overriden for fine grained control, but it is recommended you override AppBase.update instead.

◆ update()

void blackcomb::base::AppBase::update ( )
virtual

Called once per frame after run() is called, after calling glClear.

For updating before glClear, use updatePreClear.


The documentation for this class was generated from the following files: