Epica Winamp Plugin|
I'd like to submit the code for "Epica," a Winamp visualization plugin
that I wrote (available at Winamp's website -- the URL is at the bottom
of this). The source code has been available for some time now (since
August 2001) but I figured that it would be worth a shot to spotlight it
Along with the source for Epica is my uber-library called "GabX." The
name doesn't really mean anything, so don't worry about that. It
includes many items of interest to game and graphics programmers:
High-level interfaces for input, sound, graphics all using DirectX.
Input capabilities include mouse, keyboard (polled AND buffered), and
joystick (not perfect, but works well enough). I've written the
libraries with usability in mind ... you can write code that initializes
and uses the keyboard with less than a handful of lines of code (that
is, less than 10). Sorry, no 3D ... at least, not finished. You can
pretty much disregard GGraph3D, GOpenGL, and GWDirect3D8 unfortunately.
A full 2D graphics library for drawing simple primitives (lines,
circles) and full 2D sprite manipulation, the important parts of which
are written in assembler that uses MMX, SSE, 3DNow, etc. Whatever you
have (no SSE2 support). Alpha blending, masked blits, additive blending
(saturated) ... it's all there for the most part. The entire library is
based off working with surfaces (GImage) objects and is very flexible --
you can create surfaces that reference rectangular regions within other
surfaces (sub-images, Gimage::GetSubImage). Very helpful for clipping
and other purposes. All surfaces are 32-bit BGRA format, including the
framebuffer. What's convenient is that you can set the display to 16-bit
format while still drawing to your framebuffer in 32-bit ... the pixels
are downsampled at refresh time. Windowed mode is supported as well, in
16- and 32-bits per pixel.
There's a GUI system that renders itself to GImage surfaces.
Function guarding, including an unwind mechanism to obtain a function
call stack trace (if you've seen Unreal crash, you know what I mean ...
heck, I adopted it from their publicily available sources!)
TrueType font rendering to the built in 2D surface class (GImage).
This is based on the FreeType library.
CPU speed and feature detection up through the Pentium 4 (but not
including the Athlon XP ... that's an exercise for you to implement :)
Templated vector and matrix classes. The base "pixel" class
(GColorRGBA) is based off this, so you can actually work with "pixels"
just like vectors! The precision is, of course, limited to 8-bits per
component. There are vector templates available in 2-wide, 3-wide, and
4-wide (the traditional). There is also an SSE vector class for the
4-wide version (GVector4fSSE) and this can be used to instantiate an SSE
matrix class, which is predefined for convenience (GMatrix4fSSE).
There's some other miscellaneous stuff as well. The code isn't perfect,
but it's pretty good for its size (about 38,000 lines total, not
including FreeType and the mp3 library I used) and the time I spent on
it (20 months on and off).
You can download the plugin from Winamp's website here.
There are some weird comments ("user opinions") on there, and one or two
rude ones. Oh well.
A direct link to the source code):
The source code may be used under the terms stated at
www.wsu.edu/~rolo/Epica.html. To summarize: It's GPL'd, and the
libraries that it uses may have other terms and you must abide by those
terms as well. If someone wants to use this in a way that would go past
what the GPL allows, please e-mail me! I have no plans to charge anyone
any money for this.
Oh yeah, no documentation. But if you're really interested you can ask
me for help or examples.
The zip file viewer built into the Developer Toolbox made use
of the zlib library, as well as the zlibdll source additions.