I'm having an interesting problem when I call sfVideoMode_getFullscreenModes. The number of modes it tells me I have is absurdly high, but only 9 seem to have any valid information. I am using the current version of CSFML, but I am using the library in D though I doubt that would make much of a difference.
Here is an example program I wrote:
void main(string[] args)
{
sfVideoMode* modes;
size_t count;
int size = sfVideoMode.sizeof;
modes = sfVideoMode_getFullscreenModes(&count);
writeln("Number of fullscreen modes: ",count);
writeln();
for(int i = 0; i<count; i++)
{
try
{
sfVideoMode temp = modes[i*size];
writeln("VideoMode number ", i+1);
writeln(VideoModeAsString(temp));
writeln();
}
catch
{
}
}
}
string VideoModeAsString(sfVideoMode videoMode)
{
return "Width: " ~ text(videoMode.width) ~
" Height: " ~ text(videoMode.height) ~
" Bits per pixel: " ~ text(videoMode.bitsPerPixel);
}
If I don't include the try/catch blocks the program throws a runtime error after the 9th video mode. Anyways, here is what the program outputs for me.
Number of fullscreen modes: 57
VideoMode number 1
Width: 1920 Height: 1080 Bits per pixel: 32
VideoMode number 2
Width: 1280 Height: 720 Bits per pixel: 32
VideoMode number 3
Width: 1366 Height: 768 Bits per pixel: 16
VideoMode number 4
Width: 720 Height: 480 Bits per pixel: 16
VideoMode number 5
Width: 1280 Height: 800 Bits per pixel: 8
VideoMode number 6
Width: 0 Height: 0 Bits per pixel: 0
VideoMode number 7
Width: 0 Height: 0 Bits per pixel: 0
VideoMode number 8
Width: 0 Height: 0 Bits per pixel: 0
VideoMode number 9
Width: 1305645974 Height: 50482155 Bits per pixel: 6357136
I'm not sure what exactly is going on, but I also want to point out that the very last video mode that I get's written to the console has changing values. My guess I'll probably be ok if I stop when I get to a {0,0,0} videomode. I don't know if this happens on anyone else's system, but I just thought I would bring this to Laurent's attention.