Euphoria
engine.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 
5 #include "core/argparse.h"
6 
7 #include "window/fakesdlevent.h"
8 
9 
10 namespace eu::io
11 {
12  struct FileSystem;
13  struct ReadRootCatalog;
14 }
15 
16 namespace eu::render
17 {
18  struct Init;
19 }
20 
22 {
23  struct Library;
24 }
25 
26 namespace eu::window
27 {
28  struct SdlLibrary;
29  struct SdlWindow;
30  struct SdlOpenglContext;
31 
32  struct Engine
33  {
34  std::unique_ptr<SdlLibrary> sdl;
35  std::unique_ptr<io::FileSystem> file_system;
36  std::shared_ptr<io::ReadRootCatalog> catalog;
37  std::unique_ptr<SdlWindow> window;
38  unsigned int window_id;
39  std::unique_ptr<SdlOpenglContext> context;
40  std::unique_ptr<render::Init> init;
41  std::unique_ptr<imgui::Library> imgui;
42 
43  Engine();
44  ~Engine();
45 
46  Engine(const Engine&) = delete;
47  Engine(Engine&&) = delete;
48  void operator=(const Engine&) = delete;
49  void operator=(Engine&&) = delete;
50 
51  int setup(const core::argparse::NameAndArguments& args);
52 
53  bool create_window
54  (
55  const std::string& title,
56  int width,
57  int height,
58  bool blend_hack = false
59  );
60 
61  bool on_resize(SDL_Event e, int* width, int* height) const;
62  };
63 }
union SDL_Event SDL_Event
Definition: fakesdlevent.h:4
Definition: enum.h:8
container for arguments passed to main
Definition: argparse.h:98
void operator=(Engine &&)=delete
std::unique_ptr< SdlWindow > window
Definition: engine.h:37
std::unique_ptr< SdlLibrary > sdl
Definition: engine.h:34
void operator=(const Engine &)=delete
std::unique_ptr< SdlOpenglContext > context
Definition: engine.h:39
Engine(Engine &&)=delete
bool create_window(const std::string &title, int width, int height, bool blend_hack=false)
Definition: engine.cc:93
bool on_resize(SDL_Event e, int *width, int *height) const
Definition: engine.cc:144
std::unique_ptr< render::Init > init
Definition: engine.h:40
unsigned int window_id
Definition: engine.h:38
std::unique_ptr< io::FileSystem > file_system
Definition: engine.h:35
Engine(const Engine &)=delete
std::unique_ptr< imgui::Library > imgui
Definition: engine.h:41
std::shared_ptr< io::ReadRootCatalog > catalog
Definition: engine.h:36
int setup(const core::argparse::NameAndArguments &args)
Definition: engine.cc:43