Though I've never posted anything about it before, I'd like to say thank
you for blackbox! The first time I used it, I never went back.
I've been working on a 3d rendering engine, (uses SDL, C++, and
openGL, ) in linux, and wanted to try out some ..non-conventional
things with it. First decent working screenshots :
http://bennyedwards.com/coffee/viewtopic.php?t=62
(Currently no public release, as it's only a 3 week old baby engine, but
very cleanly written, very stable, and only uses 7mb of ram with no
objects in the world, 7.9mb with thousands of traingles and quadratics,
kind of heavy on cpu though 70-90%(600mhz, 32meg tnt2 vid card).
Now, I can add new renderers very easily because of the OO/UML
design approach I took, by simple creating a small encapsulator object,
put it in the "shapes" file as: class myObj : public object {...}, then setting
up the renderer, by default it gets sent: a small x,y,z struct for light, x, y,
z, yaw, pitch, roll, texture-int.
Only two things that matter (for rendering)are an enumerated int
inherited by object, usually set in the constructor:
int type; // in constructor: type = TYPE_MYRENDERER
//where TYPE_MYRENDERER defined in tools.h
void renderthis(struct light, float x, float y, float z, float yaw, float pitch,
float roll, int tex) {
//*Set up position with opengl
glTranslateF(x,y,z);
glRotatef(roll, 1, 0, 0);
glRotate(yaw+180, 0, -1, 0);
glRotate(pitch, 0, 0, 1);
//*render
drawfuncts()
}
I'm wondering how hard it would be to add a blackbox object to a cube
or 2d square?
Every frame the renderthis(struct, float, float, float, float, float, float, int) is
called (can be easily overloaded for different parameters),
so can I do a glTranslateF(x, y, z), glRotatef(yaw....)etc, then call the
function to draw the window manager? (Eg: create a blackbox object in
the constructor of a very small renderer object, set up a renderthis(....)
and set it's position in the 3d world, then render it)
This way, a user could change X11 from booting up a window
manager, it could boot up an empty 3d world, and if they want a
desktop, they can point somewhere, use my selection cursor to place it
at any distance directly in front of whatever direction they're looking,
then release the mouse over the new window manager.
I can take care of getting the keyboard/mouse input to the BB object,
and can already position things very very easily, no need to memorize
any x, y, z coordinates what-so-ever, just look where you want, use the
mouse to scroll the cursor closer or further from you, place it. Hopefully
soon I will be able to mutate existing objects (circles, spheres, cubes,
cones, etc) hopefully very soon, it depends on how long it takes me to
get (the harder stuff)collision detection and some good physics routines
written(gravity), and perhaps some light objects
I wonder, can one convert SDL events to X11 events? Then I could
simply send the events untranslated to the BB object, let it take care of it
(when it's selected and focus is released)