myrkos
|
  |
| Joined: 06 Sep 2010 |
| Total Posts: 8072 |
|
|
| 10 Apr 2012 09:21 AM |
sf::Event::Closed
And all the member functions of sf::Window start with upper case... |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 10 Apr 2012 09:27 AM |
@myrkos: what do we have to do with that? I typed it into VS, but it still keeps erroring the same. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 10 Apr 2012 09:33 AM |
>And all the member functions of sf::Window start with upper case...
It doesn't look like that; For example Window.getSize(); Doesn't give an error or fix it to Window.GetSize();
|
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
| |
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 10 Apr 2012 12:05 PM |
I think we might have outdated (Or updated from the tutorial vid :PP).. There's Window.IsOpen() But no Window.IsOpened() (And other stuff that doesn't equal with le vids)
And le vid used le window.isopened |
|
|
| Report Abuse |
|
|
miloguy
|
  |
| Joined: 19 Dec 2009 |
| Total Posts: 7702 |
|
|
| 10 Apr 2012 08:31 PM |
Here's the code for my SFML game called "Spaceship Amazing" (inside the
int main(){ RenderWindow window(VideoMode(WINDOW_WIDTH,WINDOW_HEIGHT),"Spaceship Amazing!");
BeginState(new MainScreen());
Clock clock;
while(Window_Displaying) { Event event; while(window.GetEvent(event)) { if(event.Type == Event::Closed) { Window_Displaying=false; break; } }
double dt=clock.GetElapsedTime(); game->Update(&window,dt); clock.Reset(); game->Draw(&window);
window.Display();
//sf::Sleep(1.0f/FPS); } }
"game" is an instance of a GameState class I made that has Update and Draw methods. The only problem I ever had was linking. I was going to make another game but I don't want to go through the whole setting-up process again, XNA is so much easier |
|
|
| Report Abuse |
|
|
myrkos
|
  |
| Joined: 06 Sep 2010 |
| Total Posts: 8072 |
|
|
| 10 Apr 2012 08:35 PM |
g++ yourfile.cpp game.o whatever.o shiz.o -lsfml-graphics -lsfml-window -lsfml-system -o game
done. Automate it with makefiles and you're ready. |
|
|
| Report Abuse |
|
|
miloguy
|
  |
| Joined: 19 Dec 2009 |
| Total Posts: 7702 |
|
| |
|
myrkos
|
  |
| Joined: 06 Sep 2010 |
| Total Posts: 8072 |
|
|
| 10 Apr 2012 11:59 PM |
| > Linux/OS X is itself an IDE |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 11 Apr 2012 07:50 AM |
@miloguy
This: window.GetEvent(event)
Gives an error that getevent doesn't exist
|
|
|
| Report Abuse |
|
|
miloguy
|
  |
| Joined: 19 Dec 2009 |
| Total Posts: 7702 |
|
|
| 11 Apr 2012 12:28 PM |
Maybe I'm using a different version of SFML or something. I assume the capitalization is correct and that the window object exists |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 11 Apr 2012 12:36 PM |
| What version are you using? |
|
|
| Report Abuse |
|
|
miloguy
|
  |
| Joined: 19 Dec 2009 |
| Total Posts: 7702 |
|
| |
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 11 Apr 2012 12:39 PM |
| Le derp we're using Version 2.0 =_= |
|
|
| Report Abuse |
|
|