如何一次性绘制多个纹理??
我的窗体由这4个角和4个边框组成,并且这些部分被放在了同一张纹理图片里。
如果渲染一个窗体,要调用8次DrawPrimitiveUP()函数的话,感觉有点不划算。
有什么办法可以快速把这几个部分绘制出来?
是可以一次性绘制出来,还是只能调用8次DrawPrimitiveUP() ??
CustomVertex objData[] ={ // 左上角 { x, y, 0, 1, col, LU_left/width, LU_top/height }, { LU_right-LU_left+x, y, 0, 1, col, LU_right/width, LU_top/height }, { LU_right-LU_left+x, LU_bottom-LU_top+y, 0, 1, col, LU_right/width, LU_bottom/height }, { LU_right-LU_left+x, LU_bottom-LU_top+y, 0, 1, col, LU_right /width, LU_bottom/height }, { x, LU_bottom-LU_top+y, 0, 1, col, LU_left/width, LU_bottom/height }, { x, y, 0, 1, col, LU_left/width, LU_top/height }, // 左下角 { x, y, 0, 1, col, LD_left/width, LD_top/height }, { LD_right-LD_left+x, y, 0, 1, col, LD_right/width, LD_top/height }, { LD_right-LD_left+x, LD_bottom-LD_top+y, 0, 1, col, LD_right/width, LD_bottom/height }, { LD_right-LD_left+x, LD_bottom-LD_top+y, 0, 1, col, LD_right /width, LD_bottom/height }, { x, LD_bottom-LD_top+y, 0, 1, col, LD_left/width, LD_bottom/height }, { x, y, 0, 1, col, LD_left/width, LD_top/height }, // 右上角 { x, y, 0, 1, col, RU_left/width, RU_top/height }, { RU_right-RU_left+x, y, 0, 1, col, RU_right/width, RU_top/height }, { RU_right-RU_left+x, RU_bottom-RU_top+y, 0, 1, col, RU_right/width, RU_bottom/height }, { RU_right-RU_left+x, RU_bottom-RU_top+y, 0, 1, col, RU_right /width, RU_bottom/height }, { x, RU_bottom-RU_top+y, 0, 1, col, RU_left/width, RU_bottom/height }, { x, y, 0, 1, col, RU_left/width, RU_top/height }, // 右下角 { x, y, 0, 1, col, RD_left/width, RD_top/height }, { RD_right-RD_left+x, y, 0, 1, col, RD_right/width, RD_top/height }, { RD_right-RD_left+x, RD_bottom-RD_top+y, 0, 1, col, RD_right/width, RD_bottom/height }, { x, RD_bottom-RD_top+y, 0, 1, col, RD_right /width, RD_bottom/height }, { x, RD_bottom-RD_top+y, 0, 1, col, RD_left/width, RD_bottom/height }, { x, y, 0, 1, col, RD_left/width, RD_top/height }// 4个边框顶点略// ...};