We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Unify the codes for desktop
Unify the codes for desktop
More information:
- http://stackoverflow.com/questions/5736421/sdl-versus-glfw
- http://gamedev.stackexchange.com/questions/32595/freeglut-vs-sdl-vs-glfw
Another alternative is:
- sfml: ( http://www.sfml-dev.org/ )
GLFW seems to be the more lightweight (something that we care about)
And this URL shows how to use SDL, SFML and GLFW:
http://open.gl/context
On Windows, SDL2 as dynamic library takes 800 KB for x86 and 1MB for x64. Static library is about 100KB, because SDLmain and SDLtest will be not used in cocos2dx anyway. Full distribution with headers, dynamic and static lib is ~5 MB. So there are no real advantages of lesser size of GLFW: it just have lesser features.
On the other hand, SDL2 used in Valve games, fixes real disadvantages of SDL 1.2 like not working global hotkeys in fullscreen windows on Linux, adds support for multiple mouses and touches (touches support is useful if it works with OSX ClickPad).
Qt5 has a quite big size (a few megabytes for each module) and LGPL license does not allow easy static linking; it does not affect nor development neither Ubuntu distribution, but distributing games on OSX and Windows will hurt.
Iām ready to implement unified backend for SDL2 or GLFW and test it on Windows 7, OSX 10.8, Ubuntu 13.10.
**Using GLFW instead of SDL is better for our projects:
1. GLFW is more lightweight than SDL, and its main focus is windows handling and openGL context wrapping.The functions in GLFW are very useful in our engine. SDL has too much function, lots of which are overlapping with our engine.
2. The GLFW has more clear header files. When SDL has a long list of include file, GLFW has only two files.
As far as I know, SDL is also ok for unify the desktop code. But GLFW may be more suitable for our situation.
Can someone give more suggestions? Any reply about this is appreciated!
**
Status: | Closed | |
---|---|---|
Start date: | 2013-08-01 | |
Priority: | High | |
Due date: | ||
Assignee: | dabingnn | |
% Done: | 100% |
|
Category: | linux, mac, windows | |
Target version: | 3.0-alpha0 |
We should decide to use GLFW v3 or SDL2 v2 to simplify the code for desktop.