The following changes were tested against building with a master copy.
For a more detailed report, please read the followings below:
The flags that were checked were the ones checked by default + the following:
ASSIMP_BUILD_ASSIMP_VIEW
ASSIMP_BUILD_SAMPLES
The list of compilable projects in Visual Studio were the following:
- assimp
- assimp_cmd
- assimp_simpleogl
- assimp_simpletextureddirectx11
- assimp_simpletexturedogl
- assimp_viewer
- INSTALL
- IrrXML
- uninstall
- unit
- UpdateAssimpLibsDebugSymbolsAndDLLs
- ZERO_CHECK
- zlib
- zlibstatic
The solution that was generated with the new changes comprised the same number of projects as the one from the master, unmodified. All projects except UpdateAssimpLibsDebugSymbolsAndDLLs were built without any error. All tests were run.
UpdateAssimpLibsDebugSymbolsAndDLLs could not be built because of the reasons explained in issue #3004.
- Added function "cleanup" to centralize release of resources.
- Added function "freeTextureIds" to free textureIds memory.
- Added call to freeTextureIds in LoadGLTextures to free memory before it is allocated again.
- Made several changes in KillGLWindow to prevent certain Win32 handle/resources
from being released more than once.
Several places in the sample's code were calling Unicode versions of Win32 functions with "multibyte" strings. A few changes were required to fix it.
I added a class "UTFConverter", which handles calls to unicode/multibyte string conversions. This should help minimize the impacts on code change in case C++'s codecvt_utf8 ever changes.
In addition, seveal memory leaks have been found, but these fixes will come in another PR because it goes beyond the scope of this PR.
DevIL.lib was removed in CMakeFiles.txt, as it is unused in the sample.
Here is a list of the changes:
- Fixed MB string calls to Unicode functions.
- Added class UTFConverter to handle string conversions.
- Removed reference to DevIL.lib.
- Fixed compile warnings.
- fix unhandled exception with sample SimpleTexturedOpenGL #308
- remove commented code, which made no sense any more.
Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>
Currently, the path to the model in the sample is hardcoded. Allow the user
to provide a model path via the command line for the sample, and remove a few
redundant comments.