Hi! I'm just starting with SFML and I just want to say great job! I really like the concept and implementation of SFML, and the pre-built mingw libraries are a godsend for me. Usually I have to build my own from .dlls and .libs. :|
Anyway, after reading the tutorials I decided to try a simple test to really get comfortable with the library, but I've run into a small problem:
I'm using the RenderWindow::Create function to toggle between fullscreen and windowed modes, and it works beautifully going from the initial windowed mode to fullscreen, but when switching back the window remains the same size as my desktop, and as far as I can tell from reading the documentation and searching these forums there's no way to resize the window.
I'm using Code::Blocks and MinGW. Can anyone tell me what I'm doing wrong? Is this a quirk with the Windows/MinGW implementation or a bug/limitation in SFML? And if so is there a workaround or should I go ahead and dive into SFML's source? Any help is appreciated!
My source:
#include <SFML/Graphics.hpp>
using namespace sf;
int main() {
Event input;
bool fullscreen;
RenderWindow App(VideoMode(640, 480, 16), "SFML Test");
while (App.IsOpened()) {
//Process events
while (App.GetEvent(input)) {
//Exit
if (input.Type == Event::Closed) App.Close();
if ((input.Type == Event::KeyPressed) && (input.Key.Code == Key::Escape)) App.Close();
//Fullscreen toggle
if ((input.Type == Event::KeyPressed) && (input.Key.Code == Key::F)) {
fullscreen = !fullscreen;
App.Create(VideoMode(640, 480, 16), "SFML Test", (fullscreen ? Style::Fullscreen : Style::Resize|Style::Close));
}
}
App.Display();
}
return EXIT_SUCCESS;
}
P.S. It seems that it's not just the window size that's off, but the video mode. Displaying a 640x480 image in the window results in a large black space around it after switching to fullscreen and back.
Edit: I knew I was forgetting something. I'm using the latest stable version of SFML: 1.3.