Why hwsurface not created and how to Create?

Well, i found the cause of Choppy frame animation is that hwsurface creation fails.

My Development Environment is MS Visual Studio 2010, Windows 7.
My Graphic card is ATI Radeon HD 5800.------------------------------------------------------------------------------------------

if (bFullScreen == true) { pSurface = SDL_SetVideoMode(640, 480, 32, SDL_ANYFORMAT | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN); } else { pSurface = SDL_SetVideoMode(640, 480, 32, SDL_ANYFORMAT | SDL_HWSURFACE | SDL_DOUBLEBUF); }

if ( !(pSurface & SDL_HWSURFACE))
{
printf ("HWSURFACE failed.\n);
}

if ( !(pSurface & SDL_DOUBLEBUF))
{
printf ("DOUBLEBUF failed.\n);
}

Both of Error Message appears in my computer.

why hwsurface creation fails and how to solve this??

Maybe you want to check pSurface->flags instead of pSurface (the pointer)?

Jonny DOn Sun, Sep 9, 2012 at 8:02 PM, axt32 wrote:

Well, i found the cause of Choppy frame animation is that hwsurface
creation fails.

My Development Environment is MS Visual Studio 2010, Windows 7.

My Graphic card is ATI Radeon HD 5800.


if (bFullScreen == true)
{
pSurface = SDL_SetVideoMode(640, 480, 32, SDL_ANYFORMAT | SDL_HWSURFACE |
SDL_DOUBLEBUF | SDL_FULLSCREEN);
}
else
{
pSurface = SDL_SetVideoMode(640, 480, 32, SDL_ANYFORMAT | SDL_HWSURFACE |
SDL_DOUBLEBUF);
}

if ( !(pSurface & SDL_HWSURFACE))

{
printf ("HWSURFACE failed.\n);

}

if ( !(pSurface & SDL_DOUBLEBUF))

{

printf ("DOUBLEBUF failed.\n);

}

Both of Error Message appears in my computer.

why hwsurface creation fails and how to solve this??


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

<SORRY FOR re-post the same article. please delete http://forums.libsdl.org/viewtopic.php?t=8443>

Well, i found the cause of Choppy frame animation is that hwsurface creation fails.

My Development Environment is MS Visual Studio 2010, Windows 7.

My Graphic card is ATI Radeon HD 5800.

though i added ‘flags’, the problem not solved.

hwsurface and double buffering are not activated.------------------------------------------------------------------------------------------

if (bFullScreen == true) { pSurface = SDL_SetVideoMode(640, 480, 32, SDL_ANYFORMAT | SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN); } else { pSurface = SDL_SetVideoMode(640, 480, 32, SDL_ANYFORMAT | SDL_HWSURFACE | SDL_DOUBLEBUF); }

if ( !(pSurface->flags & SDL_HWSURFACE))

{
printf ("HWSURFACE failed.\n);

}

if ( !(pSurface->flags & SDL_DOUBLEBUF))

{

printf ("DOUBLEBUF failed.\n);

}

Both of Error Message appears in my computer.

why hwsurface creation fails and how to solve this??

Hello !

why hwsurface creation fails and how to solve this??

I guess you are using SDL 1.2 and that uses GDI as the primary driver for GFX
output, so no doublebuffering or hardware surfaces support there.

If your SDL.dll was compiled with DirectX support, there is an old driver in SDL
for DirectX 5, which you can try, but there is no guarranty that it works
okay today.

To activate it put this :

SDL_putenv(“SDL_VIDEODRIVER=directx”);

before using SDL_Init (SDL_INIT_VIDEO);

The recommendation would be to use SDL 2.0,
that gives you full HW Acceleration/VSync with DirectX
and OpenGL.

CU

If your game is simple (or reads pixels from the display surface), there’s
no need for trying to get a hardware accelerated display surface. Just use
a software surface. It’s extremely likely that something else is causing
your jitters and a hardware surface will not solve it.

Jonny D