]> git.localhorst.tv Git - blank.git/blobdiff - src/app/init.hpp
move common exceptions to app/error
[blank.git] / src / app / init.hpp
index 122210d1e96bc426a33de8b8a6fb938eda02976e..42a4176af29ba02f03665ac0981f071222748e88 100644 (file)
@@ -1,31 +1,34 @@
 #ifndef BLANK_APP_INIT_HPP_
 #define BLANK_APP_INIT_HPP_
 
+#include "error.hpp"
+
+#include <al.h>
 #include <SDL.h>
-#include <stdexcept>
-#include <string>
 
 
 namespace blank {
 
-class SDLError
-: public std::runtime_error {
+class InitSDL {
 
 public:
-       SDLError();
-       explicit SDLError(const std::string &);
+       InitSDL();
+       ~InitSDL();
+
+       InitSDL(const InitSDL &) = delete;
+       InitSDL &operator =(const InitSDL &) = delete;
 
 };
 
 
-class InitSDL {
+class InitVideo {
 
 public:
-       InitSDL();
-       ~InitSDL();
+       InitVideo();
+       ~InitVideo();
 
-       InitSDL(const InitSDL &) = delete;
-       InitSDL &operator =(const InitSDL &) = delete;
+       InitVideo(const InitVideo &) = delete;
+       InitVideo &operator =(const InitVideo &) = delete;
 
 };
 
@@ -42,6 +45,18 @@ public:
 };
 
 
+class InitNet {
+
+public:
+       InitNet();
+       ~InitNet();
+
+       InitNet(const InitNet &) = delete;
+       InitNet &operator =(const InitNet &) = delete;
+
+};
+
+
 class InitTTF {
 
 public:
@@ -54,6 +69,18 @@ public:
 };
 
 
+class InitAL {
+
+public:
+       InitAL();
+       ~InitAL() throw(AlutError);
+
+       InitAL(const InitAL &) = delete;
+       InitAL &operator =(const InitAL &) = delete;
+
+};
+
+
 class InitGL {
 
 public:
@@ -116,13 +143,23 @@ public:
 };
 
 
+struct InitHeadless {
+
+       InitHeadless();
+
+       InitSDL init_sdl;
+       InitNet init_net;
+
+};
+
 struct Init {
 
        Init(bool double_buffer = true, int sample_size = 1);
 
-       InitSDL init_sdl;
+       InitVideo init_video;
        InitIMG init_img;
        InitTTF init_ttf;
+       InitAL init_al;
        InitGL init_gl;
        Window window;
        GLContext ctx;