1
General discussions / Benchmark : SDL vs SFML
« on: January 16, 2010, 08:37:36 pm »Quote
SFML is faster than SDL, so this benchmark proves that. I don't care about software or hardware. It's just SFML > SDL. No more.
this.
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.
SFML is faster than SDL, so this benchmark proves that. I don't care about software or hardware. It's just SFML > SDL. No more.
Instead of a separate thread you can also set your socket to non-blocking and check for data at every loop cycle.
However using a separate thread has some benefits. So if you're not scared of using one, try it.
Listen Function isn't a blocking one? If so you need one thread to listen to new clients call and one to send/receive data to/from the clients.nah, the server is working fine! i mean the client where i have to loop the game and also recieve data from server
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
using namespace std;
using namespace sf;
RenderWindow App;
Ftp server;
int main()
{
return EXIT_SUCCESS;
}
Code: [Select]Event Event;
One of the main reasons NOT to import namespaces...
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
using namespace std;
using namespace sf;
Ftp Server;
RenderWindow App;
int main()
{
App.Create(VideoMode(800, 600, 32), "SFML Window");
App.SetFramerateLimit(60);
while (App.IsOpened())
{
Event Event;
while (App.GetEvent(Event))
{
// Window closed
if (Event.Type == Event::Closed)
App.Close();
// Escape key pressed
if ((Event.Type == Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
}
App.Display();
}
return EXIT_SUCCESS;
}