ToARGB() public method

Converts this color value to packed ARBG format.
public ToARGB ( ) : int
return int
Ejemplo n.º 1
0
	    public static int ConvertColorValue( ColorEx color, VertexElementType colorVertexElementType )
	    {
            switch (colorVertexElementType)
            {
#if AXIOM_PLATFORM == AXIOM_PLATFORM_WIN32
                default:
#endif
                case VertexElementType.Color_ARGB:
                    return color.ToARGB();
#if AXIOM_PLATFORM != OGRE_PLATFORM_WIN32
        default:
#endif
                case VertexElementType.Color_ABGR:
                    return color.ToABGR();
            }
	    }
 private Color ColorExToColor(ColorEx cx)
 {
     return Color.FromArgb((int)cx.ToARGB());
 }
Ejemplo n.º 3
0
        public override void ClearFrameBuffer( FrameBufferType buffers, ColorEx color, Real depth, ushort stencil )
        {
            ClearFlags flags = 0;

            if ( ( buffers & FrameBufferType.Color ) > 0 )
            {
                flags |= ClearFlags.Target;
            }
            if ( ( buffers & FrameBufferType.Depth ) > 0 )
            {
                flags |= ClearFlags.ZBuffer;
            }
            // Only try to clear the stencil buffer if supported
            if ( ( buffers & FrameBufferType.Stencil ) > 0
                && Capabilities.HasCapability( Graphics.Capabilities.StencilBuffer ) )
            {
                flags |= ClearFlags.Stencil;
            }

            // clear the device using the specified params
            ActiveD3D9Device.Clear(flags, color.ToARGB(), depth, stencil);
        }
 public override uint ConvertColor(ColorEx color)
 {
     return color.ToARGB();
 }
        /// <summary>
        ///		
        /// </summary>
        /// <param name="buffers"></param>
        /// <param name="color"></param>
        /// <param name="depth"></param>
        /// <param name="stencil"></param>
        public override void ClearFrameBuffer(FrameBuffer buffers, ColorEx color, float depth, int stencil)
        {
            D3D.ClearFlags flags = 0;

            if((buffers & FrameBuffer.Color) > 0) {
                flags |= D3D.ClearFlags.Target;
            }
            if((buffers & FrameBuffer.Depth) > 0) {
                flags |= D3D.ClearFlags.ZBuffer;
            }
            // Only try to clear the stencil buffer if supported
            if((buffers & FrameBuffer.Stencil) > 0
                && caps.CheckCap(Capabilities.StencilBuffer)) {

                flags |= D3D.ClearFlags.Stencil;
            }

            // clear the device using the specified params
            device.Clear(flags, (int)color.ToARGB(), depth, stencil);
        }
 /// <summary>
 /// This is used to insert events into the PIX trace for DirectX debugging and profiling.
 /// </summary>
 /// <param name="color">Color to display the event</param>
 /// <param name="message">Message to display</param>
 /// <returns>nesting level of events</returns>
 public override int BeginProfileEvent(ColorEx color, string message)
 {
     return D3DPERF_BeginEvent(color.ToARGB(), message);
 }
 /// <summary>
 /// Set an instantaneous marker in the profiling event log.  (PIX for DirectX)
 /// </summary>
 /// <param name="color"></param>
 /// <param name="message"></param>
 public override void SetProfileMarker(ColorEx color, string message)
 {
     D3DPERF_SetMarker(color.ToARGB(), message);
 }