1
General / Re: 2D RPG
« on: January 25, 2014, 11:30:30 pm »
I wanted to expand my programm to implement your code, but an error appeared..
Error(translation):
gui.h
gui.cpp
menu.h
menu.cpp
element.h
button.h
button.cpp
Error(translation):
Quote
1>------ Constructing started: Project: 2D RPG, Configuration: Debug Win32 ------
1>The building process was started 25.01.2014 23:07:11.
1>InitializeBuildStatus:
1> Updating the timestamp of "Debug\2D RPG.unsuccessfulbuild".
1>ClCompile:
1> menu.cpp
1>c:\sfml\include\sfml\window\window.hpp(477): error C2248: "sf::NonCopyable::operator =": No access to private members, which declaration is done in sf::NonCopyable-Class.
1> c:\sfml\include\sfml\system\noncopyable.hpp(79): See declaration of 'sf::NonCopyable::operator ='
1> c:\sfml\include\sfml\system\noncopyable.hpp(42): See declaration of 'sf::NonCopyable'
1> This diagnostic occurred in the compiler generated function "sf::Window &sf::Window::operator =(const sf::Window &)".
1>c:\sfml\include\sfml\graphics\rendertarget.hpp(419): error C2248: "sf::NonCopyable::operator =": No access to private members, which declaration is done in sf::NonCopyable-Class.
1> c:\sfml\include\sfml\system\noncopyable.hpp(79): See declaration of 'sf::NonCopyable::operator ='
1> c:\sfml\include\sfml\system\noncopyable.hpp(42): See declaration of 'sf::NonCopyable'
1> This diagnostic occurred in the compiler generated function "sf::RenderTarget &sf::RenderTarget::operator =(const sf::RenderTarget &)".
1> gui.cpp
1>c:\sfml\include\sfml\window\window.hpp(477): error C2248: "sf::NonCopyable::operator =": No access to private members, which declaration is done in sf::NonCopyable-Class.
1> c:\sfml\include\sfml\system\noncopyable.hpp(79): See declaration of 'sf::NonCopyable::operator ='
1> c:\sfml\include\sfml\system\noncopyable.hpp(42): See declaration of 'sf::NonCopyable'
1> This diagnostic occurred in the compiler generated function "sf::Window &sf::Window::operator =(const sf::Window &)".
1>c:\sfml\include\sfml\graphics\rendertarget.hpp(419): error C2248: "sf::NonCopyable::operator =": No access to private members, which declaration is done in sf::NonCopyable-Class.
1> c:\sfml\include\sfml\system\noncopyable.hpp(79): See declaration of 'sf::NonCopyable::operator ='
1> c:\sfml\include\sfml\system\noncopyable.hpp(42): See declaration of 'sf::NonCopyable'
1> This diagnostic occurred in the compiler generated function "sf::RenderTarget &sf::RenderTarget::operator =(const sf::RenderTarget &)".
1> button.cpp
1> Code is generated...
1>
1>Failed to create
1>
1>Elapsed time 00:00:01.93
========== Create: 0 successful, Skipped error at 1, 0 current, 0 skipped ==========
gui.h
//==========================================================//
// CLASS: GUI //
// DESC: Manages GUI //
//==========================================================//
#ifndef __GUI_H__
#define __GUI_H__
//=================================
// included dependencies
#include "menu.h"
#include <SFML/Graphics.hpp>
//=================================
// class
class GUI
{
public:
GUI(); // Constructor
~GUI(); // Destructor
sf::RenderWindow window; // Needed to display graphics
enum menus { main, game, options, credits }; // Enum of menus
void Initialize(sf::RenderWindow _window); // Initialize
void LoadContent(); // Loading the needed content
void UnloadContent(); // Unload all content
void Update(sf::Time elapsedTime, sf::Event event); // Check Events
void Draw(sf::Time elapsedTime); // Redraw screen
};
#endif // __GUI_H__
// CLASS: GUI //
// DESC: Manages GUI //
//==========================================================//
#ifndef __GUI_H__
#define __GUI_H__
//=================================
// included dependencies
#include "menu.h"
#include <SFML/Graphics.hpp>
//=================================
// class
class GUI
{
public:
GUI(); // Constructor
~GUI(); // Destructor
sf::RenderWindow window; // Needed to display graphics
enum menus { main, game, options, credits }; // Enum of menus
void Initialize(sf::RenderWindow _window); // Initialize
void LoadContent(); // Loading the needed content
void UnloadContent(); // Unload all content
void Update(sf::Time elapsedTime, sf::Event event); // Check Events
void Draw(sf::Time elapsedTime); // Redraw screen
};
#endif // __GUI_H__
gui.cpp
#include "gui.h"
GUI::GUI()
{
}
GUI::~GUI()
{
}
void GUI::Initialize(sf::RenderWindow _window)
{
window = _window;
}
void GUI::LoadContent()
{
}
void GUI::UnloadContent()
{
}
void GUI::Update(sf::Time elapsedTime, sf::Event event)
{
}
void GUI::Draw(sf::Time elapsedTime)
{
window.clear();
window.display();
}
GUI::GUI()
{
}
GUI::~GUI()
{
}
void GUI::Initialize(sf::RenderWindow _window)
{
window = _window;
}
void GUI::LoadContent()
{
}
void GUI::UnloadContent()
{
}
void GUI::Update(sf::Time elapsedTime, sf::Event event)
{
}
void GUI::Draw(sf::Time elapsedTime)
{
window.clear();
window.display();
}
menu.h
//==========================================================//
// CLASS: MENU //
// DESC: Menu prototype //
//==========================================================//
#ifndef __MENU_H__
#define __MENU_H__
//=================================
// included dependencies
#include <SFML/Graphics.hpp>
//=================================
// class
class Menu
{
public:
Menu(); // Constructor
~Menu(); // Destructor
sf::RenderWindow window; // Needed to display graphics
void Initialize(sf::RenderWindow _window); // Initialize
void LoadContent(); // Loading the needed content
void UnloadContent(); // Unload all content
void Update(sf::Time elapsedTime, sf::Event event); // Check Events
void Draw(sf::Time elapsedTime); // Redraw screen
};
#endif // __MENU_H__
// CLASS: MENU //
// DESC: Menu prototype //
//==========================================================//
#ifndef __MENU_H__
#define __MENU_H__
//=================================
// included dependencies
#include <SFML/Graphics.hpp>
//=================================
// class
class Menu
{
public:
Menu(); // Constructor
~Menu(); // Destructor
sf::RenderWindow window; // Needed to display graphics
void Initialize(sf::RenderWindow _window); // Initialize
void LoadContent(); // Loading the needed content
void UnloadContent(); // Unload all content
void Update(sf::Time elapsedTime, sf::Event event); // Check Events
void Draw(sf::Time elapsedTime); // Redraw screen
};
#endif // __MENU_H__
menu.cpp
#include "menu.h"
Menu::Menu()
{
}
Menu::~Menu()
{
}
void Menu::Initialize(sf::RenderWindow _window)
{
window = _window;
}
void Menu::LoadContent()
{
}
void Menu::UnloadContent()
{
}
void Menu::Update(sf::Time elapsedTime, sf::Event event)
{
}
void Menu::Draw(sf::Time elapsedTime)
{
}
Menu::Menu()
{
}
Menu::~Menu()
{
}
void Menu::Initialize(sf::RenderWindow _window)
{
window = _window;
}
void Menu::LoadContent()
{
}
void Menu::UnloadContent()
{
}
void Menu::Update(sf::Time elapsedTime, sf::Event event)
{
}
void Menu::Draw(sf::Time elapsedTime)
{
}
element.h
//==========================================================//
// CLASS: ELEMENT //
// DESC: Base class for all UI Elements (e.g. Button) //
//==========================================================//
#ifndef __ELEMENT_H__
#define __ELEMENT_H__
//=================================
// included dependencies
#include <SFML/Graphics.hpp>
//=================================
// class
class Element
{
public:
sf::RenderWindow window; // Needed to display graphics
virtual void Initialize(sf::RenderWindow _window); // Initialize
virtual void LoadContent(); // Loading the needed content
virtual void UnloadContent(); // Unload all content
virtual void Update(sf::Time elapsedTime, sf::Event event); // Check Events
virtual void Draw(sf::Time elapsedTime); // Redraw screen
};
#endif // __ELEMENT_H__
// CLASS: ELEMENT //
// DESC: Base class for all UI Elements (e.g. Button) //
//==========================================================//
#ifndef __ELEMENT_H__
#define __ELEMENT_H__
//=================================
// included dependencies
#include <SFML/Graphics.hpp>
//=================================
// class
class Element
{
public:
sf::RenderWindow window; // Needed to display graphics
virtual void Initialize(sf::RenderWindow _window); // Initialize
virtual void LoadContent(); // Loading the needed content
virtual void UnloadContent(); // Unload all content
virtual void Update(sf::Time elapsedTime, sf::Event event); // Check Events
virtual void Draw(sf::Time elapsedTime); // Redraw screen
};
#endif // __ELEMENT_H__
button.h
//==========================================================//
// CLASS: GUI //
// DESC: Manages GUI //
//==========================================================//
#ifndef __BUTTON_H__
#define __BUTTON_H__
//=================================
// included dependencies
#include "element.h"
//=================================
// class
class Button : public Element
{
public:
Button(); // Constructor
~Button(); // Destructor
void Initialize(); // Initialize
void LoadContent(); // Loading the needed content
void UnloadContent(); // Unload all content
void Update(sf::Time elapsedTime, sf::Event event); // Check Events
void Draw(sf::Time elapsedTime); // Redraw screen
private:
};
#endif // __BUTTON_H__
// CLASS: GUI //
// DESC: Manages GUI //
//==========================================================//
#ifndef __BUTTON_H__
#define __BUTTON_H__
//=================================
// included dependencies
#include "element.h"
//=================================
// class
class Button : public Element
{
public:
Button(); // Constructor
~Button(); // Destructor
void Initialize(); // Initialize
void LoadContent(); // Loading the needed content
void UnloadContent(); // Unload all content
void Update(sf::Time elapsedTime, sf::Event event); // Check Events
void Draw(sf::Time elapsedTime); // Redraw screen
private:
};
#endif // __BUTTON_H__
button.cpp
#include "button.h"
Button::Button()
{
}
Button::~Button()
{
}
void Button::Initialize()
{
}
void Button::LoadContent()
{
}
void Button::UnloadContent()
{
}
void Button::Update(sf::Time elapsedTime, sf::Event event)
{
}
void Button::Draw(sf::Time elapsedTime)
{
}
Button::Button()
{
}
Button::~Button()
{
}
void Button::Initialize()
{
}
void Button::LoadContent()
{
}
void Button::UnloadContent()
{
}
void Button::Update(sf::Time elapsedTime, sf::Event event)
{
}
void Button::Draw(sf::Time elapsedTime)
{
}