Sign in to follow this  

Some SFML issues

This topic is 2391 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently attempting to set up my SFML environment. I've been using SDL for the past couple of years, and I have decided to move on. Currently, I seemingly have everything set up; however, when I use:

sf::Window -- the window appears but weird, unwanted images appear and cannot get it to be plain black.

or

sf::RenderWindow -- the window goes blank white for about 10 seconds and then crashes even though I clear the screen and display it afterward.

I've been using tutorial source code in order to troubleshoot these issues but nothing is working too far. I'm currently using SFML 1.6 and Visual Studio 2008.

Share this post


Link to post
Share on other sites
[quote name='KHearts' timestamp='1306134541' post='4814487']
I'm currently attempting to set up my SFML environment. I've been using SDL for the past couple of years, and I have decided to move on. Currently, I seemingly have everything set up; however, when I use:

sf::Window -- the window appears but weird, unwanted images appear and cannot get it to be plain black.

or

sf::RenderWindow -- the window goes blank white for about 10 seconds and then crashes even though I clear the screen and display it afterward.

I've been using tutorial source code in order to troubleshoot these issues but nothing is working too far. I'm currently using SFML 1.6 and Visual Studio 2008.
[/quote]

Use the RenderWindow one. Post your code (not just the tutorial's, but the actual code that you yourself tried to compile), and post what linker settings you are using. That way we can look over it and see if we spot anything wrong.

Share this post


Link to post
Share on other sites
[code]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>

int main()
{
// Create the main rendering window
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

// Start game loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();

// A key has been pressed
if (Event.Type == sf::Event::KeyPressed)
{
// Escape key : exit
if (Event.Key.Code == sf::Key::Escape)
App.Close();

// F1 key : capture a screenshot
if (Event.Key.Code == sf::Key::F1)
{
sf::Image Screen = App.Capture();
Screen.SaveToFile("screenshot.jpg");
}
}
}

// Clear the screen with red color
App.Clear(sf::Color(200, 0, 0));

// Display window contents on screen
App.Display();
}

return EXIT_SUCCESS;
}
[/code]

Linking:
sfml-system-s.lib
sfml-graphics-s.lib
sfml-window-s.lib
sfml-network-s.lib
sfml-audio-s.lib

Share this post


Link to post
Share on other sites
[quote name='KHearts' timestamp='1306193786' post='4814808']
My video card is actually onboard since I'm working from a small netbook.
[/quote]
Try updating your video driver.
Try your program on a friend/family computer, and if it works, scour the SFML forums looking for people with similar problems. It's not your code that's wrong.

I had a similar problem earlier this year, with SFML. It happed to alot of SFML users who were using ATI cards with the Catalyst drivers. I ended up having to statically link to the SFML libraries to solve the issue, instead of dynamically linking. However, since you are already statically linking, maybe try the opposite? [img]http://public.gamedev.net/public/style_emoticons/default/mellow.gif[/img]

Share this post


Link to post
Share on other sites

This topic is 2391 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this