[SDL] SDL_HWSURFACE not working?

Bob Pendleton bob at pendleton.com
Tue Mar 4 13:36:01 PST 2003


On Tue, 2003-03-04 at 14:41, Fredrik wrote:
> Hello!
> 
> I'm new to SDL, having just migrated from CDX to the promised land of 
> multi-platform, and I'm having some major performance problems. I'm using 
> MSVC6.0, win2ksp3, DX9, and a 64MB GF3 (also tried this on another machine 
> with a 32MB GF2) So, first thing, I'm making sure all my surfaces are in 
> video RAM, but somehow they don't want to go there...
> 
> This here test:
> 
> SDL_Surface* Test = SDL_CreateRGBSurface( SDL_HWSURFACE, 640, 480, 32, 
> 0xFF, 0xFF00, 0xFF0000, 0xFF000000 );
> 
> if( ( Test->flags & SDL_HWSURFACE ) == SDL_HWSURFACE )
> 	printf( "Test surface exists in video ram" );

Have you set the video mode before doing this? The video mode MUST be
set first. Also, it is a very good idea to pull the bits/pixel value and
the field masks out of the SDL_PixelFormat stored in the screen surface
structure so that you can be sure they are the same. And, of course,
make sure that the screen is actually a hardware surface. SDL gives you
the pixel depth you ask for, even if it has to emulate it in software.

		Bob Pendleton

> 
> Should tell me that the surface is in video RAM, no? Well, it doesn't, and 
> being such a noob I cannot figure out why... I've done some searching in 
> the list archives but couldn't really find anything relevant to this 
> situation. Same thing when loading bitmaps from disk, doing 
> SDL_ConvertSurface() to a new pointer and specifying SDL_HWSURFACE doesn't 
> work either.
> 
> Any help would be much appreciated!
> 
> Thanks!
> 
> /Fredrik
> 
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
-- 
+------------------------------------+
+ Bob Pendleton, consultant for hire +
+ Resume: http://www.jump.net/~bobp  +
+ Email:  bob at pendleton.com          +
+------------------------------------+





More information about the SDL mailing list