Example #1
0
        public SimpleVertex(Vector3 position, Vector3 normal, Color4f color)
        {
            this.Color    = color;
            this.Normal   = Vector3.Normalize(normal);
            this.Position = position;

            this.__packing = 0f;
        }
Example #2
0
        public SimpleVertex(Vector3 position, Vector3 normal, Color4f color)
        {
            this.Color = color;
            this.Normal = Vector3.Normalize(normal);
            this.Position = position;

            this.__packing = 0f;
        }
Example #3
0
        public SimpleRenderer()
        {
            string title = "SharpDX Renderer (SIMD " + (Vector.IsHardwareAccelerated ? "Enabled" : "Disabled") + ")";

            title           += Environment.Is64BitProcess ? " 64-bit" : " 32-bit";
            this.renderForm  = new RenderForm(title);
            this.renderables = ImmutableArray <IRenderable> .Empty;
            CreateAndInitializeDevice();
            renderForm.Show();
            AmbientColor = new Color4f(.25f, .25f, .25f, 1);
#if TEXT_RENDERER
            this.TextRenderer = new SimpleText(this.Get2DGraphicsDevice(), "Fonts/textfont.dds");
#endif
        }
Example #4
0
 public DirectionalLight(Device device, DeviceContext deviceContext, Vector3 direction, Color4f color)
 {
     this.device = device;
     this.deviceContext = deviceContext;
     this.direction = Vector3.Normalize(direction);
     this.diffuseColor = color;
     this.lightMatrixBuffer = new SharpDX.Direct3D11.Buffer(
         device,
         Marshal.SizeOf(typeof(LightBuffer)),
         ResourceUsage.Default,
         BindFlags.ConstantBuffer,
         CpuAccessFlags.None,
         ResourceOptionFlags.None,
         0);
 }
Example #5
0
 public DirectionalLight(Device device, DeviceContext deviceContext, Vector3 direction, Color4f color)
 {
     this.device            = device;
     this.deviceContext     = deviceContext;
     this.direction         = Vector3.Normalize(direction);
     this.diffuseColor      = color;
     this.lightMatrixBuffer = new SharpDX.Direct3D11.Buffer(
         device,
         Marshal.SizeOf(typeof(LightBuffer)),
         ResourceUsage.Default,
         BindFlags.ConstantBuffer,
         CpuAccessFlags.None,
         ResourceOptionFlags.None,
         0);
 }
Example #6
0
 public AmbientLightBuffer(Color4f color)
 {
     this.AmbientColor = color;
 }
Example #7
0
 private SharpDX.Color ToSharpColor(Color4f color4f)
 {
     return(new SharpDX.Color(color4f.R, color4f.G, color4f.B, color4f.A));
 }
Example #8
0
 public void DrawText(string text, Vector2 screenPosition, Color4f color)
 {
     //spriteBatch.Begin();
     spriteBatch.DrawString(spriteFont, text, ToSharpVector(screenPosition), ToSharpColor(color));
     //spriteBatch.End();
 }
Example #9
0
 public SimpleRenderer()
 {
     string title = "SharpDX Renderer (SIMD " + (Vector.IsHardwareAccelerated ? "Enabled" : "Disabled") + ")";
     title += Environment.Is64BitProcess ? " 64-bit" : " 32-bit";
     this.renderForm = new RenderForm(title);
     this.renderables = ImmutableArray<IRenderable>.Empty;
     CreateAndInitializeDevice();
     renderForm.Show();
     AmbientColor = new Color4f(.25f, .25f, .25f, 1);
     #if TEXT_RENDERER
     this.TextRenderer = new SimpleText(this.Get2DGraphicsDevice(), "Fonts/textfont.dds");
     #endif
 }
Example #10
0
 public AmbientLightBuffer(Color4f color)
 {
     this.AmbientColor = color;
 }
Example #11
0
 private SharpDX.Color ToSharpColor(Color4f color4f)
 {
     return new SharpDX.Color(color4f.R, color4f.G, color4f.B, color4f.A);
 }
Example #12
0
 public void DrawText(string text, Vector2 screenPosition, Color4f color)
 {
     //spriteBatch.Begin();
     spriteBatch.DrawString(spriteFont, text, ToSharpVector(screenPosition), ToSharpColor(color));
     //spriteBatch.End();
 }
Example #13
0
 public LightBuffer(Color4f diffuseColor, Vector3 direction)
 {
     this.diffuseColor = diffuseColor;
     this.lightDirection = direction;
     this.__packing = 0;
 }
Example #14
0
 public LightBuffer(Color4f diffuseColor, Vector3 direction)
 {
     this.diffuseColor   = diffuseColor;
     this.lightDirection = direction;
     this.__packing      = 0;
 }