Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SimpleEffect.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.Core.Mathematics;
4 using SiliconStudio.Paradox.Effects.Modules;
5 
6 namespace SiliconStudio.Paradox.Graphics
7 {
8  public class SimpleEffect : Effect
9  {
10  public SimpleEffect(GraphicsDevice graphicsDevice)
11  : base(graphicsDevice, SpriteEffect.Bytecode)
12  {
13  Color = new Color4(1.0f);
14  Sampler = graphicsDevice.SamplerStates.LinearClamp;
15  Transform = Matrix.Identity;
16  }
17 
18  /// <summary>
19  /// Gets or sets the color. Default is <see cref="SharpDX.Color.White"/>.
20  /// </summary>
21  /// <value>The color.</value>
22  public Color4 Color
23  {
24  get
25  {
26  return Parameters.Get(SpriteEffectKeys.Color);
27  }
28 
29  set
30  {
31  Parameters.Set(SpriteEffectKeys.Color, value);
32  }
33  }
34 
35  public Matrix Transform
36  {
37  get
38  {
39  return Parameters.Get(SpriteBaseKeys.MatrixTransform);
40  }
41 
42  set
43  {
44  Parameters.Set(SpriteBaseKeys.MatrixTransform, value);
45  }
46  }
47 
48  public Texture Texture
49  {
50  get
51  {
52  return Parameters.Get(TexturingKeys.Texture0);
53  }
54 
55  set
56  {
57  Parameters.Set(TexturingKeys.Texture0, value);
58  }
59  }
60 
61  public SamplerState Sampler
62  {
63  get
64  {
65  return Parameters.Get(TexturingKeys.Sampler);
66  }
67 
68  set
69  {
70  Parameters.Set(TexturingKeys.Sampler, value);
71  }
72  }
73  }
74 }
Represents a color in the form of rgba.
Definition: Color4.cs:42
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
SiliconStudio.Core.Mathematics.Color Color
Definition: ColorPicker.cs:14
Represents a 32-bit color (4 bytes) in the form of RGBA (in byte order: R, G, B, A).
Definition: Color.cs:16
SimpleEffect(GraphicsDevice graphicsDevice)
Definition: SimpleEffect.cs:10
Base class for texture resources.
Definition: Texture.cs:38
Represents a 4x4 mathematical matrix.
Definition: Matrix.cs:47