Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML Window not showing!!!  (Read 40729 times)

0 Members and 3 Guests are viewing this topic.

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Window not showing!!!
« on: December 16, 2011, 03:13:15 am »
So i linked with SFML 1.6 and MinGW but when build and run the code, all i get is a blank console window, not the SFML one. When i cross out the console window, it stays for like 8 seconds(as if its frozen) and then it terminates. I don't know what i did wrong. I tried reinstalling everything but the same problem still occurs. I've had SOO much problems with SFML installation with codeblocks.I've been trying to get SFML to run for the past like 4 days.So help would be incredibly appreciated! Thanks!

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
SFML Window not showing!!!
« Reply #1 on: December 16, 2011, 06:58:21 am »
Complete and minimal code, please. Seriously, why is it so difficult to figure out that we don't have access to your code? We need to see your code to see the problem.
I use the latest build of SFML2

CJ_COIMBRA

  • Full Member
  • ***
  • Posts: 112
    • ICQ Messenger - 13077864
    • View Profile
    • http://www.cjcoimbra.com
    • Email
SFML Window not showing!!!
« Reply #2 on: December 16, 2011, 09:18:41 pm »
Assuming your problem is not code related, I believe I had a similar (if not the same) problem than this one. I get this frozen window and if I wait for a very long time the game would start like if it was running on extremely low FPS rate. Couldn´t find any solution as it was somehow related to my video card + OS since the same code executed fast enough in several other computers with varied OSs. Changing from Code::Blocks to Visual Studio didn´t help either. I gave up and returned my computer to the original OS.
CJ

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Window not showing!!!
« Reply #3 on: December 16, 2011, 11:51:34 pm »
Alright fine here is the code im sorry:

Code: [Select]

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




int main()
{
    sf::RenderWindow Game(sf::VideoMode(800,600,32),"Amazing");




    while(Game.IsOpened())
    {
        sf::Event Event;

        while(Game.GetEvent(Event))
        {
            switch(Event.Type)
            {
                case sf::Event::Closed:
                Game.Close();
                break;

                default:
                break;
            }
        }

        Game.Clear(sf::Color(0,255,255));
        Game.Display();


    }

    return 0;
}




So, I build and run and all i get is a console window.

Anata

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Window not showing!!!
« Reply #4 on: December 17, 2011, 02:30:12 am »
The Type of "Build Target" is "Console application" or "GUI Application" ?

Haikarainen

  • Guest
SFML Window not showing!!!
« Reply #5 on: December 17, 2011, 02:42:24 am »
Quote from: "Anata"
The Type of "Build Target" is "Console application" or "GUI Application" ?



This shouldn't matter. Delete the #include <SFML/Window.hpp> btw, you dont need it. If that fixes the problem then thats nice.


Are you running linux? Have you tried to debug it in codeblocks?

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Window not showing!!!
« Reply #6 on: December 17, 2011, 03:37:24 am »
I tried both build targets console and GUI it doesnt work. And also deleting "Window.hpp> doesnt help. And I use windows operating system, not linux. And i work in codeblocks.And i built it in debug and release and i still get the blank console window. It appears as if theres nothing i can do. I would do SDL but SDL is in C which means its not object oriented. I like C++ ALOT more than C. So tht's why i want to do SFML...but theres just so much problems...

EDIT: I can make a video of the linking ive done with codeblocks and SFML and stuff..but i don't know how to show a video or screenshot on this forum. If there's anything else you can think of, PLEASE suggest.Thanks in advance!

Haikarainen

  • Guest
SFML Window not showing!!!
« Reply #7 on: December 17, 2011, 04:08:53 am »
Dude, debug it! Put the buildtarget to debug, then press F8, and tell us any errors.

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Window not showing!!!
« Reply #8 on: December 17, 2011, 04:25:44 am »
Ok so i debugged it under Debugw but while its debugging i still get the same blank console window. When i cross it however, it still statys for like 8 secs and then terminates but i dont think the debugger stops because there is an option that says "Stop Debugger" which means its still running... Then when i try to stop it, it says "Trying to pause the running process..." and it doesnt stop unless i cross out the window. So what now?

Haikarainen

  • Guest
SFML Window not showing!!!
« Reply #9 on: December 17, 2011, 09:33:57 am »
Quote from: "Viruses"
Ok so i debugged it under Debugw but while its debugging i still get the same blank console window. When i cross it however, it still statys for like 8 secs and then terminates but i dont think the debugger stops because there is an option that says "Stop Debugger" which means its still running... Then when i try to stop it, it says "Trying to pause the running process..." and it doesnt stop unless i cross out the window. So what now?


Might be a bug in 1.6, i know from experience 2.0 is more stable, so try dling/compiling/setting up 2.0 and use the exact same code, except change GetEvent to PollEvent

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Window not showing!!!
« Reply #10 on: December 17, 2011, 08:00:36 pm »
But a lot of other people don't have this problem.. and btw i didn't have to build 2.0 myself i got the bin and lib stuff from a website which had already built it. So I tried everything and linked it and dlled it watever but it still showed the same blank console window. However, one doubt i have is that when i try to use pollevent, it gives me an error but when i use GetEvent it runs fine. Does this mean that this isn't actually 2.0 and maybe i should build 2.0 myself?

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Window not showing!!!
« Reply #11 on: December 17, 2011, 09:15:41 pm »
YES I FINALLY SOLVED IT!!!!!!!! Someone else had posted a workaround on this forum or something and the workaround was downloading this random dll from a website and putting it in my project directory.

http://www.kn00tcn.net/site/cities-in-motion-startup-crash-fix/


It finally showed up like normal!!However, i scanned this dll and it said no threat but can i be positive that its no threat? The dll is called "atigktxx.dll" . Will this change anything in my code or computer?

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
SFML Window not showing!!!
« Reply #12 on: December 18, 2011, 01:30:21 am »
Viruses, might not help, but do you use an ATI card? SFML 1.6 did have a problem with those cards.

Viruses

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
SFML Window not showing!!!
« Reply #13 on: December 18, 2011, 02:07:57 am »
Well, i went to dxdiag and i went to the device tab. It said " Name: Ati radeon"   and then some number so yea i guess i use ATI. But how would i fix it?

Tex Killer

  • Full Member
  • ***
  • Posts: 242
    • View Profile
SFML Window not showing!!!
« Reply #14 on: December 18, 2011, 03:28:24 am »
Just using SFML2 should be enough, I think.