Click on File -> New project, select C++ -> WIN32 console application.
Then select console application and empty project, click finish.
Remove from the newly created project any Xaml file or any precompiled pch.h/pch.cpp header, if they exist.
You shall have now an empty project, as empty as possible (If you target is USES_WINDOWS8_METRO
,
keep the temporary key file, the appxmanifest file, and the Asset folder).
Add a new existing item -> Include all files in include/, in source/, and in source/directx/
Add a new item -> C++ file -> Name: "MainClass.cpp".
Copy/paste in this new source file the source code of one of the two tutorials.
Adjust in this source code the lines:
#include "../../include/[...]"to find the file in the "include" directory.
Open the project properties (Click right project -> Properties or Alt+F7).
See which dependancies are needed, depending of your target (see).
Setup the additional preprocessor definitions:
USES_WINDOWS_OPENGL | USES_WINDOWS8_DESKTOP | USES_WINDOWS8_METRO |
USES_WINDOWS_OPENGL;_WINSOCK_DEPRECATED_NO_WARNINGS; |
USES_WINDOWS8_DESKTOP;_WINSOCK_DEPRECATED_NO_WARNINGS; |
USES_WINDOWS8_METRO;_WINSOCK_DEPRECATED_NO_WARNINGS; |
Setup the include directories:
USES_WINDOWS_OPENGL | USES_WINDOWS8_DESKTOP | USES_WINDOWS8_METRO |
path_to\GnuWin32\include; path_to\OpenAL 1.1 SDK\include; path_to\misc\include; %(AdditionalIncludeDirectories) |
path_to\GnuWin32\include; path_to\OpenAL 1.1 SDK\include; path_to\misc\include; %(AdditionalIncludeDirectories) |
Nothing to put here |
Setup the libraries:
USES_WINDOWS_OPENGL | USES_WINDOWS8_DESKTOP | USES_WINDOWS8_METRO |
path_to\misc\lib; path_to\GnuWin32\lib; path_to\OpenAL 1.1 SDK\libs\Win32; |
path_to\misc\lib; path_to\GnuWin32\lib; path_to\OpenAL 1.1 SDK\libs\Win32; |
Nothing to put here |
Setup the using references if they are not already set:
USES_WINDOWS_OPENGL | USES_WINDOWS8_DESKTOP | USES_WINDOWS8_METRO |
Nothing to put here |
path_to\Microsoft Visual Studio 12.0\VC\vcpackages; path_to\Program Files %28x86%29\Windows Kits\8.1\References\CommonConfiguration\Neutral; %(AdditionalUsingDirectories) |
Nothing to put here |
Setup the libraries:
USES_WINDOWS_OPENGL | USES_WINDOWS8_DESKTOP | USES_WINDOWS8_METRO |
opengl32.lib glu32.lib libpng.lib pthreadVC2.lib path_to\OpenAL 1.1 SDK\libs\Win32\OpenAL32.lib" WSock32.Lib libxml2.lib libiconv.lib zlib.lib alut.lib glew32.lib libvorbis_static.lib libvorbisfile_static.lib libogg_static.lib XInput.lib |
d2d1.lib d3d11.lib dxgi.lib ole32.lib windowscodecs.lib dwrite.lib xaudio2.lib mfcore.lib mfplat.lib mfreadwrite.lib pthreadVC2.lib libxml2.lib zlib.lib libiconv.lib WSock32.Lib XInput.lib |
d2d1.lib d3d11.lib dxgi.lib ole32.lib windowscodecs.lib xaudio2.lib mfcore.lib mfplat.lib mfreadwrite.lib shell32.lib XInput.lib |
Set Enable Minimal Rebuild: No
USES_WINDOWS_OPENGL
.
Add a new existing item -> Include all *.hlsl files in shaders/
Set up properties of the pixel shader -> Set shader type Pixel Shader
Do the same with the vertex shader, set its shader type to Vertex Shader.
Open the project properties (Click right project -> Properties or Alt+F7). In HLSL compiler parameters, change the path of the output shader files into a subfolder "shaders" in the working directory:
USES_WINDOWS8_DESKTOP | USES_WINDOWS8_METRO |
..\WorkDir\shaders\%(Filename).cso |
$(OutDir)\shaders\%(Filename).cso |
Add the data files (like default_font.png) in the ..\WorkDir folder.
Note: if your target is USES_WINDOWS8_METRO
, copy these data files
in the folder Debug\ProjectName\AppX\ instead.
If your target is USES_WINDOWS_OPENGL
, copy the *.glsl shaders files from
shaders/.
Copy all the DLL related to the needed libraries in the ..\WorkDir folder.
For USES_WINDOWS_OPENGL, this should be:
alut.dll, freeglut.dl, glew32.dll, iconv.dll, libxml2.dll, OpenAL32.dll, pthreadGC2.dll, pthreadVC2.dll, wrap_oal.dll, zlib1.dll
That should work now! Press F5.