*******************************************************************************/
-#include <SDL/SDL_image.h>
-
#include "Dispatch.hh"
#include "Engine.hh"
-#include "Exception.hh"
+#include "Error.hh"
+#include "Image.hh"
#include "Log.hh"
#include "Settings.hh"
#include "Video.hh"
void Video::init(const Attributes& attribs)
{
- // make sure the engine is initialized before setting up the video
- Engine::getInstance();
-
mContext = 0;
mFlags = 0;
mAttribs = attribs;
logInfo("video context recreated");
#endif
}
- else throw Exception(ErrorCode::SDL_VIDEOMODE);
+ else throw Error(Error::SDL_VIDEOMODE);
}
}
{
if (mAttribs.icon != "")
{
- SDL_Surface* icon = IMG_Load(mAttribs.icon.c_str());
- if (icon)
- {
- SDL_WM_SetIcon(icon, 0);
- SDL_FreeSurface(icon);
- }
+ Image icon(mAttribs.icon);
+ icon.setAsIcon();
}
}