I've implemented a Game class in a WPF app. It works and the animation renders.

I have task to implement another several Controls with SharpDX in the same application window. Each new Game object takes a lot of memory (about 25MB each).

How can I save memory when creating over a dozen controls rendering different animations in SharpDX?

I thought about creating one Game object and share it between different controls. However, each control contains another animation. Adding new control I tried two things:

  • create new SharpDXElement for each control, then call Game.Switch(dxElement);
  • create one SharpDXElement for each control

Both failed: Only one control displays. The rest are invisible.

I also tried quickly switching the dxElement, but that caused blinking.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.