It now takes a context pointer (opaque data) that holds the buffers it
uses for the temporary strings. If the context pointer is null, a static
context is used (making those uses of va NOT thread-safe). Most calls to
va use the static context, but all such calls have been formatted
consistently so they are easy to find when it comes time to do a full
audit.
The static variable meant that Fog_GetColor was not thread-safe (though
multiple calls in the one thread look to be ok for now). However, this
change takes it one step closer to being more generally usable.
Patch found in an old stash.
Again, based on The OpenGL Shader Wrangler. The wrangling part is not used
yet, but the shader compiler has been modified to take the built up shader.
Just to keep things compiling, a wrapper has been temporarily created.
The seed is currently 0xdeadbeef, but I intend on fixing that soon. Now the
particle velocities and origins use fully independent bits (though a big
chunk is wasted right now).
This is a quick fix until I get a random number generator into QF.
Mingw's RAND_MAX is only 0x7fff and so the (((rnd >> 10) & 63) - 31.5) / 63.0
used for the z component of origin and velocity would never go positive.
For now, change the 10 to 9 (reusing another bit from Y). I plan on
implementing a full 32-bit PRNG in QF so we always have a reliable
generator.
Where possible, symbols have been made static, prefixed with glsl_/GLSL_ or
moved into the code shared by all renderers. This will make doing plugins
easier but done now for link testing. The moving was done via the gl
commit.
This is a rather "evil" hack because GLES doesn't seem to need
GL_VERTEX_PROGRAM_POINT_SIZE, but GL does, and all my work is currently
done in GL rather than GLES. Point particles now work, but the sizes are
all wrong.
Using quads requires 4 elements, but triangles require 6. I'd gotten the
element array setup right, but I'd forgotten to tweak vacount when drawing
the particles.
I'm not sure if there's a bug in mesa, or if I'm doing something wrong, but
GL_POINTS doesn't seem to be working properly. I get the points, but
writing to gl_PointSize doesn't make a difference despite the size range
being 1-255.
Unfortunately, the maximum point size on Intel hardwar seems to be 1, so I
can't tell if the colors are right.
This is largely just a hacked version of GL's particle code.
Add GLSL directory to QF and use it for all gsls based code (instead of
GL). defines.h, types.h and funcs.h are derived from gl2.h from khronos.
Text drawing now uses triangles instead of quads.