public ThreadedVertexBuffer(ThreadedGraphicsContext device, IVertexBuffer <Vertex> vertexBuffer)
 {
     this.device = device;
     bind        = vertexBuffer.Bind;
     setData1    = tuple => { var t = (Tuple <Vertex[], int>)tuple; vertexBuffer.SetData(t.Item1, t.Item2); device.ReturnVertices(t.Item1); };
     setData2    = tuple => { var t = (Tuple <IntPtr, int, int>)tuple; vertexBuffer.SetData(t.Item1, t.Item2, t.Item3); return(null); };
     dispose     = vertexBuffer.Dispose;
 }
 public ThreadedFrameBuffer(ThreadedGraphicsContext device, IFrameBuffer frameBuffer)
 {
     this.device = device;
     getTexture  = () => frameBuffer.Texture;
     bind        = frameBuffer.Bind;
     unbind      = frameBuffer.Unbind;
     dispose     = frameBuffer.Dispose;
 }
Exemplo n.º 3
0
        public ThreadedFrameBuffer(ThreadedGraphicsContext device, IFrameBuffer frameBuffer)
        {
            this.device = device;
            getTexture  = () => frameBuffer.Texture;
            bind        = frameBuffer.Bind;
            unbind      = frameBuffer.Unbind;
            dispose     = frameBuffer.Dispose;

            enableScissor  = rect => frameBuffer.EnableScissor((Rectangle)rect);
            disableScissor = frameBuffer.DisableScissor;
        }
 public ThreadedShader(ThreadedGraphicsContext device, IShader shader)
 {
     this.device   = device;
     prepareRender = shader.PrepareRender;
     setBool       = tuple => { var t = (Tuple <string, bool>)tuple; shader.SetBool(t.Item1, t.Item2); };
     setMatrix     = tuple => { var t = (Tuple <string, float[]>)tuple; shader.SetMatrix(t.Item1, t.Item2); };
     setTexture    = tuple => { var t = (Tuple <string, ITexture>)tuple; shader.SetTexture(t.Item1, t.Item2); };
     setVec1       = tuple => { var t = (Tuple <string, float>)tuple; shader.SetVec(t.Item1, t.Item2); };
     setVec2       = tuple => { var t = (Tuple <string, float[], int>)tuple; shader.SetVec(t.Item1, t.Item2, t.Item3); };
     setVec3       = tuple => { var t = (Tuple <string, float, float>)tuple; shader.SetVec(t.Item1, t.Item2, t.Item3); };
     setVec4       = tuple => { var t = (Tuple <string, float, float, float>)tuple; shader.SetVec(t.Item1, t.Item2, t.Item3, t.Item4); };
 }
Exemplo n.º 5
0
 public ThreadedTexture(ThreadedGraphicsContext device, ITextureInternal texture)
 {
     this.device    = device;
     id             = texture.ID;
     getScaleFilter = () => texture.ScaleFilter;
     setScaleFilter = value => texture.ScaleFilter = (TextureScaleFilter)value;
     getSize        = () => texture.Size;
     setEmpty       = tuple => { var t = (ValueTuple <int, int>)tuple; texture.SetEmpty(t.Item1, t.Item2); };
     getData        = () => texture.GetData();
     setData1       = colors => { texture.SetData((uint[, ])colors); return(null); };
     setData2       = tuple => { var t = (ValueTuple <byte[], int, int>)tuple; texture.SetData(t.Item1, t.Item2, t.Item3); };
     dispose        = texture.Dispose;
 }
 public Message(ThreadedGraphicsContext device)
 {
     this.device = device;
 }