]> git.localhorst.tv Git - blank.git/blobdiff - src/app/init.hpp
move common exceptions to app/error
[blank.git] / src / app / init.hpp
index 13bffa1f30e8886087ac441319f0f9af766f8aa3..42a4176af29ba02f03665ac0981f071222748e88 100644 (file)
@@ -1,41 +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 AlutError
-: public std::runtime_error {
+class InitSDL {
 
 public:
-       explicit AlutError(ALenum);
-       AlutError(ALenum, const std::string &);
-
-};
-
-class SDLError
-: public std::runtime_error {
+       InitSDL();
+       ~InitSDL();
 
-public:
-       SDLError();
-       explicit SDLError(const std::string &);
+       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;
 
 };
 
@@ -52,6 +45,18 @@ public:
 };
 
 
+class InitNet {
+
+public:
+       InitNet();
+       ~InitNet();
+
+       InitNet(const InitNet &) = delete;
+       InitNet &operator =(const InitNet &) = delete;
+
+};
+
+
 class InitTTF {
 
 public:
@@ -68,7 +73,7 @@ class InitAL {
 
 public:
        InitAL();
-       ~InitAL();
+       ~InitAL() throw(AlutError);
 
        InitAL(const InitAL &) = delete;
        InitAL &operator =(const InitAL &) = delete;
@@ -138,11 +143,20 @@ 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;