HUGS in VS 2015

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
Xenox
Posts: 4
Joined: January 16th, 2015, 7:17 pm

HUGS in VS 2015

Post by Xenox » August 8th, 2016, 4:56 pm

Hello forum!

I was configuring the HUGS code to work with Visual Studio 2015 yesterday and it took me "a lot of time" to make it works. So I decided to post here, what I've changed for all these who want to watch the series and use VS2015.

First thing if we want to compile the code from lessons before 16th episode, you need to change all vectors and one set with const Type. The easiest way to do it is to click Edit->Find and replace->Replace in Files and replace all "vector < const" with "vector < " and "set < const" with "set < ".

Next if you want to compile the lessons after adding sound. You need to have DirectX SDK and put the directory to xaudio.h in Sound.h. For example:

Code: Select all

#include "C:\Program Files(x86)\Microsoft DirectX SDK (June 2010)\Include\xaudio2.h"
Another thing to change is Direct Input. You need to add following lines to Dinput.h in Public part of Class Event:

Code: Select all

Event( const Event& e )
    :
    type( e.type ),
    index( e.index ),
    pos( e.pos )
{}
Event& operator=( const Event& e )
{
    type = e.type;
    index = e.index;
    pos = e.pos;
    return *this;
}
The problem was with an anonymous union inside class event, so we need to write a copy constructor by ourselves. If you have any problems with compiling HUGS, post it here. In next days (or weeks) I will push working versions of all branches on GitHub and the DirectX SDK won't be necessary anymore.

User avatar
LuisR14
Posts: 1248
Joined: May 23rd, 2013, 3:52 pm
Location: USA
Contact:

Re: HUGS in VS 2015

Post by LuisR14 » August 8th, 2016, 7:05 pm

Xenox wrote: Next if you want to compile the lessons after adding sound. You need to have DirectX SDK and put the directory to xaudio.h in Sound.h. For example:

Code: Select all

#include "C:\Program Files(x86)\Microsoft DirectX SDK (June 2010)\Include\xaudio2.h"
lol, you don't need to install DirectX SDK for that, winsdk in vs15 already contains that file (basicly dxsdk has been merged into winsdk for some time now)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat :mrgreen: --

Xenox
Posts: 4
Joined: January 16th, 2015, 7:17 pm

Re: HUGS in VS 2015

Post by Xenox » August 8th, 2016, 7:12 pm

You are right, but I had an error with that, because I still have Windows 7.

Code: Select all

This version of XAudio2 is available only in Windows 8 or later. Use the XAudio2 headers and libraries from the DirectX SDK with applications that target Windows 7 and earlier versions.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: HUGS in VS 2015

Post by chili » August 9th, 2016, 12:12 am

Xenox is correct. You need DirectX SDK if you want to target Windows 7. Actually, the problem is not that you have Windows 7, it's that you are targeting Windows 7 (considering it's the most common OS, you definitely don't want to ignore it and target Win 8). I have made a package that contains only the files from the DXSDK needed to build XAudio2.
Chili

Post Reply