PDA

View Full Version : Lumina GLSL IDE based on QtScript and dynamic Objects



oc2k1
12th August 2008, 05:12
Today I've released Lumina version 0.4

http://lumina.sourceforge.net/

New features are a texture viewer and tools. The most changes are internal:

I've redesigned a big part of the codebase, because it was hard to maintain.
One of the biggest issue were the create functions to create subobjects. These caused a net of dependencies, that avoids to remove or replace code parts.
My new DQObject system allows to glue all that stuff including script extension at runtime together.

If anyone is interrested in the Dynamic QObject system, that I've used to reduce the code complexity:

So I've started to add the ability of QObject and QMetaObject, to add Slots at runtime. Basically the QMetaObjects internal data structure isn't generated by moc any more. A derived class named DQMetaObject is able to create this structures itself (That isn't a problem as long this is done before Qt starts, but it looks like it works also at a later time, as long the slot won't be removed)
The DQObject is the second important part. Instead using a QMetaObject, it stores the dynmic version.
It's a template class that adds the dynamic capabilities at creation time. by simply writing "new DQObject<AnyQObjectBasedClass>()" instead "new AnyQObjectBasedClass()" unfortunately it's not possible to implement any thinkable constructor arguments passthrough (templates can't do that :( )

The handling of the new slots is quite simple: A callbackfunction with the the object, slot, slot arguments and an additional ID will be called. A Qt Slot was not possible, because the Signal/Slot system uses a virtual function, that avoid usage as long no instance exist.
Maybe it's not ideal to handle that stuff with own code, but maybee in future Qt could have a similar build in feature.