2
2
3
3
#include < SDL.h>
4
4
#include < SDL_image.h>
5
- #include " ../../tools/str_exception.hpp "
5
+ #include < stdexcept >
6
6
#include < assert.h>
7
7
8
8
using namespace Mangle ::Rend2D;
@@ -70,7 +70,7 @@ int SDL_Sprite::height() { return surface->h; }
70
70
SDLDriver::SDLDriver () : display(NULL ), realDisp(NULL ), softDouble(false )
71
71
{
72
72
if (SDL_InitSubSystem ( SDL_INIT_VIDEO ) == -1 )
73
- throw str_exception (" Error initializing SDL video" );
73
+ throw std::runtime_error (" Error initializing SDL video" );
74
74
}
75
75
SDLDriver::~SDLDriver ()
76
76
{
@@ -94,7 +94,7 @@ void SDLDriver::setVideoMode(int width, int height, int bpp, bool fullscreen)
94
94
// Create the surface and check it
95
95
realDisp = SDL_SetVideoMode (width, height, bpp, flags);
96
96
if (realDisp == NULL )
97
- throw str_exception (" Failed setting SDL video mode" );
97
+ throw std::runtime_error (" Failed setting SDL video mode" );
98
98
99
99
// Code for software double buffering. I haven't found this to be
100
100
// any speed advantage at all in windowed mode (it's slower, as one
@@ -160,7 +160,7 @@ Sprite* SDLDriver::loadImage(const std::string &file)
160
160
SDL_Surface *surf = IMG_Load (file.c_str ());
161
161
surf = convertImage (surf);
162
162
if (surf == NULL )
163
- throw str_exception (" SDL failed to load image file '" + file + " '" );
163
+ throw std::runtime_error (" SDL failed to load image file '" + file + " '" );
164
164
return spriteFromSDL (surf);
165
165
}
166
166
@@ -171,7 +171,7 @@ Sprite* SDLDriver::loadImage(SDL_RWops *src, bool autoFree)
171
171
SDL_Surface *surf = IMG_Load_RW (src, autoFree);
172
172
surf = convertImage (surf);
173
173
if (surf == NULL )
174
- throw str_exception (" SDL failed to load image" );
174
+ throw std::runtime_error (" SDL failed to load image" );
175
175
return spriteFromSDL (surf);
176
176
}
177
177
0 commit comments