View::View(int x, int y, bool fullScreen, Model* model, int border) { VIDEOFLAG = SDL_SWSURFACE; if (fullScreen) { VIDEOFLAG = VIDEOFLAG | SDL_FULLSCREEN; } modeX = x; modeY = y; this->border = border; this->model = model; if (!initGUI()) { string errorText = "Error: Video Failed To Initialise.\n"; errorText += SDL_GetError(); throw CAException(&errorText[0]); } initSurfaces(); initFont(); }
BOOL Game::init(DWORD currentTime, char *worldname, HWND hwnd,HINSTANCE hinstance) { itsCurrentWorldName = worldname; itsLastTickTime = currentTime; theEventDispatcher.init(); CreateDirectory("screens",NULL); itsScreenshotManager.init("screens\\advtr"); if (startDirectDraw(hwnd, hinstance)) { if ( startDirectSound(hwnd, hinstance) ) { if ( initSurfaces(hwnd, hinstance) ) { if ( startDirectInput(hwnd, hinstance) ) { itsWorld = new Game1World(FALSE,FALSE); return start(currentTime); } } } } return FALSE; }