[SDL] SDL 1.3 status ?

Brian Barnes ggadwa at charter.net
Thu Jul 28 06:30:30 PDT 2011


I'll wade into this with a vote only for removing the compatibility 
layer.  In dim3, I need SDL 1.3 for iOS, but until I get relative mouse 
movement I can't use it on the OS X/windows/linux desktop version.

So my code looks like this:

#ifdef D3_SDL_1_3
	sdl_flags=SDL_WINDOW_OPENGL|SDL_WINDOW_SHOWN;
	if (!gl_in_window_mode()) sdl_flags|=SDL_WINDOW_FULLSCREEN;
	
	sdl_wind=SDL_CreateWindow("dim3",SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,setup.screen.x_sz,setup.screen.y_sz,sdl_flags);
	if (sdl_wind==NULL) {
		sprintf(err_str,"SDL: Could not create window (Error: 
%s)",SDL_GetError());
		return(FALSE);
	}
	
	sdl_gl_ctx=SDL_GL_CreateContext(sdl_wind);
#else
	if (gl_in_window_mode()) {
	 
surface=SDL_SetVideoMode(setup.screen.x_sz,setup.screen.y_sz,32,SDL_OPENGL|SDL_HWSURFACE);
		SDL_WM_SetCaption("dim3",NULL);
	}
	else {
	 
surface=SDL_SetVideoMode(setup.screen.x_sz,setup.screen.y_sz,32,SDL_OPENGL|SDL_FULLSCREEN);
	}

	if (surface==NULL) {
		sprintf(err_str,"SDL: Could not set video mode (Error: 
%s)",SDL_GetError());
		return(FALSE);
	}
		
	#ifdef D3_OS_MAC
		if (!gl_in_window_mode()) SetSystemUIMode(kUIModeContentSuppressed,0);
	#endif
#endif

It's NOT that big of a deal.  I really didn't have to do this a lot, and 
only in a couple places (the events were the places that got most 
sticky, but that wasn't bad either.)

So, I say drop the comparability layer, especially if it's slowing down 
development or introducing bugs that have to be fixed with a boat load 
of spaghetti code.

[>] Brian




More information about the SDL mailing list