diff --git a/sjplayer/src/sjplayer/Background.d b/sjplayer/src/sjplayer/Background.d index b2fcd74..0d77129 100644 --- a/sjplayer/src/sjplayer/Background.d +++ b/sjplayer/src/sjplayer/Background.d @@ -9,13 +9,11 @@ class Background { /// this(BackgroundProgram program) { program_ = program; - } - /// - void Initialize() { inner_color = vec4(0, 0, 0, 0); outer_color = vec4(0, 0, 0, 0); } + /// void Draw() { program_.Draw(inner_color, outer_color); diff --git a/sjplayer/src/sjplayer/CircleElementScheduledController.d b/sjplayer/src/sjplayer/CircleElementScheduledController.d index 2a485e0..3bda07b 100644 --- a/sjplayer/src/sjplayer/CircleElementScheduledController.d +++ b/sjplayer/src/sjplayer/CircleElementScheduledController.d @@ -22,6 +22,7 @@ alias CircleElementScheduledController = ElementScheduledController!( ); static assert(CircleElementScheduledController.AliveManagementAvailable); static assert(CircleElementScheduledController.MatrixModificationAvailable); +static assert(CircleElementScheduledController.AutoInitializationAvailable); /// alias CircleElementScheduledControllerFactory = diff --git a/sjplayer/src/sjplayer/ElementScheduledController.d b/sjplayer/src/sjplayer/ElementScheduledController.d index dcfbc3b..ada4add 100644 --- a/sjplayer/src/sjplayer/ElementScheduledController.d +++ b/sjplayer/src/sjplayer/ElementScheduledController.d @@ -35,6 +35,9 @@ class ElementScheduledController( enum MatrixModificationAvailable = is(typeof((Element e) => e.matrix)) && is(ReturnType!((Element e) => e.matrix) == mat3); + /// + enum AutoInitializationAvailable = + is(typeof((Element e) => e.Initialize())); /// this( @@ -47,7 +50,9 @@ class ElementScheduledController( protected: override void PrepareOperation(ref in ParametersBlock params) { - element_.Initialize(); + static if (AutoInitializationAvailable) { + element_.Initialize(); + } static if (AliveManagementAvailable) { element_.alive = true; }