seeding the pot for 2.0 features

Wolfgang Draxinger wdraxinger at darkstargames.de
Sun Jan 28 10:30:32 PST 2007


Kirk McDonald wrote:

> Have you seen Pyd, I wonder?
> 
> http://pyd.dsource.org/

Yes I have, but I was more thinking of using Python modules from
D.

Having such an interface would be cool for other things, too. For
example one could use this as a convenient interface to things
like the OpenGL API. For my 3D engine wrapper classes and one is
there for abstracting stuff like textures. Textures have several
parameters which are set through glTexParameter and glTexEnv.
Currently for each parameter there is a pair of property
functions. But each OpenGL extension that extends the set of
avaliable texture parameters requires to either extend, or to
derive the texture class. However most texture parameters are
numeric. The class could have a public avaliable AA, which maps
property names to the OpenGL tokens. Then a universal handler
function would use that array to get the OpenGL token from the
requested member and perform the function calls. There would be
a basic set of functions of course, but upon extension loading
that extension wrapper could extend the maping AA apropriately.
This way the texture class wouldn't have to be extended/derived,
keeping the codebase small and consistent.

Wolfgang Draxinger
-- 
E-Mail address works, Jabber: hexarith at jabber.org, ICQ: 134682867




More information about the Digitalmars-d mailing list