Blackcomb  prealpha
Engine-ish
AppBase.h
1 #ifndef BLACKCOMB_APPBASE_H
2 #define BLACKCOMB_APPBASE_H
3 
4 #include <memory>
5 #include <glad/glad.h>
6 #include <GLFW/glfw3.h>
7 #include "Window.h"
8 
9 namespace blackcomb::base {
13  class AppBase {
14  public:
15  AppBase(std::string winTitle = base::DefaultWinName);
16  ~AppBase();
18  virtual void run();
19  virtual void updatePreClear();
20  virtual void update();
21  virtual void processInput();
22  virtual void destroy();
23  float deltaTime = 0.0f;
24  float lastFrame = static_cast<float>(glfwGetTime());
25  private:
26  std::optional<base::Window> window;
27  };
28 }
29 
30 
31 #endif //BLACKCOMB_APPBASE_H
virtual void destroy()
Called when the application is closing.
Definition: AppBase.cpp:84
base::Window & getWindow()
A getter for the window, since the window is lazily generated.
Definition: AppBase.cpp:36
virtual void run()
Call this function to run your application.
Definition: AppBase.cpp:48
virtual void update()
Called once per frame after run() is called, after calling glClear.
Definition: AppBase.cpp:70
virtual void updatePreClear()
Called once per frame after run() is called, before calling glClear.
Definition: AppBase.cpp:74
Definition: AppBase.h:9
A convenient base for any Blackcomb application.
Definition: AppBase.h:13
virtual void processInput()
Input handling code.
Definition: AppBase.cpp:79
Object-oriented wrapper for GLFW&#39;s window functions.
Definition: Window.h:17