~sircmpwn/xrgears

ref: f53b7eaffce0ac98c6541802803df215df383f11 xrgears/vkc/vkcWindow.hpp -rw-r--r-- 673 bytes
f53b7eaf — Lubosz Sarnecki make vkc and vks classes inherit from abstact vik classes. 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
42
43
44
#pragma once

#include <string>
#include <functional>

#include "vikWindow.hpp"

namespace vkc {
class Renderer;

enum window_type {
  AUTO = 0,
  KMS,
  XCB,
  WAYLAND,
};

class Window : public vik::Window {
public:
  std::string name;

  std::function<void()> init_cb;
  std::function<void()> update_cb;
  std::function<void()> quit_cb;

  Window() {}
  virtual ~Window() {}

  void set_init_cb(std::function<void()> cb) {
    init_cb = cb;
  }

  void set_update_cb(std::function<void()> cb) {
    update_cb = cb;
  }

  void set_quit_cb(std::function<void()> cb) {
    quit_cb = cb;
  }

  virtual int init(Renderer *r) = 0;
  virtual void iter(Renderer *r) = 0;
};
}