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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jean_Bob

Pages: [1]
1
General / Pure Virtual Function call
« on: June 15, 2009, 10:53:45 pm »
I think it's 3.4.5

2
General / Pure Virtual Function call
« on: June 15, 2009, 02:44:18 pm »
When i close the window.


3
General / Pure Virtual Function call
« on: June 15, 2009, 02:00:50 pm »
Program received signal SIGSEGV, Segmentation fault.
In ig4icd32!DrvSetContext () (C:\Windows\system32\ig4icd32.dll)

the debuger show me that but i dont know how i can solve the problem

4
General / Pure Virtual Function call
« on: June 15, 2009, 03:02:47 am »
Anyone can explain me why I have this error when i execute the result of this code?



Code: [Select]

/* Player.h*/
class Player
{
    public:
    /* Constructeur */
        Player(int r_numero = 1);

    /* Accesseur */
        const sf::Sprite& Player::getSprite();

    private:

    /* Atributs */
        int numero;
        sf::Image image;
        sf::Sprite sprite;
};

/* Playe.cpp */
Player::Player(int r_numero) : numero(r_numero)
{
    image.LoadFromFile("bar.bmp");

    sprite.SetImage(image);
    sprite.SetPosition(200, 100);
}

const sf::Sprite& Player::getSprite()
{
    return sprite;
}


Code: [Select]

/*balle.h */

class Balle
{
    public:
    /* Constructeur */
        Balle();

    /* Accesseur */
        const sf::Sprite& Balle::getSprite();

    private:
    /* Atributs */
        sf::Image image;
        sf::Sprite sprite;
};

/*balle.h*/

#include "balle.h"

Balle::Balle()
{
    image.LoadFromFile("balle.png");

    sprite.SetImage(image);
    sprite.SetPosition(400, 300);
}

const sf::Sprite& Balle::getSprite()
{
    return sprite;
}


Code: [Select]

/* main.cpp */
#include <iostream>

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

#include "Player.h"
#include "balle.h"

int main()
{
    sf::RenderWindow App(sf::VideoMode(900, 575), "Pong!");
    App.SetFramerateLimit(60);
    sf::Event Event;

    sf::Image imgFond;
    imgFond.LoadFromFile("fond.png");
    sf::Sprite fond;
    fond.SetImage(imgFond);
    fond.SetPosition(0,0);

    Player player1(1);
    Balle balle;

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

        if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
            App.Close();
    }

    App.Clear();
    App.Draw(fond);
    App.Draw( player1.getSprite() );
    App.Draw( balle.getSprite() );
    App.Display();

}
return EXIT_SUCCESS;
}

Pages: [1]