Horde3D

Next-Generation Graphics Engine
It is currently 19.04.2024, 22:43

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 17.01.2008, 05:54 
Offline

Joined: 16.01.2008, 00:24
Posts: 73
Location: Canada/Quebec
For those who don't know what is SFML, it is a portable library like the SDL but it is build with OpenGL so its a lot more faster than the SDL to create 2D games!

It can be an alternative to the SDL to show horde 3D. Personally, I use this library because I found it a lot easier to use than the SDL and it support a lot of thing like network, audio, multithread and soon a GUI.

Ive made an exemple wich you are free to use:

Download here

This exemple is the knight exemple wich work exactly like ine SDL exemple ( WASD to move, F1: full screen, etc. ). The "app" class remain exactly the same but the main one is changed to use SFML. The project was made in Visual studio with the windows libraries, and all path are relative. If you want to compile the example, you must right click on "Horde-SFML" in the Solution Explorer, and then left click on "Build". To execute it, go to the release dirctory and execute the executable named "Horde-SFML.exe".

Ive added all SFML libraries in the project, but in this exemple, it only use two wich are the "sfml-main.lib" and "sfml-window.lib". You can't compile in debug mode in this project.

I don't know if there are a FPS difference between SDL and SFML with horde, but its surely not noticeable.

If you want more information about SFML, you can click here


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 17.01.2008, 07:35 
Offline

Joined: 19.11.2007, 19:35
Posts: 218
I'm have no idea what you mean with SFML being built with OpenGL while SDL is not.

Playing around with your demo there appear to be some issues with SFML's input handling code. Try moving back and forth, could just be me, but stuttering on a 3.5ghz Pentium D with 4gb ram and an 8800GTX can't be good.

Also try hitting CTRL+ALT+DELETE and see what happens to your input. It's thoroughly broken for me.

There's also an overall framerate drop.

80 to 90 percent processor usage with SFML vs. 30-50% with SDL.

But all of this could be caused by either your code or SFML not being multi-core friendly. Or it could be me.

SFML's audio capabilities are more complete than SDL's though and look worthy of being torn out for independent use.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 17.01.2008, 14:25 
Offline

Joined: 16.01.2008, 00:24
Posts: 73
Location: Canada/Quebec
O mean that SFML use OpenGL for his rendering system while SDL not. It's why its more quickly if you want to make 2D game with SFML( it has been tested : link ) Maybe I'm wrong, but it's what ive heard.

For the framerate drop, I cant say since SDL exemple is limited to 60 FPS on my PC while SFML is not.

For the input, I don't have time to check this now, but it work well for me.

Does everyone who have tried this exemple have the same problems?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 17.01.2008, 21:31 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Thanks for the port, it is nice to see the Horde samples working with SFML. When we made the engine cross-platform compatible my first idea was to use this library. But although it claims to be leightweight the size of the lib files was still quite large. So we opted for SDL. Well, due to some problems with SDL the next version of Horde will run on GLFW. I tested it on Linux today and everything works very well. Furthermore GLFW is quite a bit smaller than SDL, e.g. it just requires one header file insterad of twenty or so ;)


Top
 Profile  
Reply with quote  
PostPosted: 11.07.2009, 16:37 
Offline

Joined: 11.07.2009, 16:33
Posts: 2
I'm interested in using SFML with Horde3D but I can't find any useful tips where to start. That example link proviced by micmacer doesn't work.

If anybody has anything useful for a beginner, I would appreciate.


Top
 Profile  
Reply with quote  
PostPosted: 12.07.2009, 08:45 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
I haven't seen Mikmacer around for some time but maybe you can try to pm him and ask if he still has the code.


Top
 Profile  
Reply with quote  
PostPosted: 12.07.2009, 19:06 
Offline

Joined: 16.01.2008, 00:24
Posts: 73
Location: Canada/Quebec
I don't have this example anymore, but it is not something really hard to do. All you need is the OpenGL context given by SFML, and you have an example of this here : http://www.sfml-dev.org/tutorials/1.5/window-opengl.php . Instead of using openGL to draw something, you can call the horde3D drawing function wich will handle opengl calls for you.


Top
 Profile  
Reply with quote  
PostPosted: 12.07.2009, 19:07 
Offline

Joined: 11.07.2009, 16:33
Posts: 2
ok.. I'll try.. ;)


Top
 Profile  
Reply with quote  
PostPosted: 19.08.2011, 21:19 
Offline

Joined: 07.11.2009, 16:07
Posts: 5
I rewrote the main.cpp of the Chicago sample with SFML instead of GLFW.
Note that some of the key input code is a bit of a kludge to play nicely with the sample application code.

You can find the sample at the community wiki.

Hope this helps some of the others stumbling onto this post like I did.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group