1 module evael.renderer.graphics_command; 2 3 public 4 { 5 import evael.renderer.graphics_buffer; 6 import evael.renderer.pipeline; 7 import evael.renderer.texture; 8 import evael.renderer.enums; 9 } 10 11 import evael.utils.color; 12 import evael.lib.memory; 13 14 /** 15 * Command is the base class for all the API commands. 16 */ 17 abstract class GraphicsCommand : NoGCClass 18 { 19 protected Pipeline m_pipeline; 20 21 protected VertexBuffer m_vertexBuffer; 22 protected IndexBuffer m_indexBuffer; 23 24 /** 25 * Command constructor. 26 */ 27 @nogc 28 public this(Pipeline pipeline) 29 { 30 this.m_pipeline = pipeline; 31 32 this.verifyPipeline(); 33 } 34 35 /** 36 * Command destructor. 37 */ 38 @nogc 39 public ~this() 40 { 41 } 42 43 /** 44 * Specifies clear values for the color buffers. 45 * Params: 46 * color : clear color 47 */ 48 @nogc 49 public void clearColor(in Color color = Color.Black) const nothrow; 50 51 @nogc 52 protected void verifyPipeline() const 53 { 54 assert(this.m_pipeline.shader !is null); 55 } 56 57 /** 58 * Properties. 59 */ 60 @nogc 61 @property nothrow 62 { 63 public void pipeline(Pipeline value) 64 { 65 this.m_pipeline = value; 66 } 67 68 public void vertexBuffer(VertexBuffer value) 69 { 70 this.m_vertexBuffer = value; 71 } 72 73 public void indexBuffer(IndexBuffer value) 74 { 75 this.m_indexBuffer = value; 76 } 77 } 78 }