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 - fatum

Pages: 1 2 3 [4]
46
General / Passing "App" to my class's constructor? (solved!)
« on: August 21, 2011, 06:46:37 am »
Inside of my player.h file:
Code: [Select]

class Player
{
private:
sf::RenderWindow App;
                ...
        //
        public:
Player(sf::RenderWindow App);
...
//
};


Inside of my player.cpp file:
Code: [Select]

Player::Player(sf::RenderWindow getApp)
{
App = getApp;
        ...
}


Inside of my main.cpp file:
Code: [Select]

int main(int argc, char** argv)
{
sf::RenderWindow App(sf::VideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP), "Hey There!");

Player player(App);
...
}


However, a large amount of issues are reported:
Code: [Select]

In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Window.hpp:40:0,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:32,
                 from player.h:1,
                 from player.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp: In member function 'sf::Window& sf::Window::operator=(const sf::Window&)'
:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp:79:18: error: 'sf::NonCopyable& sf::NonCopyable::operator=(const sf::NonCo
pyable&)' is private
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Window/Window.hpp
:57:1: error: within this context
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:39:0,
                 from player.h:1,
                 from player.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderWi
ndow.hpp: In member function 'sf::RenderWindow& sf::RenderWindow::operator=(cons
t sf::RenderWindow&)':
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderWi
ndow.hpp:44:1: note: synthesized method 'sf::Window& sf::Window::operator=(const
 sf::Window&)' first required here
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics/RenderTexture.hpp:32:0,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:38,
                 from player.h:1,
                 from player.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp: In member function 'sf::RenderTarget& sf::RenderTarget::operator=(const s
f::RenderTarget&)':
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp:79:18: error: 'sf::NonCopyable& sf::NonCopyable::operator=(const sf::NonCo
pyable&)' is private
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderTa
rget.hpp:48:1: error: within this context
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:37:0,
                 from player.h:1,
                 from player.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp: In member function 'sf::Renderer& sf::Renderer::operator=(const sf::Rende
rer&)':
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp:79:18: error: 'sf::NonCopyable& sf::NonCopyable::operator=(const sf::NonCo
pyable&)' is private
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/Renderer
.hpp:49:1: error: within this context
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/Renderer
.hpp:49:1: error: non-static reference member 'sf::RenderTarget& sf::Renderer::m
yTarget', can't use default assignment operator
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics/RenderTexture.hpp:32:0,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:38,
                 from player.h:1,
                 from player.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderTa
rget.hpp: In member function 'sf::RenderTarget& sf::RenderTarget::operator=(cons
t sf::RenderTarget&)':
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderTa
rget.hpp:48:1: note: synthesized method 'sf::Renderer& sf::Renderer::operator=(c
onst sf::Renderer&)' first required here
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:39:0,
                 from player.h:1,
                 from player.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderWi
ndow.hpp: In member function 'sf::RenderWindow& sf::RenderWindow::operator=(cons
t sf::RenderWindow&)':
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderWi
ndow.hpp:44:1: note: synthesized method 'sf::RenderTarget& sf::RenderTarget::ope
rator=(const sf::RenderTarget&)' first required here
player.cpp: In constructor 'Player::Player(sf::RenderWindow)':
player.cpp:5:8: note: synthesized method 'sf::RenderWindow& sf::RenderWindow::op
erator=(const sf::RenderWindow&)' first required here
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Window.hpp:40:0,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:32,
                 from main.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp: In copy constructor 'sf::Window::Window(const sf::Window&)':
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp:67:5: error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is pri
vate
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Window/Window.hpp
:57:1: error: within this context
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:39:0,
                 from main.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderWi
ndow.hpp: In copy constructor 'sf::RenderWindow::RenderWindow(const sf::RenderWi
ndow&)':
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderWi
ndow.hpp:44:1: note: synthesized method 'sf::Window::Window(const sf::Window&)'
first required here
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics/RenderTexture.hpp:32:0,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:38,
                 from main.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp: In copy constructor 'sf::RenderTarget::RenderTarget(const sf::RenderTarge
t&)':
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp:67:5: error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is pri
vate
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderTa
rget.hpp:48:1: error: within this context
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:37:0,
                 from main.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp: In copy constructor 'sf::Renderer::Renderer(const sf::Renderer&)':
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/System/NonCopyabl
e.hpp:67:5: error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is pri
vate
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/Renderer
.hpp:49:1: error: within this context
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics/RenderTexture.hpp:32:0,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:38,
                 from main.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderTa
rget.hpp: In copy constructor 'sf::RenderTarget::RenderTarget(const sf::RenderTa
rget&)':
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderTa
rget.hpp:48:1: note: synthesized method 'sf::Renderer::Renderer(const sf::Render
er&)' first required here
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/
SFML/Graphics.hpp:39:0,
                 from main.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderWi
ndow.hpp: In copy constructor 'sf::RenderWindow::RenderWindow(const sf::RenderWi
ndow&)':
c:\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/SFML/Graphics/RenderWi
ndow.hpp:44:1: note: synthesized method 'sf::RenderTarget::RenderTarget(const sf
::RenderTarget&)' first required here
main.cpp: In function 'int main(int, char**)':
main.cpp:26:19: note: synthesized method 'sf::RenderWindow::RenderWindow(const s
f::RenderWindow&)' first required here
main.cpp:26:19: error:   initializing argument 1 of 'Player::Player(sf::RenderWi
ndow)'


What could the issue be?  Thanks for any assistance!

Also, the ... symbolizes that I took out pieces of irrelevant code.

47
Graphics / Nothing is displayed?
« on: August 20, 2011, 11:23:26 pm »
I have this bit here:

Code: [Select]

#include "SFML/Graphics.hpp"

int main(int argc, char** argv)
{
sf::RenderWindow App(sf::VideoMode(550, 400, 32), "Testing!");

while (App.IsOpened() == true)
{
sf::Event event;
while (App.GetEvent(event))
{
switch (event.Type)
{
case sf::Event::Closed:
App.Close();
break;
}
}

App.Clear();

App.Display();
}

return EXIT_SUCCESS;
}


I'm compiling with:
Code: [Select]

g++ -o program main.cpp -lsfml-graphics -lsfml-window


Whenever I attempt to open "program" from the CLI, nothing is opened!  I read that 1.6 doesn't work with ATI graphics cards, however I'm able to view all of the precompiled examples in the "samples" directory.  I have an nVidia GPU on my desktop, I'll give that a shot too.

Thanks for any help!

Pages: 1 2 3 [4]
anything