Pixie - Installing Visual Studio and DirectX SDK

(1/2) > >>

Mattias Gustavsson:
Pixie - Installing Visual Studio and DirectX SDK

As I mentioned in the Hello World tutorial the other day, there's certain things you need to do in order to get your Pixie programs to compile and run. Today, I'll go through the whole process, and I'll be doing it in more detail than is probably needed - but I think it's better to do it that way, then to miss some essential bit out which someone would have really liked me to cover.

Ok, so there's four main things we'll be covering:
Downloading and installing Visual C++ Express 2008Downloading and installing the DirectX SDKPointing Visual C++ to the location of the DirectX SDKLoading and building Pixie and the "Hello World" sample
Downloading and installing Visual C++ Express 2008
Microsoft supplies the "express" editions of Visual C++ for free. The express editions produce exactly the same results as the professional editions, and there's no restrictions on how you can use programs you make with it (it's perfectly ok to sell them, for example). The difference from the professional editions is that you can't use third-party plugins, not all the extra tools and utilities are included, and things like that. But you don't need those anyway, so it's a good choice to go with the express edition.

You can download Visual C++ Express 2008 here: http://www.microsoft.com/express/vc/



I would have provided a direct link if I could - but apparently they thought it was necessary to have some custom button to start the download - but who knows why?

This will download an installation program, which will in turn download everything needed to install Visual C++. When you launch it, it looks like this:

Just go Next here - we don't really need to help Microsoft...



Indicate that you've accepted the license agreement - you can even read it before you do.



We don't need Silverlight (it's got nothing to do with Visual C++ anyway, it is just something they want to bundle in whereever they can) and we're not going to be using any SQL stuff, so just go Next here.



I usually go for the default install location - doesn't really matter where you put it, so just go Install >



And now we wait... depending on your web connection, this might take a while, so go read a blog or something while you're waiting...



Thought we were almost done? Nope, now it will install the stuff you've downloaded. Again, this will take some time, so go play a  game or something while you're waiting...



Yay, all done. It says here that you should register, but you don't have to do it straight away. But after 30 days, it will require you to register (or it won't start Visual C++ until you do).


Downloading and installing the DirectX SDK
Next, we need to download the DirectX Software Development Kit, which is also available free from Microsoft. Game made with Pixie doesn't require DirectX to run - they run fine on computers with no DirectX installation whatsoever - but it does require DirectX SDK in order to compile Pixie programs.

You can download the DirectX SDK here: http://www.microsoft.com/downloads/details.aspx?FamilyID=b66e14b8-8505-4b17-bf80-edb2df5abad4

It doesn't really matter which version, so we might as well go for the latest one.


Again, there's a download button rather than a regular link  ::)

When you launch it, it looks like this:

Launch screen, just go Next...



Accept agreement and go Next...



Select No (we don't need to help Microsoft) and go Next...



I usually just go with the default settings - just hit Next...



Wait for the actual installation to be done ...



Yay, all done with the DirectX SDK installation too...



Pointing Visual C++ to the location of the DirectX SDK
Now that both Visual Studio and the DirectX SDK have been installed, we need to let Visual Studio know that the DirectX SDK exists, and where it is located.


So, start by launching Visual C++ from the Start-menu.



Once it is loaded, go to the Tools->Options menu.



There's a lot of options you can configure in Visual Studio, but the one we're interested in is under the Projects and Solutions category.



More specifically, it's the "VC++ Directories" settings we want.



In the top-right corner of the window, we need to change the "Show directories for:" setting to "Include files"



Which should display a screen something like this.



Add a new line to the settings, and enter the path to the DirectX SDK Include directory, as pictured above. If you installed to a location other than the default, you need to modify the path you enter here.



Next, change the "Show directories for:" setting to "Library files".



Add add a new line here as well, where you enter the path to the DirectX SDK Lib/x86 directory (again, modifying the path if you didn't install to the default location).

When you're done, you just click OK at the bottom of the window, and we're all done: now you can happily compile DirectX applications, including Pixie programs.



Loading and building Pixie and the "Hello World" sample
So, we're now ready to load up a Pixie project, compile it and run it. To do this, you must download the latest version of Pixie:

Download Pixie v0.9c

which includes the "Hello World" sample program. Unzip the files to somewhere: you'll end up with two folders, a PixieLib folder and a Sample1_HelloWorld folder.



To load the "Hello World" sample, go to the File->Open->Project/Solution... menu.



Navigate to where you unzipped the Pixie files to. We don't need to load the PixieLib project, as the HelloWorld sample will automatically load it for us.



Open the Sample1_HelloWorld folder, and select the solution file, HelloWorld.sln



When you load one of my Pixie projects in Visual C++ 2008, you will usually get the Conversion Wizard, which will help you convert the project from the Visual C++ 2003 version (which I use) to the 2008 version. I guess this extra step can be a bit annoying, but by doing it this way, I'm making Pixie available for users of more different Visual Studio versions. And the process is automatic anyway. Just hit Next (or Finish straight away, so you don't have to go through the following step).



I usually choose to make a backup, just in case something goes wrong - but I haven't had that happen to me so far...



Now we're ready to convert - hit Finish.



You can have a look at the log if you like, but it's mostly just saying that everything went well (and also goes on about things they have changed in Visual C++ recently).



Now we should have both projects loaded, "HelloWorld" and "PixieLib". Go to the Build->Build Solution menu - this will compile Pixie and the HelloWorld sample, and it will take a little bit of time the first time round - but shouldn't be too bad.



Once the build is completed (it should report no errors or warnings), you can select the Debug->Start Debugging menu option, and this will launch the program. Hit Esc or Alt+F4 to terminate it and come back to Visual Studio.





That's it. A lot more handholding than you needed, I'm sure, but just skim past the more obvious bits, and make use of the ones that help. And if you have any problems at all getting this to work, please let me know and I'll help you get it sorted out. And it'd be good to hear from those who do get it to work too :)

/Mattias

kbar:
For other Pixie and Visual C++ newbies like me...

Just tried Pixie in Visual C++ 2008 Express, it looks really promising. However when I first tried the BouncingBall sample the original project files converted OK and it built without problem but refused to run from the IDE - couldn't find the .png files.

So, after an hour or so's hair pulling and pointless debugging of the library (!) I discovered you have to set the working directory (where the .exe file lives) in the Project Properties Debugging section, as otherwise VC++ assumes the working directory is that containing the project files. Do this for both Debug and Release profiles.

Richard Marks:
Thanks kbar for pointing that out.

I was going to do so myself, but it slipped my mind.
Welcome to NOGDUS btw.

Mattias Gustavsson:
Ah, yes, I should have said! Sorry about that, and thanks for pointing this out!

bedndarc:
There was version 10 С++, the addition circuit dll has varied! Can it is necessary to add a manual and for the new version?

Navigation

[0] Message Index

[#] Next page