3.27.2012

Now that's nifty

I've come across a very nice solution for my graphics engine, combined with the previously explained render command string of course: given a set of commands with a fixed-size list of integer numbers, one can define special commands that set the source of all used colors/vectors/texture, each associated with an identificator found in a command parameter list. What is means is that you can precalculate all your colors and vectors in a custom memory somewhere and then assemble the whole scene by setting these buffers and what to shapes should be drawn next how often. It's hard to let this sound clear and convincing, but it let's the programmer specify stuff in a very short and simple manner - especially useful when generating screen contents from map data or effects. Adding stuff like repeat options for those buffers makes it possible to let all following objects to, for example, share textures and colors implicitely.

I'm quite excited about this and feel even more convinced that this is the best way of feeding my graphics engine. No superfluous function calls, no uber-defined stuff reducing flexibility and definitely no non-generalized content. Very pleasing, indeed. Some more time and I do a few first tests I guess. However, I had to drop a few things because I'm not quite sure how to impletement clipping with such a kind of hardly defined screen content. For tracing and collision detection, this can be done by using the fragment buffer (I think it was called like that) and associating an id with each graphical object. Oh boy, that's definitely what I was looking for!

No comments: