コード例 #1
0
ファイル: View.cpp プロジェクト: kippy76/Cellsim-Win-x86
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();
}
コード例 #2
0
ファイル: Game.cpp プロジェクト: davetron5000/adventureclone
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;
}