- Reverted stb_image.h changes to prevent future merge conflicts.
- Added #pragma warning before and after stb_image header to disable and enable 'unreferenced formal parameter' warning.
- Removed OpenGL/Glut references in SimpleTexturedDirectX11 CMakeFile
- Moved UTFConverter from SimpleTexturedOpenGL to its own file to be able to reuse it.
- Added compile definition SHADER_PATH to allow to locate the shader files in CMakeFile
- Fixed compile warnings
- Made global pointers null to help prevent dangling references.
- Added missing members initialization in class constructors.
- Removed references to missing model "Models/mymodel.fbx"
- Fixed error when extracting model file directory
- Added missing device context assignment in ModelLoader Load method
- Fixed memory leak caused by variable 'ourModel' not deleted.
- Removed call to dev->Release() in ModelLoader.cpp
- Adjusted Release() calls in reverse order when cleaning up D3D
- Made Throwanerror implementation throw an error instead of displaying a message box
- Fixed leaking D3D resources
- Added a pointer to an ID3D11Debug to dump live objects.
- 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.