For a long time I was secretive and paranoid about
source code and the like. I guess I felt like everything I had has value,
and its hard to just give away the good stuff. What really seems to
have changed my mind a bit is being involved in the quake community.
There is so much help among friends, and open source, and I really think
it helps everybody along. Today I'm putting up my directx 7, input,
error logging, and sound libraries. The source code is available by
request. I'll also post it here when I put in some comments and get
rid of anything embarassing laying around. Use it freely. My only requests
are make sure I get credit if its due, inform me of any errors, send
me some money if you make any using it (and a free copy of your app
or game :). If you distribute it, make sure all files are included.
Also, I take no responsibility for anything, use at your own risk.
DirectX 7 Input Library
The is the dx7 mouse, joystick, and keyboard
input library I developed and am using. Its loosely based on the
samples in the dx7 sdk, modified to combine the two input sources.
Probably only useful for those who don't want to bother with dinput,
or don't know much about it. Hopefully it will save you a little
time anyway. I also included some code tidbits on how its used.
DirectX 7 Sound Library
This is my DX7 3D sound library. I was really
happy how well and fast this turned out. I converted part of the
3d sound dxsdk sample to make a class based sound library. Probably
most useful code on the site atm. Loads and plays .wav and .mid
files. See my coding resources section for a link to the aureal
sound library. Its far better than mine, and handles mp3's. Will
definitely be the sound engine in the next project.
DirectX 7 3D Particle Class
This is my particle class. It takes a plane
in x-y (maybe normal pointing -z, I forget what I used.) and rotates
it so its always pointing at the camera. I use it for particles,
but its good for anything that always needs to point at the camera.
I draw a gradient sphere with alpha blending set in blend one
mode, z-writes off (i don't care about how they are depth sorted),
and fog color set to black. I may turn fog off in the demo file,
this is a hack, it can get really ugly putting blended polys in
fog. I have since learned that setting the fog color to black
is a better solution. If its requested I've updated the particle
class to go a bit faster. It could be ripped out of the engine
if there's any interest.
DirectX 7 Quake 3 Model Loader/Viewer
I haven't decided what exactly to do with this.
I wrote the code for an unannounced project in the works. Right
now it doesn't have a front end (you have to edit source to change
models and animations :). I'm not sure if I'll put a front end
on it for people to actually use it as a model viewer, or just
release the source for coders. Either way the source is messy
and not well commented, so by request only.
LOD (Level Of Detail) Triangle Generator
Generate static level of detail triangles to
cover up a height field. Not much to it, still in progress. Triangles
are set up generically so its not DX specific.
CSG (Computational Solid Geometry)
I've come up with an easy to understand way to
do boolean operators on solid geometries. I'm not especially well
read on the subject, but I couldn't find anything similar, so
maybe its a new algorithm. Its a series of trivial steps, ray-triangle
interesections. It compiles and runs perfectly in brainware and
paperware, I just need to port this to the PC.
There is an open source png texture library for
openGL that does downsampling for mips among other things. I haven't
used them yet, but png's can handle an alpha channel, and utilize
a lossless compression scheme. Converting this lib to DX is on
the to do list.
El Cheepo DX Error Logger
Tastes filling. Less great. This is nothing,
just a class that opens a file when it is constructed, writes
whatever you tell it to, and closes when its destructed. I will
be adding more error logging functionality sometime. I've updated
this to automatically close the file and reopen for every write,
I can upload on request. I've only had one person use this that
I know of so far though, so I won't unless I'm asked.
***UPDATE-I have a really nice DX8 version
of this. Contact me!!!***
Old Code Archives
Not especially useful, but a few little tidbits
(e.g. pathfinding/maze finding algo). These are on my personal
home page which is rarely updated now adays. Look in the code
section. Also, there's a lot of info here on project alpha (available
DX 7 Font Class
Uses t&l verts to put a collection of strings
on the screen. There is no documentation with this, but hopefully
its self explanatory. Its use is something like blah=newfont(),
then add the strings you want to add, then you can change strings
based on the indices returned by the add string. Only catch is
you must use smaller strings than the initial when you changestring.
The GAME * in there is just my game engine class that contains
things like pointers to the D3D device. If you can't figure it
out just yell at me.
This is version 7 of my DirectX 6 ddraw based
alpha blending library. I've moved to 3D so this project is permanently
suspended, but I still get a lot of requests for help on the subject.
The demo is from version 6 of library, and by popular request
the source for version 7 is in this zip. Who knows what changed
in between :). The library does blending, shadows, color replacement,
and all sorts of other stuff. There is more info on project alpha
in the old code archives listed above.
Source by Request!!!
These are all the resources I use in my coding
projects. Remember I'm a poor college student, so this is a lot
of the BEST shareware and cheepware around.