TrueVision3D:Tutorials:A Simple way to make stand-alone redistributable packages

From GPWiki

Files:GUITutorial_warn.gif The Game Programming Wiki has moved! Files:GUITutorial_warn.gif

The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server.

However, the GPWiki forums are still active! Come say hello.

A Simple way to make stand-alone packages with Truevision 3D

Author: Twisted Matrix (camos85_NOSPAM_@gmail.com)

Overview

Q: What is TV3D?

A: Truevision 3D is a commercial 3D game API that is well rounded, fast, and quite cheap. In fact TV3D is perhaps the cheapest game API that is out there except for maybe OGRE, Crystal Space, and NeL, which are open source/free. :)

Q: Why did you write this article?

A: I have noticed that a lot of people are having problems getting their redistributable game demos working. The aim of this tutorial is to teach you how to fix your executable (exe) and TV3D library working on other peoples computers.

Q: Are there any issues in legality?

A: There is a thread on this topic here, but as far as i can tell, the answer is no.

Q: Is there any limit to your extreme awesomeness?

A: No.

So why won't my TV3D project work on my mom's computer?

Good question son. The TV3D SDK is composed of a small set of DLL files. But I know what you're thinking. "Even if I copy all the DLL's into the program folder it still won't run!" Well, the answer is quite simple really. TV3D needs to be registered in Windows' Registry. Why did microsoft make the name of their OS plural anyway? When you have to pronounce the OS in the plural, it makes it 2 plurals. If you actually say "windowses" it makes you sound like an idiot. When i make my "100 reasons to hate Microsoft" article, remind me to include that.

Anyways, sorry about the rant. I have had an attention deficit disorder since i was a kid. So moving forward, here is my solution. I wrote a simple loader module for use in my TV projects. It just registers the DLL's and calls your main module.

Private Sub main()
      Shell "regsvr32 /s truevision3d.dll"
      Shell "regsvr32 /s tvmedia.dll"
      Shell "regsvr32 /s tvutil62.dll"
End Sub

You could also include all of your library and game initialization code here and display a nice splash screen or loading window or something. To get this thing running you will also need to make sure you include all of the VB and TV3D runtimes DLL's with your package. (Its usually easiest if you put them in the same folder as your exe.) You will need to include the following files:

  comcat.dll
  oleaut32.dll
  stdole2.tlb
  tvmedia.dll
  asyfilt.dll
  dx8vb.dll
  msvbvm.dll
  olepro32.dll
  truevision3d.dll
  tvutil62.dll