ro0mquy / rtificial

Flashing Visuals and Dope Sound | Das Git™
http://rtificial.org/
1 stars 0 forks source link

Find a way to share more code between vinyl and strahlenwerk #143

Open vincent23 opened 8 years ago

vincent23 commented 8 years ago

Ideally, all important code would be shared between strahlenwerk and vinyl. This is a difficult task and requires some thinking, but maybe it can be done with a common interface, which is implemented by vinyl as well as strahlenwerk.

phistep commented 8 years ago

Maybe vinyl should mimic the juce interface for sound and video, and the glm interface for math.

vincent23 commented 8 years ago

Seems like a bad idea to make this dependent on juce and/or glm. Better provide a shared implementation, which calls hooks and contains "ifdef"s if needed. For example, Timeline data should be accessed through a common interface, which can then be implemented separateley for the export format, as well as for the dynamic ValueTree in strahlenwerk. OpenGL code can mostly simply be shared. The shared part calls callbacks, like "prepareShader()" (which would handle includes and regex stuff in strahlenwerk, but nothing in the runtime). This would be a suitable application of the Curiously recurring template pattern , which allows the compiler to remove all dead code and therefore ideally make this possible without any overhead.