public void DrawScene(RenderTask task, RenderTarget output, RenderBuffers buffers, RenderView view, ViewFlags flags, ViewMode mode, Actor[] customActors = null, ActorsSources actorsSource = ActorsSources.ScenesAndCustomActors, HashSet <PostProcessEffect> customPostFx = null) { #if UNIT_TEST_COMPILANT throw new NotImplementedException("Unit tests, don't support methods calls. Only properties can be get or set."); #else // Get unmanaged actors IntPtr[] actors = null; if (customActors != null) { actors = new IntPtr[customActors.Length]; for (int i = 0; i < customActors.Length; i++) { actors[i] = GetUnmanagedPtr(customActors[i]); } } // Get unmanaged postFx IntPtr[] postFx = null; if (customPostFx != null) { var postFxList = new List <IntPtr>(customPostFx.Count); foreach (var e in customPostFx) { if (e && e.CanRender) { postFxList.Add(e.unmanagedPtr); } } if (postFxList.Count > 0) { postFx = postFxList.ToArray(); } } Internal_DrawScene(unmanagedPtr, GetUnmanagedPtr(task), GetUnmanagedPtr(output), GetUnmanagedPtr(buffers), ref view, flags, mode, actors, actorsSource, postFx); #endif }
internal static extern void Internal_DrawScene(IntPtr obj, IntPtr task, IntPtr output, IntPtr buffers, ref RenderView view, ViewFlags flags, ViewMode mode, IntPtr[] customActors, ActorsSources actorsSource, IntPtr[] customPostFx);
internal static extern void Internal_DrawSceneDepth(IntPtr obj, IntPtr task, IntPtr output, bool drawTransparency, IntPtr[] customActors, ActorsSources actorsSource);
public void DrawSceneDepth(SceneRenderTask task, RenderTarget output, bool drawTransparency = true, List <Actor> customActors = null, ActorsSources actorsSource = ActorsSources.Scenes) { #if UNIT_TEST_COMPILANT throw new NotImplementedException("Unit tests, don't support methods calls. Only properties can be get or set."); #else // Get unmanaged actors var actors = GetActors(customActors, out int actorsCount); Internal_DrawSceneDepth(unmanagedPtr, GetUnmanagedPtr(task), GetUnmanagedPtr(output), drawTransparency, actors, actorsCount, actorsSource); #endif }
public void DrawSceneDepth(SceneRenderTask task, RenderTarget output, bool drawTransparency = true, Actor[] customActors = null, ActorsSources actorsSource = ActorsSources.Scenes) { #if UNIT_TEST_COMPILANT throw new NotImplementedException("Unit tests, don't support methods calls. Only properties can be get or set."); #else // Get unmanaged actors IntPtr[] actors = null; if (customActors != null) { actors = new IntPtr[customActors.Length]; for (int i = 0; i < customActors.Length; i++) { actors[i] = GetUnmanagedPtr(customActors[i]); } } Internal_DrawSceneDepth(unmanagedPtr, GetUnmanagedPtr(task), GetUnmanagedPtr(output), drawTransparency, actors, actorsSource); #endif }
public void DrawScene(RenderTask task, RenderTarget output, RenderBuffers buffers, ref RenderView view, ViewFlags flags, ViewMode mode, List <Actor> customActors = null, ActorsSources actorsSource = ActorsSources.ScenesAndCustomActors, HashSet <PostProcessEffect> customPostFx = null) { #if UNIT_TEST_COMPILANT throw new NotImplementedException("Unit tests, don't support methods calls. Only properties can be get or set."); #else // Get unmanaged actors var actors = GetActors(customActors, out int actorsCount); // Get unmanaged postFx var postFx = GetPostFx(customPostFx, out int postFxCount); Internal_DrawScene(unmanagedPtr, GetUnmanagedPtr(task), GetUnmanagedPtr(output), GetUnmanagedPtr(buffers), ref view, flags, mode, actors, actorsCount, actorsSource, postFx, postFxCount); #endif }
internal static extern void Internal_SetActorsSource(IntPtr obj, ActorsSources value);
internal static extern void Internal_DrawSceneDepth(IntPtr obj, IntPtr task, IntPtr output, IntPtr[] customActors, int customActorsCount, ActorsSources actorsSource);
internal static extern void Internal_DrawScene(IntPtr obj, IntPtr task, IntPtr output, IntPtr buffers, ref RenderView view, IntPtr[] customActors, int customActorsCount, ActorsSources actorsSource, IntPtr[] customPostFx, int customPostFxCount);
public void DrawScene(RenderTask task, RenderTarget output, RenderBuffers buffers, RenderView view, ViewFlags flags, ViewMode mode, Actor[] customActors = null, ActorsSources actorsSource = ActorsSources.ScenesAndCustomActors, HashSet <PostProcessEffect> customPostFx = null) { #if UNIT_TEST_COMPILANT throw new NotImplementedException("Unit tests, don't support methods calls. Only properties can be get or set."); #else // Get unmanaged actors IntPtr[] actors = null; int actorsCount = 0; if (customActors != null) { actorsCount = customActors.Length; if (_cachedActors == null || _cachedActors.Length < actorsCount) { _cachedActors = new IntPtr[Mathf.NextPowerOfTwo(actorsCount)]; } actors = _cachedActors; for (int i = 0; i < actorsCount; i++) { _cachedActors[i] = GetUnmanagedPtr(customActors[i]); } } // Get unmanaged postFx IntPtr[] postFx = null; int postFxCount = 0; if (customPostFx != null && customPostFx.Count > 0) { if (_cachedPostFxA == null) { _cachedPostFxA = new List <PostProcessEffect>(); } _cachedPostFxA.Capacity = Mathf.Max(_cachedPostFxA.Capacity, Mathf.NextPowerOfTwo(customPostFx.Count)); foreach (var e in customPostFx) { if (e && e.CanRender) { _cachedPostFxA.Add(e); } } _cachedPostFxA.Sort(ComparePostFx); postFxCount = _cachedPostFxA.Count; if (_cachedPostFxB == null || _cachedPostFxB.Length < postFxCount) { _cachedPostFxB = new IntPtr[_cachedPostFxA.Capacity]; } postFx = _cachedPostFxB; for (int i = 0; i < postFxCount; i++) { _cachedPostFxB[i] = GetUnmanagedPtr(_cachedPostFxA[i]); } _cachedPostFxA.Clear(); } Internal_DrawScene(unmanagedPtr, GetUnmanagedPtr(task), GetUnmanagedPtr(output), GetUnmanagedPtr(buffers), ref view, flags, mode, actors, actorsCount, actorsSource, postFx, postFxCount); #endif }