00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "mxscreen.h"
00018 #include"mxpng.h"
00019 #include"mx_exception.h"
00020
00021
00022 namespace mx
00023 {
00024
00025 void mxScreen::loadSurface ( mx::mxSurface &surf, std::string filename )
00026 {
00027 SDL_Surface *surface = 0;
00028 std::ostringstream stream;
00029
00030 mx::mxPng p;
00031 if( p.pngOpen ( filename ) )
00032 {
00033 surface = p.LoadPNG();
00034 p.pngClose();
00035 if ( surface == 0 )
00036 throw mx::mxException<std::string> ( " Error loading surface.. " + filename + "\n");
00037 surf = surface;
00038 } else throw mx::mxException<std::string>(" Error loading surface " + filename + "\n");
00039 }
00040
00041 }
00042
00043