Building using the VS2005 project
by Nate Gertsch · in iTorque 2D · 09/09/2009 (8:50 pm) · 10 replies
I have an iphone game that I'd like to get running on the PC but I'm having problems getting it to work using the visual studio project provided. I can load up the T2D solutation on my windows computer (using Visual C++ 2008 express + windows XP) and get everything to compile but I can't seem to figure out how to add the game/common folders to the project like I would do for the mac project using Xcode. In xcode, I'd just right click on resources and "add existing files" but I can't seem to add folders like that under visual studio. I've tried creating folders and then right clicking and chosing "include in project" but that doesn't seem to have any effect as I always get a "failed to open 'main.cs" error when I try to run the project when I'm sure that the main.cs file is there.
Has anyone else had success with creating a PC build using the visual studio project?
Has anyone else had success with creating a PC build using the visual studio project?
#2
09/09/2009 (9:40 pm)
Sure you don't mix XCode_iPhone and XCode (the later is the only thing you can do on windows. iPhone development requires OSX 10.5.7+ etc)
#3
09/10/2009 (4:37 am)
Quote:and a text editor to write the TorqueScript files.You do not write the code in Visual Studio?
#4
I use Torsion on Windows and BBEdit on the Mac for TorqueScript.
09/10/2009 (12:30 pm)
You can write your TorqueScript in VS, but it will constantly try to use C# highlighting and you will still have to exec them in-engine to create the DSO's.I use Torsion on Windows and BBEdit on the Mac for TorqueScript.
#5
If so, I guess I'm not sure how to build the executable using TGB. I can create a project and add all the levels and script files again but it doesn't seem to create something I can use to start the game outside of TGB. My limited understanding was that when I clicked run in TGB, it was really just modifying the TGBgame project and running that so I thought I could add all the files I needed to TGBgame. At least that approach worked on the mac Xcode project.
Of course it hasn't helped that editor has been acting up recently so I haven't been using the gui interface for the last bit of development. I could probably straighten out what's wrong with the editor eventually but it would help significantly if there was a way to make a PC build without using the editor.
09/10/2009 (3:03 pm)
Thanks for your help David but I'm not quite sure I understand. Are you saying that the visual studio project is only supposed to be used create the exes for the editor (and should only be modified if you're making changes to the editor) and that TGB should be used to create the executable for the PC?If so, I guess I'm not sure how to build the executable using TGB. I can create a project and add all the levels and script files again but it doesn't seem to create something I can use to start the game outside of TGB. My limited understanding was that when I clicked run in TGB, it was really just modifying the TGBgame project and running that so I thought I could add all the files I needed to TGBgame. At least that approach worked on the mac Xcode project.
Of course it hasn't helped that editor has been acting up recently so I haven't been using the gui interface for the last bit of development. I could probably straighten out what's wrong with the editor eventually but it would help significantly if there was a way to make a PC build without using the editor.
#6
09/10/2009 (3:38 pm)
Or maybe I'm just blind and overlooked "Build Project" under the file menu in TBG 1.7.4. This looks like it works for a quick test project and I think I just need to include some engine modifications I made and I might be able to get it run properly on my real game.
#7
09/10/2009 (4:40 pm)
Well I got it to build so that's a success I suppose but I'm getting lots of "could not load this GL function: SomeGLFunctionHere" when it tries to compile the common guis when I try to run the game I built. What makes this weird is that it works perfectly fine if I build another project and it's only the one I want to build that has this GL function issues. I did modify some files in the engine folder but I'd think that'd cause a problem for all my projects if it was the cause.
#8
09/10/2009 (5:59 pm)
So I talked to the programmer who worked on this last and it turns out he has a special method for getting it to build so I followed his directions and everything is fine. At least now, I know how to do a PC build for a normal project.
#10
He had a modified version of the VS 2005 project which I used. I think the extent of his modifications was changing the output directory and the name of the executable but there might have been some more changes that I missed. To get it to compile, I had to include to add the paths for the windows SDK and change _WIN32_WINNT from 0x0400 to 0x0501 in platformWin32.h. I believe those are standard changes one has to do in order to get the VS2005 project to compile. Once I made these changes, I could build and have it output my exe to a folder on the desktop and I then copy/pasted the main.cs + game/common folders into that folder and everything started working.
It looks like this boils down to me manually doing the same thing as the build project commend in iTGB. If you build TGBgame and then stick all the files your game needs with the resulting exe then I would imagine it would work for any game.
09/11/2009 (2:00 pm)
Quote: can you share this with us?
He had a modified version of the VS 2005 project which I used. I think the extent of his modifications was changing the output directory and the name of the executable but there might have been some more changes that I missed. To get it to compile, I had to include to add the paths for the windows SDK and change _WIN32_WINNT from 0x0400 to 0x0501 in platformWin32.h. I believe those are standard changes one has to do in order to get the VS2005 project to compile. Once I made these changes, I could build and have it output my exe to a folder on the desktop and I then copy/pasted the main.cs + game/common folders into that folder and everything started working.
It looks like this boils down to me manually doing the same thing as the build project commend in iTGB. If you build TGBgame and then stick all the files your game needs with the resulting exe then I would imagine it would work for any game.
Associate David Montgomery-Blake
David MontgomeryBlake