All pastes #281993 Raw Edit

Someone

public text v1 · immutable
#281993 ·published 2006-12-17 05:53 UTC
rendered paste body
int main (int argc, char **argv)
	{
	SDL_Surface* screen;
	int videoFlags;
	const SDL_VideoInfo* videoInfo;

	if ( SDL_Init (SDL_INIT_EVERYTHING) < 0 )
		{
		fprintf (stderr, "Video initialization failed: %s\n", SDL_GetError ());
		exit (1);
		}

	videoInfo = SDL_GetVideoInfo ();

	if (!videoInfo)
		{
		fprintf (stderr, "Video query failed: %s\n", SDL_GetError ());
		exit (1);
		}

	videoFlags  = SDL_OPENGL;
	videoFlags |= SDL_GL_DOUBLEBUFFER;
	videoFlags |= SDL_HWPALETTE;
	//videoFlags |= SDL_FULLSCREEN;

	if (videoInfo->hw_available) videoFlags |= SDL_HWSURFACE;
	else videoFlags |= SDL_SWSURFACE;

	if (videoInfo->blit_hw) videoFlags |= SDL_HWACCEL;
	SDL_GL_SetAttribute (SDL_GL_DOUBLEBUFFER, 1);
	screen = SDL_SetVideoMode (SCREENSIZEX, SCREENSIZEY, SCREENSIZED, videoFlags);

	if (!screen)
		{
		fprintf (stderr, "Video mode set failed: %s\n", SDL_GetError ());
		exit (1);
		}
	else
		{
		printsurfaceinfo (screen, "Screen");
		}

	initGL ();
	resizeWindow (SCREENSIZEX,SCREENSIZEY);
	atexit (SDL_Quit);
	SDL_EnableUNICODE (1);
	SDL_ShowCursor(SDL_DISABLE);
	SDL_WM_GrabInput(SDL_GRAB_ON);
	SDL_EnableKeyRepeat(500, 25);
	SDL_WM_SetCaption("RPGE4 Map Editor","RPGE4 Map Editor");
	
	game mapeditor;
	mapeditor.loop ();

	return (0);
	}