+/*
+ * InitImage.cpp
+ *
+ * Created on: Aug 6, 2012
+ * Author: holy
+ */
+
+#include "InitImage.h"
+
+#include <SDL_image.h>
+#include <stdexcept>
+
+using std::runtime_error;
+
+namespace sdl {
+
+InitImage::InitImage(int flags) {
+ if (IMG_Init(flags) != flags) {
+ throw runtime_error(IMG_GetError());
+ }
+}
+
+InitImage::~InitImage() {
+ IMG_Quit();
+}
+
+}