So I’ve finally sat down and started working with the Oculus SDK.
Bad news is that I’ve gotta do a lot of this in Visual Studio… which I haven’t used in quite a while. That means I get to learn a bunch and take a bunch of notes.
The good news is that the development world has gotten a bit better since I last used VS and now I’ve got a few more libraries available to help me along.
The first on the list is the Valve Steamworks API. This is The Way to get content into Steam. As well, they’ve implemented a few VR specific API calls that will let you determine if an HMD is plugged in when the game launches (via Steam of course).
So, I took the time to do a bit of learning about VS to get dll’s, lib’s, and header files all playing nice.
Few tricks though…
One, the solutions properties window is where you’ll need to set include/compiler and linker paths. Include paths go here:
C/C++>General>"Additional Include Directories"Linker paths go here:
Linker>General>"Additional Library Directories"And Linker Inputs (the name of the lib files themselves such as steam_api.lib) go here:
Linker>Input>"Additional Dependencies"Two, the Steamworks API isn’t using strcpy_s() but strcpy(). That means VS complains about security issues. So you have to add the following under:
C/C++>Preprocessor>"Preprocessor Definitions":
_CRT_SECURE_NO_WARNINGSAnd three, since the final executable needs to have access to the dll file, you’ll need to put any dll’s in the project directory (next to main.cpp) and use a “Post-Build Event” to copy the dll’s to the Build Directory. You can get to that section here:
"Build Events">"Post-Build Event">"Command Line"And then add something that looks like this as the command to run:
copy /Y "$(ProjectDir)steam_api.dll" "$(OutDir)"Don’t forget the quotes. And make sure you check for something like “1 file(s) copied.” in the build output. If you’re having issues getting the script correct, put “echo” at the beginning of the command, apply the settings, clean and build the app, and check the build output to see what the expanded paths are.
Maybe I’ll put a small hello world app up on GitHub so people can follow along… If I don’t, and you’ve got questions, ask and maybe I can help.
Moving right along!
