4 Replies - 302 Views - Last Post: 18 April 2013 - 07:48 PM Rate Topic: -----

#1 makeitloud  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 64
  • Joined: 08-April 13

2d platformer

Posted 17 April 2013 - 11:39 PM

hello, im using codeblocks and im trying to follow a tutorial on it on youtube, but im getting some errors and i cannot find out what it is
this is my error
error: prototype for 'void GameScreen::Draw();' does not match any in class 'GameScreen'

#include "GameScreen.h"

GameScreen::GameScreen()
{
    //ctor
}

GameScreen::~GameScreen()
{
    //dtor
}

void GameScreen::LoadContent()
{

}
void GameScreen::UnloadContent()
{

}
void GameScreen::Update()
{

}
void GameScreen::Draw()
{

}



and my second error is
error:candidate is: virtual void GameScreen::Draw(sf::RenderWindow&)

#ifndef GAMESCREEN_H
#define GAMESCREEN_H

#include <SFML/Graphics.hpp>

class GameScreen
{
    public:
        GameScreen();
        ~GameScreen();

     virtual void LoadContent();
     virtual void UnloadContent();
     virtual void Update();
     virtual void Draw(sf::RenderWindow &Window);

    protected:
    private:
};

#endif // GAMESCREEN_H



Is This A Good Question/Topic? 0
  • +

Replies To: 2d platformer

#2 makeitloud  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 64
  • Joined: 08-April 13

Re: 2d platformer

Posted 17 April 2013 - 11:48 PM

error:candidate is: virtual void GameScreen::Draw(sf::RenderWindow &Window);
Was This Post Helpful? 0
  • +
  • -

#3 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 999
  • View blog
  • Posts: 4,175
  • Joined: 14-February 08

Re: 2d platformer

Posted 18 April 2013 - 01:57 AM

Spot the difference between this declaration:

virtual void Draw(sf::RenderWindow &Window);



And this definition:

void GameScreen::Draw()
{
}


Was This Post Helpful? 1
  • +
  • -

#4 makeitloud  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 64
  • Joined: 08-April 13

Re: 2d platformer

Posted 18 April 2013 - 10:13 AM

sorry dude im still new to all this, i still dont see the difference
Was This Post Helpful? 0
  • +
  • -

#5 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: 2d platformer

Posted 18 April 2013 - 07:48 PM

You need to learn C++, and don't touch games yet. You've opened multiple threads expecting people to teach you and it's not going to happen.

You've basically confused overloading with overriding here. Please don't ask me to explain, because you won't understand me.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1