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

Author Topic: Call to draw() crashes program.  (Read 2828 times)

0 Members and 1 Guest are viewing this topic.

Christopher Jozwiak

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Blog
    • Email
Call to draw() crashes program.
« on: May 01, 2015, 04:05:24 am »
I am attempting to compile a very simple program with SFML.  Any attempt to draw a simple sf::RectangleShape results in a crash.  I have compiled SFML 2 using mingw-gcc 4.8.1 and can compile it perfectly fine without a draw call.  I have an outdated system and am on windows 7 and my GFX Card doesnt only had drivers for XP.  I have those installed.  I'm assuming this is the core of the problem but wanted another opinion. 

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

#define Window_Height 800
#define Window_Width 600



int main(){

    sf::RenderWindow window(sf::VideoMode(Window_Height, Window_Width), "First SFML Game");
    sf::RectangleShape arrofshape[10];
    sf::RectangleShape shape;
    bool draw = 1;
    for (int i; i < 10; i++){
        arrofshape[i].setFillColor(sf::Color::Red);
        arrofshape[i].setScale(sf::Vector2f(10,10));
    }

    while (window.isOpen()){

        sf::Event event;

        while(window.pollEvent(event)){

            if (event.type == event.Closed){
                window.close();
            }
        }

    window.clear(sf::Color::Black);

    window.display();

    }




    return 0;
}
 
Noob C++ Programmer.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Call to draw() crashes program.
« Reply #1 on: May 01, 2015, 04:09:00 am »
What is your GPU model and what's the driver version?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Christopher Jozwiak

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Blog
    • Email
Re: Call to draw() crashes program.
« Reply #2 on: May 01, 2015, 04:16:42 am »
What is your GPU model and what's the driver version?

Intel(R) 82865G Graphics Controller

Driver Version: 6.14.10.4363

Some more info:

DirectX* Version:      9.0
Physical Memory:      1527 MB
Minimum Graphics Memory:   8 MB
Maximum Graphics Memory:   96 MB
Graphics Memory in Use:   8 MB
Processor:      x86
Processor Speed:      2793 MHZ
Noob C++ Programmer.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Call to draw() crashes program.
« Reply #3 on: May 01, 2015, 09:53:32 am »
You have 3 (or 4) options:
  • Try your luck installing driver 14.17 by zip or by exe
  • Try Intel Driver Update Utility and hope it does something useful
  • Build and use the latest and greatest version (master revision from GitHub) of SFML that will manage to put up with your ancient hardware without crashing horribly
  • BONUS: Just install Linux on that thing, I don't know how you manage to stay sane running Windows 7 on such old hardware
The choice is yours.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

lorence30

  • Full Member
  • ***
  • Posts: 124
    • View Profile
    • Email
Re: Call to draw() crashes program.
« Reply #4 on: May 07, 2015, 02:21:19 pm »
http://en.sfml-dev.org/forums/index.php?topic=18094.15
You can read this thread.

But you should try first their solutions
« Last Edit: May 07, 2015, 02:23:13 pm by lorence30 »