]> git.localhorst.tv Git - blank.git/blobdiff - src/init.cpp
begun extracting model class
[blank.git] / src / init.cpp
index 9010e00ba6b26c50d71514a96d48332f78d94d3c..20f4fe4e6c0693b7e2e235eabc4173a316ed9215 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <algorithm>
 #include <SDL.h>
+#include <SDL_image.h>
 #include <stdexcept>
 #include <string>
 #include <GL/glew.h>
@@ -34,6 +35,17 @@ InitSDL::~InitSDL() {
 }
 
 
+InitIMG::InitIMG() {
+       if (IMG_Init(IMG_INIT_PNG) == 0) {
+               sdl_error("IMG_Init(IMG_INIT_PNG)");
+       }
+}
+
+InitIMG::~InitIMG() {
+       IMG_Quit();
+}
+
+
 InitGL::InitGL() {
        if (SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3) != 0) {
                sdl_error("SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3)");