VS 2013/VS 2015 - LimeOats Cavestory++ Tutorial - SDL2 woes with Visual Studio
This is a multi-part series since I'm also developing the LimeOats Cavestory++ tutorial at the same time with CLion, OSX 10.11.3, homebrew, CMakeLists.txt. Currently flipping back and forth from VS IDE to CLion IDE and learning a lot about C++/Header Files/Symbols/Includes etc. I must say that overall, VS 2013/2015 is a lot easier to work with than manually creating my CMake build script for CLion to correctly find my dependencies.
I have had to search over the internet and have spent countless hours on stackoverflow trying to figure everything out, for now this is a placeholder so I can remember all the shit I did in VS 2015. Will be updating with screenshots, because VS is a lot more Visual than most other IDE's.
I have to give much credit to Lazy Foo, without the guide he has setup, it would have been a lot harder to configure Visual Studio 2013 and Visual Studio 2015 with SDL2 and SDL2_image.
http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvsnet2010u/index.php
Additional Dependencies -
I have had to search over the internet and have spent countless hours on stackoverflow trying to figure everything out, for now this is a placeholder so I can remember all the shit I did in VS 2015. Will be updating with screenshots, because VS is a lot more Visual than most other IDE's.
I have to give much credit to Lazy Foo, without the guide he has setup, it would have been a lot harder to configure Visual Studio 2013 and Visual Studio 2015 with SDL2 and SDL2_image.
http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvsnet2010u/index.php
Additional Dependencies -
Searching through the /r/LimeOats sub-reddit, some people utilizing VS 2015 Community found this issue, which I did as well. The compiler will throw a LINK error referencing this message, error LNK1561: entry point must be defined. This seems to be an issue only seen on Visual Studio 2013/2015, in main.cpp you have to add this following statement before "int main," #undef main. It seems SDL pre-loads an entry point when compiling the libraries, if someone knows how to explain this issue better than I can, please leave a comment. By writing #undef main, right before OUR main, then it bypasses this issue and you can get on with your life.
In game.cpp we had some logic with a pointer updating the time, in OSX this didn't cause an issue because for some reason clang or g++ resolved it on it's own, in VS 2013/2015, we need to include a reference to #include <algorithm> or else we will throw error C2039 : 'min': is not a member of 'std'. Below the code std::min is highlighted in red.
this->update(std::min(ELAPSED_TIME_MS, MAX_FRAME_TIME));
Another issue that I found was with the sprite MyChar.png, when utilizing Adobe Photoshop, I embedded an ICC Profile accidentally because of a checkmark on File->Save As->PNG, this in turn was causing libPNG to throw a warning of "libpng warning: iCCP: known incorrect sRGB profile." There's a screen capture that shows you the option here, http://users.wfu.edu/yipcw/atg/adobe/cs4/pscs4/embedicc/, there's a little checkbox when doing File->Save As, you basically want to strip the ICC Profile from the image. You can also utilize PNGCrush on Windows, Linux, and OSX (OSX also has a Remove.app script).
Check back often as this blog post will be updated with anything else that I find.
Comments
Post a Comment