使用额外的alpha通道绘制精灵
问题描述:
我可以使用alpha通道精细绘制图像, 但无法通过颜色参数修改Alpha通道。只有8位纹理使用额外的alpha通道绘制精灵
void DrawRect(float x, float y, int width, int height, DWORD color)
{
imgPosition.x = x;
imgPosition.y = y;
imgSize.left = 0;
imgSize.right = width;
imgSize.top = 0;
imgSize.bottom = height;
d3dImage->Draw(texWhite, &imgSize, NULL, &imgPosition, color);
}
答
作品:
尝试这样:
d3dImage->Begin(D3DXSPRITE_ALPHABLEND|D3DXSPRITE_SORT_DEPTH_BACKTOFRONT|D3DXSPRITE_DO_NOT_ADDREF_TEXTURE);
我使用精灵呈现矩形和图像。