Euphoria
init.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "base/rect.h"
4 #include "base/mat4.h"
5 #include "base/rgb.h"
6 
7 namespace eu::render
8 {
9  using LoaderFunction = void* (*)(const char* name);
10 
11  // todo(Gustav): come up with a better name
12  struct Init
13  {
14  enum class BlendHack
15  {
16  no_hack,
18  };
19 
20  bool is_ok;
21 
22  explicit Init(LoaderFunction loader, BlendHack blend_hack = BlendHack::no_hack);
23  ~Init();
24 
25  Init(const Init&) = delete;
26  Init(Init&&) = delete;
27  void operator=(const Init&) = delete;
28  void operator=(Init&&) = delete;
29 
30  [[nodiscard]] mat4f get_ortho_projection
31  (float width, float height) const;
32 
33  // todo(Gustav): move to some place better
34  void clear_screen(const Rgb& color) const;
35 
36  // todo(Gustav): move to some better place
37  void use_2d() const;
38  };
39 
40 }
void *(*)(const char *name) LoaderFunction
Definition: init.h:9
Definition: rgb.h:62
Definition: mat4.h:14
Init(const Init &)=delete
void operator=(const Init &)=delete
void operator=(Init &&)=delete
void clear_screen(const Rgb &color) const
Definition: init.cc:77
Init(Init &&)=delete
mat4f get_ortho_projection(float width, float height) const
Definition: init.cc:61
void use_2d() const
Definition: init.cc:69
Init(LoaderFunction loader, BlendHack blend_hack=BlendHack::no_hack)
Definition: init.cc:13
bool is_ok
Definition: init.h:20