TA3D 0.7 Qt5 port progress
Posted: Tue Apr 04, 2017 9:33 pm
This thread will be dedicated to the progress of the ongoing port to Qt5. The first changes are quite visible (many dependencies have been removed and Qt5 is the only big dependency left) but because lots of code still rely on OpenGL API, very few parts of the code are running through the Qt5 OpenGL wrapper. This wrapper is the key to portability.
This is the list of dependencies which have been removed from the 0.7 branch:
- Yuni was completely removed and replaced with functions from Qt (the VFS module which used lots of functions from the file system API was converted to the QIODevice, QDir and QFile interfaces)
- SDL (and its child libraries such as SDL_image, SDL_net, SDL_mixer, smpeg) which is basically replaced with Qt5
- SDL_mixer has no equivalent in Qt5 so I had to write a Qt5 based mixer but music is not implemented yet
- SDL_net is replaced with Qt5Network, however it is still largely untested
- SDL_sgui is not used any more, we rely on Qt for warning, error, critical messages, and the configuration interface
- smpeg (used for optional intro video) code is commented out (so intro video won't work for now)
- GLEW is not needed anymore since we use Qt5OpenGL module as a replacement
- FTGL has been replaced with a basic renderer which uses a wrapper above QFont to generate glyph textures (should also make embedding fonts useless because we can use system fonts now)
a few things still have to be removed:
- GLU which is used only for OpenGL 1.x legacy matrix stack helper functions. This is to be replaced with a QMatrix4x4 based stack which will interact with shaders.
big changes have been made to key components:
- strings are stored as QString objects (which uses wide chars, not UTF8)
- textures are no more stored as GLuint handles but as smart pointers to an object (basically an QOpenGLTexture)
- images were stored in SDL_Surface structs, now we use QImage objects, several drawing functions had to be rewritten
- smart pointers use a custom implementation which relies on an embedded reference counter (safer if we have to pass values as weak pointers, for instance in a Lua/script context, and it uses only 1 pointer instead of 2)
- many regular pointers were replaced with smart pointers
- regular threads are implemented on top of QThread
- OpenMP was replaced with parallel loops implemented on top of QThreadPool (which I hope to use to replace all threads which are not dedicated to asynchronous work)
The Qt5 port is not finished yet, but it mostly works so feel free to test it.
This is the list of dependencies which have been removed from the 0.7 branch:
- Yuni was completely removed and replaced with functions from Qt (the VFS module which used lots of functions from the file system API was converted to the QIODevice, QDir and QFile interfaces)
- SDL (and its child libraries such as SDL_image, SDL_net, SDL_mixer, smpeg) which is basically replaced with Qt5
- SDL_mixer has no equivalent in Qt5 so I had to write a Qt5 based mixer but music is not implemented yet
- SDL_net is replaced with Qt5Network, however it is still largely untested
- SDL_sgui is not used any more, we rely on Qt for warning, error, critical messages, and the configuration interface
- smpeg (used for optional intro video) code is commented out (so intro video won't work for now)
- GLEW is not needed anymore since we use Qt5OpenGL module as a replacement
- FTGL has been replaced with a basic renderer which uses a wrapper above QFont to generate glyph textures (should also make embedding fonts useless because we can use system fonts now)
a few things still have to be removed:
- GLU which is used only for OpenGL 1.x legacy matrix stack helper functions. This is to be replaced with a QMatrix4x4 based stack which will interact with shaders.
big changes have been made to key components:
- strings are stored as QString objects (which uses wide chars, not UTF8)
- textures are no more stored as GLuint handles but as smart pointers to an object (basically an QOpenGLTexture)
- images were stored in SDL_Surface structs, now we use QImage objects, several drawing functions had to be rewritten
- smart pointers use a custom implementation which relies on an embedded reference counter (safer if we have to pass values as weak pointers, for instance in a Lua/script context, and it uses only 1 pointer instead of 2)
- many regular pointers were replaced with smart pointers
- regular threads are implemented on top of QThread
- OpenMP was replaced with parallel loops implemented on top of QThreadPool (which I hope to use to replace all threads which are not dedicated to asynchronous work)
The Qt5 port is not finished yet, but it mostly works so feel free to test it.