The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Why hwsurface not created and how to Create??
Jonny D


Joined: 12 Sep 2009
Posts: 932
Maybe you want to check pSurface->flags instead of pSurface (the pointer)?

Jonny D


On Sun, Sep 9, 2012 at 8:02 PM, axt32 wrote:
Quote:



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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Why hwsurface not created and how to Create??
axt32


Joined: 10 Sep 2012
Posts: 1
<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??
[img]http://mail.naver.com/readReceipt/notify/?img=RPKsKoFdDzJoax%2BCKxUYK6traAk4po2ZKx0oF6F0poISp4u%2FKrEZFdId%2BrkSKx25W4d5W4C5bX0q%2BzkR74FTWx%2Fsbr3ntzwGbX3q74wGMNFvWVlTb4b%3D.gif[/img]
Why hwsurface not created and how to Create??
Torsten Giebl


Joined: 12 Sep 2009
Posts: 172
Hello !


Quote:
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
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Why hwsurface not created and how to Create??
Jonny D


Joined: 12 Sep 2009
Posts: 932
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