Example #1
0
        public void UpdateTexture()
        {
            if (!Dirty)
            {
                return;
            }
            Dirty = false;

            // using this method to software GDI+ render to a bitmap, and then copy to texture
            // http://florianblock.blogspot.com/2008/06/copying-dynamically-created-bitmap-to.html

            ImageBuffer bitmap = this.RepaintAGG(out gdiSize);

            textureSize = new Size(bitmap.Width, bitmap.Height);

            // download bits into a texture...
            textureSurface.loadFromImageBuffer(bitmap, mipmap: false);
        }