SFML community forums
Help => General => Topic started by: Paki Programmer on January 26, 2012, 11:22:45 pm
-
Ive looked around on other forums and this one and i think im certain that im trying to copy the sf::RenderWindow window that i made for my game engine...and according to what i've found that's not possible. I suppose i have to make a pointer to the window or a reference but since im still fairly rusty with programming (haven't used C++ for a while) i dont know how to go about doing this. Here are the two parts of my code i think are causing the trouble. Any idea how i can go about creating a reference or pointer to the render window ?
sf::RenderWindow System::SetWindow(int width, int height, std::string title)
{
sf::RenderWindow *ref = new sf::RenderWindow();
sf::RenderWindow w(sf::VideoMode(width, height), title.c_str());
ref = &w;
return *ref;
}
void System::Init()
{
engine = new System();
window = new sf::RenderWindow();
engine -> window = &engine -> SetWindow(800, 600, "Test");
}
And also here is the error i keep getting:
Error 1 error C2248: 'sf::NonCopyable::NonCopyable' : cannot access private member declared in class 'sf::NonCopyable' c:\program files\sfml 2.0\include\sfml\window\window.hpp 479
Error 2 error C2248: 'sf::NonCopyable::NonCopyable' : cannot access private member declared in class 'sf::NonCopyable' c:\program files\sfml 2.0\include\sfml\graphics\rendertarget.hpp 304
-
never mind guys i managed to fix it :)
-
Can you give an explanation of your fix for future users who might find this topic?