SFML community forums

Help => Window => Topic started by: Kaphonaits on December 25, 2010, 06:46:06 am

Title: I just do not know what to do!
Post by: Kaphonaits on December 25, 2010, 06:46:06 am
Hi. I've been trying to get SFML to work with Code::Blocks and the provided gcc 4.4 MinGW compiler. SFML-System, as the Randomizer works.

The problem comes with using any form of SFML-Window. As what happens is if (in Code::Blocks) I set the kind of application to Console Application, I get a normal blank command prompt window. It won't respond to any styles. So if I put in Styles::Fullscreen, nothing happens. Just the normal blank command prompt window.

If I set it to a GUI Application like it is supposed to be, nothing appears on screen and I have to manually end the process with the Task Manager.

I've tried reinstalling Code::Blocks. I've tried reinstalling SFML.

I've tried linking the libraries dynamically.

No dice.

Please help me. I'm really sick of using SDL for my programs and would like to switch to SFML, but as you can see I probably won't be able to for now. :(
Title: Re: I just do not know what to do!
Post by: Hiura on December 25, 2010, 09:37:28 am
Quote from: "Kaphonaits"
So if I put in Styles::Fullscreen
What do you mean ?

The only thing in C::B you may do is set your app as «GUI» and not «Command Prompt» (or somethign like that – the default one if I remember) if you don't want that black thing. Everything else in SFML is not related at all with C::B (or any other IDE).

Follow the tutorials to get an idea of how you should use SFML.  :wink:

EDIT : typo
Title: Re: I just do not know what to do!
Post by: Kaphonaits on December 26, 2010, 08:22:46 am
Quote from: "Hiura"
Quote from: "Kaphonaits"
So if I put in Styles::Fullscreen
What do you mean ?

The only thing in C::B you may do is set your app as «GUI» and not «Command Prompt» (or somethign like that – the default one if I remember) if you don't want that black thing. Everything else in SFML is not related at all this C::B (or any other IDE).

Follow the tutorials to get an idea of how you should use SFML.  :wink:
Your answer made little to no sense to me.

What I got out of it: To set my app in C::B to GUI (i've done this) and I think you're suggesting that Code::Blocks is the problem and not SFML.

Perhaps you're right, but I refuse to use any other IDE, especially Visual C++ 2010 due to it's god-awful compiler.
Title: I just do not know what to do!
Post by: tntexplosivesltd on December 26, 2010, 08:54:16 am
AFAIK, you can't use SFML with MinGW 4.4.
Title: Re: I just do not know what to do!
Post by: Hiura on December 26, 2010, 11:27:22 am
Quote from: "Kaphonaits"
What I got out of it: To set my app in C::B to GUI (i've done this) and I think you're suggesting that Code::Blocks is the problem and not SFML.
I didn't say that...

Quote from: "Hiura"
Quote from: "Kaphonaits"
So if I put in Styles::Fullscreen
What do you mean ?
without code I can't understand what you've done.

Is there any error/warning/... at any time during the process compiling/executing ?

BTW, there was a typo in my last message, make more sense now..
Title: I just do not know what to do!
Post by: Kaphonaits on December 28, 2010, 03:12:56 am
Quote from: "tntexplosivesltd"
AFAIK, you can't use SFML with MinGW 4.4.
This doesn't make sense. The tutorials themselves provide MinGW with gcc 4.4 so you CAN use it.

I'll try with C::B's default MinGW, version 3.45(?) and see if it works. But I doubt it.
Title: I just do not know what to do!
Post by: model76 on December 28, 2010, 03:32:11 am
Dude, you're not doing yourself any favors by ignoring Hiura. He may not be a native English speaker, but he is definitely one of the more experienced SFML users in here.

Please help us help you, by providing a minimal and complete code that reproduces your problem. :)
Title: I just do not know what to do!
Post by: Kaphonaits on December 28, 2010, 04:24:02 am
Here.

Code: [Select]
#include <SFML/Window.hpp>

using namespace sf;

int main()
{
      Window App(VideoMode(800, 600, 32), "SFML Test");
      while(App.IsOpened())
      {
            App.Display();
      }
      return 0;
}
Title: I just do not know what to do!
Post by: Laurent on December 28, 2010, 08:00:45 am
And what if you use a working example (with at least an event loop so that the window can respond)?
Title: I just do not know what to do!
Post by: Kaphonaits on December 29, 2010, 09:57:58 am
Quote from: "Laurent"
And what if you use a working example (with at least an event loop so that the window can respond)?
Yes I just tried this.

Result: Nothing.
Title: I just do not know what to do!
Post by: Laurent on December 29, 2010, 09:58:58 am
What does "nothing" mean?
Title: Very odd...
Post by: MarsCoreTeam on January 03, 2011, 03:02:08 pm
I can confirm this... well... bug? (I'm using SFML2!)
When making use of sf::Window, on some Windows (7?) machines nothing happens. Really nothing, it describes it at its best! A command prompt opens with a blinking mark. There are some users of our game M.A.R.S., who reported this problem too (for example heishe: http://www.sfml-dev.org/forum/viewtopic.php?p=25153#25153). Recently I installed Windows7 in on virtual machine and: I have the problem too. I didn't get to make it open any sf::Window. (Tried to compile the examples)

The problem is definitively not code-related, but machine-related. The same code works on some machines whereas it does not on others...

If you have any questions I will answer them... I really want this odd problem to be solved! ;)
Title: I just do not know what to do!
Post by: Laurent on January 03, 2011, 07:05:24 pm
Does it happen on ATI cards with recent drivers?
Title: I just do not know what to do!
Post by: MarsCoreTeam on January 04, 2011, 01:02:30 pm
It happens on a HD 4650 M with recent drivers, too. A driver downgrade doesn't change anything.
Code: [Select]

# include <SFML/Graphics.hpp>
# include <SFML/Window.hpp>
# include <iostream>

int main() {
    std::cout << "Fail!" << std::endl;

    sf::RenderWindow App(sf::VideoMode(800, 600), "SFML Shapes");

    while (App.IsOpened()) {
        sf::Event Event;
        while (App.GetEvent(Event)) {
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        App.Clear();
        App.Display();
    }
    return EXIT_SUCCESS;
}


Doesn't cout anything....
Title: I just do not know what to do!
Post by: Crank1d on January 04, 2011, 02:44:41 pm
I have Windows 7 64-bit and it seems like I´m having the same problem (also tried with older SFML versions 1.5 & 1.6 and nothing works). I have also tried running precompiled samples and they also wont work.
Title: Yay!
Post by: MarsCoreTeam on January 04, 2011, 04:07:08 pm
I got something! Can anybody confirm this behavior:

When executing the code mentioned above, the command prompt opens, nothing happens AND after, well, 10 minutes the SFML-Window opens!!
And
Code: [Select]
OpenGL Warning: DrvShareLists: unsupported
Fail!
OpenGL Warning: DrvShareLists: unsupported

Is printed to the terminal...
Since I'm on a virtual machine, this may be different on other machines...
Title: I just do not know what to do!
Post by: Crank1d on January 05, 2011, 03:24:55 am
I think i´ve found something...
http://www.panda3d.org/forums/viewtopic.php?t=9791
As it says in the link i´ve provided:
Quote
Some graphics drivers don't provide a double-buffered offscreen context.
Title: I just do not know what to do!
Post by: Laurent on January 05, 2011, 08:50:42 am
Ok but... there's no offscreen context in SFML, they are all attached to windows.
Title: I just do not know what to do!
Post by: heishe on January 10, 2011, 04:58:19 am
Hey,

I'm pretty sure that problem is 64-bit related. I get the same error (and I mean that when launching any sfml app) on two of my 64 bit machines where I don't have properly compiled 64-bit dlls and libs for SFML (it doesn't seem to work with the 32 bit libs), but not on my 32 bit machine.

(was posted here:
http://sfml-dev.org/forum/viewtopic.php?p=25747#25747