public static void DrawSubImages(this SimpleRectTextureShader shader, float[] srcDestList, float scale) { unsafe { fixed(float *head = &srcDestList[0]) { shader.UnsafeDrawSubImages(head, srcDestList.Length, scale); } } }
public static void DrawSubImage(this SimpleRectTextureShader shader, float srcLeft, float srcTop, float srcW, float srcH, float targetLeft, float targetTop) { //TODO: review float array here,use buffer instead unsafe { float *srcDestList = stackalloc float[6]; { srcDestList[0] = srcLeft; srcDestList[1] = srcTop; srcDestList[2] = srcW; srcDestList[3] = srcH; srcDestList[4] = targetLeft; srcDestList[5] = targetTop; } shader.UnsafeDrawSubImages(srcDestList, 6, 1); } }
public static void RenderSubImages(this SimpleRectTextureShader shader, GLBitmap bmp, float[] srcDestList, float scale) { shader.LoadGLBitmap(bmp); shader.DrawSubImages(srcDestList, scale); }