public OGLPipeline(OGLConstBuffer Buffer, OGLRasterizer Rasterizer, OGLShader Shader) { this.Buffer = Buffer; this.Rasterizer = Rasterizer; this.Shader = Shader; //These values match OpenGL's defaults Old = new GalPipelineState { FrontFace = GalFrontFace.CCW, CullFaceEnabled = false, CullFace = GalCullFace.Back, DepthTestEnabled = false, DepthWriteEnabled = true, DepthFunc = GalComparisonOp.Less, DepthRangeNear = 0, DepthRangeFar = 1, StencilTestEnabled = false, StencilBackFuncFunc = GalComparisonOp.Always, StencilBackFuncRef = 0, StencilBackFuncMask = UInt32.MaxValue, StencilBackOpFail = GalStencilOp.Keep, StencilBackOpZFail = GalStencilOp.Keep, StencilBackOpZPass = GalStencilOp.Keep, StencilBackMask = UInt32.MaxValue, StencilFrontFuncFunc = GalComparisonOp.Always, StencilFrontFuncRef = 0, StencilFrontFuncMask = UInt32.MaxValue, StencilFrontOpFail = GalStencilOp.Keep, StencilFrontOpZFail = GalStencilOp.Keep, StencilFrontOpZPass = GalStencilOp.Keep, StencilFrontMask = UInt32.MaxValue, BlendEnabled = false, BlendSeparateAlpha = false, BlendEquationRgb = 0, BlendFuncSrcRgb = GalBlendFactor.One, BlendFuncDstRgb = GalBlendFactor.Zero, BlendEquationAlpha = 0, BlendFuncSrcAlpha = GalBlendFactor.One, BlendFuncDstAlpha = GalBlendFactor.Zero, PrimitiveRestartEnabled = false, PrimitiveRestartIndex = 0 }; for (int Index = 0; Index < GalPipelineState.RenderTargetsCount; Index++) { Old.ColorMasks[Index] = ColorMaskRgba.Default; } }
public OpenGLRenderer() { Blend = new OGLBlend(); FrameBuffer = new OGLFrameBuffer(); Rasterizer = new OGLRasterizer(); Shader = new OGLShader(); Texture = new OGLTexture(); ActionsQueue = new ConcurrentQueue <Action>(); }
public OGLRenderer() { Buffer = new OGLConstBuffer(); Texture = new OGLTexture(); RenderTarget = new OGLRenderTarget(Texture as OGLTexture); Rasterizer = new OGLRasterizer(); Shader = new OGLShader(Buffer as OGLConstBuffer); Pipeline = new OGLPipeline(Buffer as OGLConstBuffer, Rasterizer as OGLRasterizer, Shader as OGLShader); ActionsQueue = new ConcurrentQueue <Action>(); }