Hi
Hmmm, if there’s no bug in the following code and that’s not windib fault, then it looks that there’s bug in SDL_GetVideoInfo() in SDL 1.2.8.
My specs: WinXP (no SP), GeForce4 MX 440, drivers were updated 2 months before.-----------------------
#include
#include <SDL.h>
void DumpVideoInfo()
{
const SDL_VideoInfo * videoInfo = SDL_GetVideoInfo();
int videoMemory = videoInfo->video_mem;
fprintf(stderr, “Total amount of video memory: %i kilobytes.\n”, videoMemory);
}
int main (int argc, char *argv[])
{
if (SDL_Init (SDL_INIT_VIDEO) < 0)
return 1;
atexit (SDL_Quit);
DumpVideoInfo();
char driver[128];
if ( SDL_VideoDriverName(driver, sizeof(driver)) )
fprintf(stderr, “Video driver: %s\n”, driver);
SDL_Surface * screen = SDL_SetVideoMode (640, 480, 16, SDL_SWSURFACE | SDL_DOUBLEBUF);
if (screen == 0)
return 1;
DumpVideoInfo();
if ( SDL_VideoDriverName(driver, sizeof(driver)) )
fprintf(stderr, “Video driver: %s\n”, driver);
int done = 0;
while (!done)
{
SDL_Event event;
while (SDL_PollEvent (&event))
{
switch (event.type)
{
case SDL_KEYDOWN:
DumpVideoInfo();
break;
case SDL_QUIT:
done = 1;
break;
}
}
SDL_Flip (screen);
SDL_Delay (1);
}
return 0;
}
Problem probably lies within DumpVideoInfo() function, output in stderr goes like this:
Total amount of video memory: 0 kilobytes.
Video driver: windib
Total amount of video memory: 0 kilobytes.
Video driver: windib
Total amount of video memory: 0 kilobytes.
Total amount of video memory: 0 kilobytes.
…
I think those 0 shouldn’t be there… IIRC, in 1.2.7 it was working fine.
Koshmaar