~sircmpwn/xrgears

ref: c4afd33e13398688fc03f60ef3d0a498bf40bfdd xrgears/vkc/vkcApplication.hpp -rw-r--r-- 753 bytes
c4afd33e — Lubosz Sarnecki add new abstract classes for interfaces between vks and vkc. 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once

#include <assert.h>
#include <stdio.h>
#include <string.h>

#include "../vkc/vkcWindow.hpp"

namespace vkc {

class Renderer;

class Application {
public:
   Renderer *renderer;
   Window *display;
   enum window_type mode;

   bool quit = false;

   static inline bool streq(const char *a, const char *b) {
     return strcmp(a, b) == 0;
   }

   Application(uint32_t w, uint32_t h);
   ~Application();

   bool display_mode_from_string(const char *s);
   void parse_args(int argc, char *argv[]);
   void init_display();
   void loop();

   int init_display_mode(window_type m);
   void init_display_mode_auto();

   virtual void init() = 0;
   //virtual void render(struct RenderBuffer *b) = 0;
   virtual void update_scene() = 0;

};
}