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

Pages: 1 2 3 [4]
46
General / Trouble understanding SFML
« on: December 29, 2009, 01:00:44 am »
Since I'm one of the people switching from Allegro to SFML I'm just having a bit of trouble understanding how to correctly use the API (my brain is stuck to think in the way that works for Allegro).  My main problem right now is not knowing where to correctly use sf::Event, sf:: Input, and sf::RenderWindow.  Like if I have a separate function for my games main menu, another function for the options screen, and another function for the actual game itself do I need to create a whole new set of Event, Input, and RenderWindow classes for each function?  Example:

Code: [Select]
void main_menu_loop()
{
// New RenderWindow?
// New Input?
// New Event?

/*
The main menu loop.
*/
}

 int main()
{
RenderWindow Screen(VideoMode(800, 600, 32), "DUEL", Style::Close);
const Input & iInput = Screen.GetInput();
Event eEvent;

main_menu_loop();
while(Screen.IsOpened())
{
//Main game loop
}
return 0;
}


And another thing...  is there a way to quickly output numbers to the screen?  sf::String doesn't work with integers (atleast it won't for me).

-Thanks in advance.

47
SFML projects / Short n Sweet 2D Space Shooter Action
« on: December 28, 2009, 11:52:09 pm »
Heh I changed the txt file containing the level info and made it hard as hell. :D

Could we get the source?  I'd like to see how you did all of this.

48
Graphics / Displaying Numbers
« on: December 12, 2009, 08:07:13 am »
Alright thanks.

49
Graphics / Displaying Numbers
« on: December 12, 2009, 05:47:42 am »
Just a quick question... How would I go about displaying variables like int, float, double, etc.

This won't work: sf::String Player1Score(iScore, Font, 50);

Is there some separate function for displaying numbers instead of a string of text or do I have to manually convert the integer into a string before displaying it each time?

Thanks in advance.

Pages: 1 2 3 [4]
anything