private Result Clear(IntPtr devicePointer, int count, IntPtr rects, ClearFlags flags, ColorBGRA color, float z, int stencil) { try { var structSize = Marshal.SizeOf(typeof(Rectangle)); var structs = new SharpDX.Rectangle[count]; for (int i = 0; i < count; i++) { structs[i] = (SharpDX.Rectangle)Marshal.PtrToStructure(rects, typeof(SharpDX.Rectangle)); } var rectangles = structs; this.Log.LogMethodSignatureTypesAndValues(devicePointer, count, rectangles.PrintTypesNamesValues(), flags, color, z, stencil); this.GetOrCreateDevice(devicePointer); if (rectangles.Length == 0) this.Device.Clear(flags, color, z, stencil); else this.Device.Clear(flags, color, z, stencil, rectangles); } catch (SharpDXException ex) { Log.Warn(ex); } catch (Exception ex) { this.Log.Fatal(ex); } return Result.Ok; }
private Result Clear(IntPtr devicePointer, int count, IntPtr rects, ClearFlags flags, ColorBGRA color, float z, int stencil) { try { var structSize = Marshal.SizeOf(typeof(Rectangle)); var structs = new SharpDX.Rectangle[count]; for (int i = 0; i < count; i++) { structs[i] = (SharpDX.Rectangle)Marshal.PtrToStructure(rects, typeof(SharpDX.Rectangle)); } var rectangles = structs; this.Log.LogMethodSignatureTypesAndValues(devicePointer, count, rectangles.PrintTypesNamesValues(), flags, color, z, stencil); this.GetOrCreateDevice(devicePointer); if (rectangles.Length == 0) { this.Device.Clear(flags, color, z, stencil); } else { this.Device.Clear(flags, color, z, stencil, rectangles); } } catch (SharpDXException ex) { Log.Warn(ex); } catch (Exception ex) { this.Log.Fatal(ex); } return(Result.Ok); }
public void BeginWithClear(float r, float g, float b, float a) { Begin(); beginClearColor = new CCColor4B(r, g, b, a); clearFlags = ClearFlags.ColorBuffer; CCDrawManager.SharedDrawManager.Clear(beginClearColor); }
public void BeginFrame() { if (rendering) { return; } if (reloadTextures) { for (int i = 0; i < textures.Count; i++) { LoadTexture(i); } reloadTextures = false; } // update matrices if neccesary if (camera != null) { device.Transform.View = EM2DXM(camera.ViewMatrix); device.Transform.Projection = EM2DXM(camera.ProjectionMatrix); device.Transform.World = Microsoft.DirectX.Matrix.Identity; } ClearFlags flags = ClearFlags.ZBuffer; if (clear) { flags |= ClearFlags.Target; } device.Clear(flags, 0, Camera.DISTANCE, 0); device.BeginScene(); rendering = true; }
/// <summary> /// Clear buffers /// </summary> /// <param name="buffers">Buffers to clear</param> /// <param name="color">Color value to set</param> /// <param name="depth">Depth value to set</param> /// <param name="stencil">Stencil value to set</param> /// <remarks>Color, depth and stencil will set those default values whether they are set in the buffers parameter or not.</remarks> public void Clear(ClearFlags buffers, Vector4 color, double depth, int stencil) { GL.glClearColor(color.x, color.y, color.z, color.w); GL.glClearDepth(depth); GL.glClearStencil(stencil); GL.glClear((uint)buffers); }
public void BeginWithClear(CCColor4B col) { Begin(); beginClearColor = col; clearFlags = ClearFlags.ColorBuffer; CCDrawManager.SharedDrawManager.Clear(col); }
public void Clear(CCColor4B col) { Begin(); beginClearColor = col; clearFlags |= ClearFlags.ColorBuffer; CCDrawManager.SharedDrawManager.Clear(beginClearColor); End(); }
public void ClearStencil(int stencilValue) { Begin(); beginStencilValue = stencilValue; clearFlags |= ClearFlags.StencilBuffer; CCDrawManager.SharedDrawManager.Clear(ClearOptions.Stencil, Microsoft.Xna.Framework.Color.White, 1, stencilValue); End(); }
public void BeginWithClear(float r, float g, float b, float a, float depthValue) { Begin(); beginClearColor = new CCColor4B(r, g, b, a); beginDepthValue = depthValue; clearFlags = ClearFlags.ColorBuffer | ClearFlags.DepthBuffer; CCDrawManager.SharedDrawManager.Clear(beginClearColor, depthValue); }
public void ClearDepth(float depthValue) { Begin(); beginDepthValue = depthValue; clearFlags |= ClearFlags.DepthBuffer; CCDrawManager.SharedDrawManager.Clear(ClearOptions.DepthBuffer, Microsoft.Xna.Framework.Color.White, depthValue, 0); End(); }
public void ClearDepthStencilView( CpuDescriptorHandle depthStencilView, ClearFlags clearFlags, float depth, byte stencil, params RawRectangle[] rectangles) { ClearDepthStencilView(depthStencilView, clearFlags, depth, stencil, rectangles.Length, rectangles); }
public void Clear(ClearFlags flags, int colorBGRA, float z, int stencil) { int res = Interop.Calli(comPointer, 0, IntPtr.Zero, (int)flags, colorBGRA, z, stencil, (*(IntPtr **)comPointer)[43]); if (res < 0) { throw new SharpDXException(res); } }
public void BeginWithClear(float r, float g, float b, float a, float depthValue, int stencilValue) { Begin(); beginClearColor = new CCColor4B(r, g, b, a); beginDepthValue = depthValue; beginStencilValue = stencilValue; clearFlags = ClearFlags.All; CCDrawManager.SharedDrawManager.Clear(beginClearColor, depthValue, stencilValue); }
public void BeginWithClear(CCColor4B col, float depthValue) { Begin(); beginClearColor = col; beginDepthValue = depthValue; clearFlags = ClearFlags.ColorBuffer | ClearFlags.DepthBuffer; CCDrawManager.SharedDrawManager.Clear(col, depthValue); }
public void BeginWithClear(CCColor4B col, float depthValue, int stencilValue) { Begin(); beginClearColor = col; beginDepthValue = depthValue; beginStencilValue = stencilValue; clearFlags = ClearFlags.All; CCDrawManager.SharedDrawManager.Clear(col, depthValue, stencilValue); }
/// <summary> /// Default values /// </summary> protected override void DefaultValues() { base.DefaultValues(); this.Monoscopic = false; this.nearPlane = 0.05f; this.farPlane = 500f; this.clearFlags = ClearFlags.All; this.backgroundColor = Color.Transparent; this.VRMode = VRMode.HmdMode; }
/// <summary> /// Clears the FrameBuffer. /// </summary> /// <param name="flags"></param> /// <param name="red"></param> /// <param name="green"></param> /// <param name="blue"></param> /// <param name="alpha"></param> /// <param name="depth"></param> /// <param name="stencil"></param> public void Clear(ClearFlags flags, float red, float green, float blue, float alpha, float depth, int stencil) { Gl.glClearColor(red, green, blue, alpha); Gl.glClearDepth(depth); Gl.glClearStencil(stencil); Gl.glClear((int)flags); }
//------------------------------------------------ //abstracted functions to wrap internals static public void clear(bool zbuf, bool color, int colorVal, float zdepth, int stencil) { if (mbDeviceLost == true) { return; } ClearFlags flags = (zbuf ? ClearFlags.ZBuffer : 0) | (color? ClearFlags.Target:0); BRenderDevice.getDevice().Clear(flags, unchecked ((int)colorVal), zdepth, stencil); }
public void ClearDepthStencilView(CpuDescriptorHandle depthStencilView, ClearFlags clearFlags, float depth, byte stencil, params InteropRect[] rectangles) { if (rectangles.Length == 0) { ClearDepthStencilView(depthStencilView, clearFlags, depth, stencil, 0, null); } else { ClearDepthStencilView(depthStencilView, clearFlags, depth, stencil, rectangles.Length, rectangles); } }
/// <summary> /// Refresh camera draw properties (Clear flags, background, etc..) /// </summary> private void RefreshCameraProperties() { if (this.LeftEyeCamera == null || this.RightEyeCamera == null) { return; } this.AttachedCamera.BackgroundColor = this.LeftEyeCamera.BackgroundColor = this.RightEyeCamera.BackgroundColor = this.backgroundColor; this.AttachedCamera.NearPlane = this.LeftEyeCamera.NearPlane = this.RightEyeCamera.NearPlane = this.nearPlane; this.AttachedCamera.FarPlane = this.LeftEyeCamera.FarPlane = this.RightEyeCamera.FarPlane = this.farPlane; this.AttachedCamera.ClearFlags = this.LeftEyeCamera.ClearFlags = this.RightEyeCamera.ClearFlags = this.clearFlags; }
private void DrawBackgroungSettings() { EditorGUILayout.Space(); EditorGUILayout.BeginVertical("box"); EditorGUILayout.BeginHorizontal(GUILayout.Height(36)); EditorGUILayout.Space(); if (GUILayout.Button(iconBackground, sectionIcon, GUILayout.Width(28), GUILayout.Height(28)) || GUILayout.Button("BACKGROUND", sectionsFont, GUILayout.MaxWidth(float.MaxValue)) || GUILayout.Button(collapseBackgroungSettings ? arrowDownButton : arrowUpButton, sectionCollapseArrow, GUILayout.Width(24), GUILayout.Height(24))) { collapseBackgroungSettings = !collapseBackgroungSettings; } GUILayout.Space(5); EditorGUILayout.EndHorizontal(); if (!collapseBackgroungSettings) { EditorGUILayout.Space(); EditorGUILayout.Space(); clearFlags = (ClearFlags)EditorGUILayout.EnumPopup("Background Type", clearFlags); EditorGUILayout.Space(); switch ((int)clearFlags) { case 2: PreviewSceneInstance.PreviewCamera.clearFlags = (CameraClearFlags)clearFlags; EditorGUILayout.BeginHorizontal(); GUILayout.Label("Background Color"); backgroundColor = EditorGUILayout.ColorField(backgroundColor); PreviewSceneInstance.PreviewCamera.backgroundColor = backgroundColor; EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); break; case 4: PreviewSceneInstance.PreviewCamera.clearFlags = (CameraClearFlags)clearFlags; backgroundTexture = (Texture)EditorGUILayout.ObjectField("Image", backgroundTexture, typeof(Texture), false); EditorGUILayout.Space(); break; } } EditorGUILayout.EndVertical(); }
void Clear(ClearFlags clearFlags, CCColor4B color, float depth, int stencil) { if (clearFlags.HasFlag(ClearFlags.ColorBuffer)) { CCDrawManager.SharedDrawManager.Clear(color); } if (clearFlags.HasFlag(ClearFlags.DepthBuffer)) { CCDrawManager.SharedDrawManager.Clear(ClearOptions.DepthBuffer, Microsoft.Xna.Framework.Color.White, depth, 0); } if (clearFlags.HasFlag(ClearFlags.StencilBuffer)) { CCDrawManager.SharedDrawManager.Clear(ClearOptions.Stencil, Microsoft.Xna.Framework.Color.White, 1, stencil); } }
public void Clear(OpenTK.Graphics.OpenGL.ClearBufferMask mask) { ClearFlags flags = ClearFlags.None; if ((mask & gl.ClearBufferMask.ColorBufferBit) != 0) { flags |= ClearFlags.Target; } if ((mask & gl.ClearBufferMask.DepthBufferBit) != 0) { flags |= ClearFlags.ZBuffer; } if ((mask & gl.ClearBufferMask.StencilBufferBit) != 0) { flags |= ClearFlags.Stencil; } Dev.Clear(flags, _clearColor, 0.0f, 0); }
public void Clear(ClearFlags clearFlags, Color clearColor) { switch (clearFlags) { case ClearFlags.RenderTarget: nativeDevice.D3D11Device.ImmediateContext1.ClearRenderTargetView(renderTargetView, clearColor); break; case ClearFlags.DepthBuffer: nativeDevice.D3D11Device.ImmediateContext.ClearDepthStencilView(depthBuffer.DepthStencilView, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, 1.0f, 0); break; case ClearFlags.RenderTarget | ClearFlags.DepthBuffer: nativeDevice.D3D11Device.ImmediateContext1.ClearRenderTargetView(renderTargetView, clearColor); nativeDevice.D3D11Device.ImmediateContext.ClearDepthStencilView(depthBuffer.DepthStencilView, DepthStencilClearFlags.Depth | DepthStencilClearFlags.Stencil, 1.0f, 0); break; } }
/// <summary> /// Update the behavior /// </summary> /// <param name="gameTime">The current game time.</param> protected override void Update(TimeSpan gameTime) { if (this.vrProvider == null) { this.vrProvider = this.Owner.FindComponent <VRProvider>(false); } if (this.vrProvider == null || !this.vrProvider.IsConnected) { return; } var eyePoses = this.vrProvider.EyePoses; var trackerCameraPose = this.vrProvider.TrackerCameraPose; // Left eye camera this.UpdateCamera(this.LeftEyeCamera, (int)VREyeType.LeftEye); this.UpdateCamera(this.RightEyeCamera, (int)VREyeType.RightEye); // Camera tracker this.TrackerAnchorTransform.LocalPosition = trackerCameraPose.Position; this.TrackerAnchorTransform.LocalOrientation = trackerCameraPose.Orientation; // Center this.CenterEyeAnchorTransform.LocalPosition = eyePoses[(int)VREyeType.CenterEye].Position; this.CenterEyeAnchorTransform.LocalOrientation = eyePoses[(int)VREyeType.CenterEye].Orientation; if (this.LeftEyeCamera.RenderTarget == this.RightEyeCamera.RenderTarget) { this.RightEyeCamera.ClearFlags = ClearFlags.DepthAndStencil; } else { this.RightEyeCamera.ClearFlags = ClearFlags.All; } if (this.UpdatedAnchors != null) { this.UpdatedAnchors(this); } }
/// <summary> /// Initializes all default values of this instance. /// </summary> protected override void DefaultValues() { base.DefaultValues(); this.definedKeys = Enum.GetValues(typeof(Keys)); this.Width = 256; this.Height = 256; this.EnableMouse = true; this.EnableKeyboard = false; this.EnableTouch = false; this.enablePostProcess = false; this.antiAliasingMode = View.AntialiasingMode.MSAA; this.tessellationQuality = View.TessellationQuality.Medium; this.backgroundColor = Common.Graphics.Color.Black; this.clearFlags = ClearFlags.All; this.flipY = false; this.disposed = false; this.Family = FamilyType.PriorityBehavior; }
void Clear(ClearFlags clearFlags, CCColor4B color, float depth, int stencil) { if (clearFlags.HasFlag(ClearFlags.ColorBuffer)) CCDrawManager.SharedDrawManager.Clear(color); if (clearFlags.HasFlag(ClearFlags.DepthBuffer)) CCDrawManager.SharedDrawManager.Clear(ClearOptions.DepthBuffer, Microsoft.Xna.Framework.Color.White, depth, 0); if (clearFlags.HasFlag(ClearFlags.StencilBuffer)) CCDrawManager.SharedDrawManager.Clear(ClearOptions.Stencil, Microsoft.Xna.Framework.Color.White, 1, stencil); }
/// <summary> /// Default values /// </summary> protected override void DefaultValues() { base.DefaultValues(); this.Monoscopic = false; this.platform = WaveServices.Platform; this.nearPlane = 0.05f; this.farPlane = 500f; this.clearFlags = ClearFlags.All; this.backgroundColor = Color.Transparent; this.VRMode = VRMode.HmdMode; }
public void ClearDepthStencilView(Texture depthStencilBuffer, ClearFlags clearFlags, float depth = 1, byte stencil = 0, params Rectangle[] rectangles) { NativeCommandList.ClearDepthStencilView(depthStencilBuffer.NativeDepthStencilView.ToCpuDescriptorHandle(), (Vortice.Direct3D12.ClearFlags)clearFlags, depth, stencil, rectangles.Select(r => new RawRect(r.Left, r.Top, r.Right, r.Bottom)).ToArray()); }
/// <summary> /// Clears one or more surfaces such as a render target, a stencil buffer, and a depth buffer. /// </summary> /// <param name="clearFlags">Flags that specify which surfaces will be cleared.</param> /// <param name="color">The color that will be used to fill the cleared render target.</param> /// <param name="zdepth">The value that will be used to fill the cleared depth buffer.</param> /// <param name="stencil">The value that will be used to fill the cleared stencil buffer.</param> /// <param name="rectangles">The areas on the surfaces that will be cleared.</param> public void Clear(ClearFlags clearFlags, System.Drawing.Color color, float zdepth, int stencil, Rect[] rectangles) { Clear_(rectangles == null ? 0 : rectangles.Length, rectangles, clearFlags, Helpers.ToBgra(color), zdepth, stencil); }
private static extern void Internal_SetClearFlags(IntPtr instance, ClearFlags value);
/// <summary> /// Clears the specified flags. /// </summary> /// <param name="flags">The flags.</param> public void Clear(ClearFlags flags) { GL.Clear((ClearBufferMask) flags); }
/// <summary> /// Clear buffers /// </summary> /// <param name="buffers">Buffers to clear</param> /// <remarks>Values for color, depth and stencil will be the previously set values if they are mentioned in the buffers paramter</remarks> public void Clear(ClearFlags buffers) { //GL.glClear((uint)buffers); }
/// <summary> /// Clear buffers /// </summary> /// <param name="buffers">Buffers to clear</param> /// <param name="color">Color value to set</param> /// <remarks>Color will set those default values whether they are set in the buffers parameter or not.</remarks> public void Clear(ClearFlags buffers, Vector4 color) { GL.glClearColor(color.x, color.y, color.z, color.w); GL.glClear((uint)buffers); }
/// <summary> /// Clear buffers /// </summary> /// <param name="buffers">Buffers to clear</param> /// <param name="color">Color value to set</param> /// <param name="depth">Depth value to set</param> /// <remarks>Color and depth will set those default values whether they are set in the buffers parameter or not.</remarks> public void Clear(ClearFlags buffers, Vector4 color, double depth) { GL.glClearColor(color.x, color.y, color.z, color.w); GL.glClearDepth(depth); GL.glClear((uint)buffers); }
/// <summary> /// Erases the contents of the speciefied rendering buffers. /// </summary> /// <param name="flags">A combination of flags specifying the rendering buffers to clear.</param> /// <remarks> /// Calling this method erases all contents of the rendering buffers. A typical use case for this method /// is to erase the contents of the color buffer and the depth buffer (z-buffer) before rendering starts /// at the beginning of a rendering loop. Thus, rendering the current frame starts with an empty color and /// z-buffer. <see cref="ClearFlags"/> for a list of possible buffers to clear. Make sure to use the bitwisee /// or-operator (|) to combine several buffers to clear. /// </remarks> public void Clear(ClearFlags flags) { _rci.Clear(flags); }
public void Clear(ClearFlags flags) { this.Clear(flags, Color.Black); }
public void Clear(ClearFlags flags, Color color) { this._device.Clear(flags, color, 1.0f, 0); }
public static void Clear(ClearFlags clearFlags) { Gl.Clear((uint)clearFlags); GlHelper.GetError(); }
/// <summary> /// Clears optionally the target, depth buffer and/or stencil. /// </summary> public void Clear( ClearFlags clearFlags, Color targetColor, float zClear, int stencilClear) { device.Clear( clearFlags, targetColor, zClear, stencilClear ); }
/// <summary> /// Clears the FrameBuffer. /// </summary> /// <param name="flags"></param> /// <param name="red"></param> /// <param name="green"></param> /// <param name="blue"></param> /// <param name="alpha"></param> /// <param name="depth"></param> /// <param name="stencil"></param> public void Clear (ClearFlags flags, float red, float green, float blue, float alpha, float depth, int stencil) { Gl.glClearColor(red, green, blue, alpha); Gl.glClearDepth(depth); Gl.glClearStencil(stencil); Gl.glClear((int)flags); }
public void Clear(ClearFlags flags, int colorBGRA, float z, int stencil) { int res = Interop.Calli(comPointer, 0, IntPtr.Zero, (int)flags, colorBGRA, z, stencil, (*(IntPtr**)comPointer)[43]); if( res < 0 ) { throw new SharpDXException( res ); } }
/// <summary> /// Clears one or more surfaces such as a render target, a stencil buffer, and a depth buffer. /// </summary> /// <param name="clearFlags">Flags that specify which surfaces will be cleared.</param> /// <param name="color">The color that will be used to fill the cleared render target.</param> /// <param name="zdepth">The value that will be used to fill the cleared depth buffer.</param> /// <param name="stencil">The value that will be used to fill the cleared stencil buffer.</param> public void Clear(ClearFlags clearFlags, System.Drawing.Color color, float zdepth, int stencil) { Clear_(0, null, clearFlags, Helpers.ToBgra(color), zdepth, stencil); }
public void ClearDepthStencilView(Texture depthStencilBuffer, ClearFlags clearFlags, float depth = 1, byte stencil = 0, params Rectangle[] rectangles) { currentCommandList.NativeCommandList.ClearDepthStencilView(depthStencilBuffer.NativeDepthStencilView, (Vortice.Direct3D12.ClearFlags)clearFlags, depth, stencil, rectangles.Select(r => (Rect)r).ToArray()); }
public void ClearDevice(ClearFlags flag, Color color, float zdepth, int stencil) { _Device_.Clear(flag, color, zdepth, stencil); }