A problem on SDL_GetVideoInfo()

Hi all.I try to get the amount of video card RAM with SDL,and my codes below get a result which doesn’t seem to be right. int main(int argc, char *argv[])
{const SDL_VideoInfo *info=NULL; if( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO ) < 0 )
{
printf(“Unable to init SDL: %s\n”, SDL_GetError());
exit(1);
}
info=SDL_GetVideoInfo();
if(!info)
{
printf(" %s",SDL_GetError());
printf(“unable to get video information\n”);
//return 0;
}printf(“my video ram is %d\n”,info->video_mem);//Here it prints that “my video ram is 0” but I know that my video card equits with 64MB VRAM,what causes the info pointer doesn’t show right value?

Hey,

I would check out this post and see if it answers your question:
http://www.libsdl.org/faq.php?action=listentries&category=2#20

JohnOn 9/18/07, dh11111 <dh11111 at 126.com> wrote:

Hi all.
I try to get the amount of video card RAM with SDL,
and my codes below get a result which doesn’t seem to be right.

int main(int argc, char *argv[])
{
const SDL_VideoInfo *info=NULL;

if( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO ) < 0 )
{
printf(“Unable to init SDL: %s\n”, SDL_GetError());
exit(1);
}

info=SDL_GetVideoInfo();
if(!info)
{
printf(" %s",SDL_GetError());
printf(“unable to get video information\n”);
//return 0;
}
printf(“my video ram is %d\n”,info->video_mem);//Here it prints that “my
video ram is 0”

but I know that my video card equits with 64MB VRAM,
what causes the info pointer doesn’t show right value?


? ? ? ? ? ? ? ??? ? ? ? ? ??? ? 2 0 0 7


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