Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnRenderTargetChanged() query

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    OnRenderTargetChanged() query

    Hello,

    I have noticed, that it seems that under certain (rare) circumstances, OnRenderTargetChanged() or OnStateChange (Terminated) can be called, whilst a loop in OnRender() is actually still running? This might be during playback setup, re-wind, data reconnection, etc. Is this possible? It's not a huge issue, but it does seem to cause some temporary issues as Brushes etc that might be disposed of in OnrenderTargetChanged/State.Terminated might actually still be getting used, if only for milliseconds, in the loop in OnRedner, if the timing is unlucky

    Could this be possible?

    Thanks.

    #2
    Hello pjsmith,

    It would be very unlikely that OnRenderTargetChanged() will trigger in the middle of an OnRender() pass. These are on the same thread.

    OnStateChange() is on another thread, and could trigger while OnRender() is in a pass, but the resources would still be disposed properly if the State is State.Terminated.

    Brushes should be disposed and created in OnRenderTargetChanged(). If you are having an error message, when properly coding this, please report it.

    Below is a link to an example of working with brushes.

    This is a conversion of the Realtime Level II/Tick Volume. Please contact the original author for any questions or comments. Update Aug 27th, 2018: Since OnRenderTargetChanged can be called before State.DataLoaded, setting the dxmBrushes["backColor"].MediaBrush here wasn't working out and was sometimes null. Changed this to now get the chart background color (and text color) from […]
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    647 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X