Phoxonics  1.0
Object Oriented FDTD Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
App.hpp
Go to the documentation of this file.
1 #ifndef _APP_H_
2 #define _APP_H_
3 
4 #include <SDL2/SDL.h>
5 #include <GL/gl.h>
6 #include <GL/glu.h>
7 #include "Event.hpp"
8 
9 #include "../../phoxonics.hpp"
10 
11 class App : public Event {
12 public:
13  int execute(int argc, char* argv[]);
14 
15  static App* instance();
16  static int windowWidth();
17  static int windowHeight();
18 // phoxonics::common::Programs program { phoxonics::common::Programs::OPENGL_FDTD_1D };
19 
20  SDL_GLContext gl_context { nullptr };
23 // phoxonics::core::Fdtd1D fdtd_1d;
24 // phoxonics::core::Fdtd2D fdtd_2d;
25 // phoxonics::core::Fdtd1DSullivan fdtd_1d_sullivan;
26 
27 private:
28  static App instance_;
29  bool is_running_ { true };
30 
31  SDL_Window* window_ { nullptr };
32  SDL_Renderer* renderer_ { nullptr };
33  SDL_Surface* primary_surface_ { nullptr };
34 
35  static const int window_width_ { 640 };
36  static const int window_height_ { 480 };
37 
38  App();
39  void on_event(SDL_Event* event); // Capture SDL Events
40  bool init(); // Initialize our SDL game / app
41  void loop(); // Logic loop
42  void render(); // Render loop (draw)
43  void cleanup(); // Free up resources
44 };
45 
46 #endif
phoxonics::visual::OpenGlUnitVector opengl_unit_vector
Definition: App.hpp:21
static int windowWidth()
Definition: App.cpp:153
Definition: OpenGlUnitVector.hpp:21
static App * instance()
Definition: App.cpp:149
phoxonics::visual::OpenGlFdtd1D opengl_fdtd_1d
Definition: App.hpp:22
SDL_GLContext gl_context
Definition: App.hpp:20
Definition: Event.hpp:18
int execute(int argc, char *argv[])
Definition: App.cpp:120
static int windowHeight()
Definition: App.cpp:157
Definition: App.hpp:11
Definition: OpenGlFdtd1D.hpp:20