RazerWriter
Freshman
- Joined
- Jun 26, 2003
- Messages
- 32
I don't get it, I have had years of experience with DX and now somehow things are getting screwy with DX9. First it was the tex coords, which it took a while for me to figure out why it was acting funny, now its transparency. I don't know why, but Dx is drawing every method except simple colorkey transparency!! Can you beleive it, I don't know what's up! Why won't it do it.
Here is the code, maybe i need another eye to figure this one out.
Okay, so I'm loading the texture:
ColorKey = Manganta
Now I'm setting the alpha values:
And, finally I'm drawing it:
The results should be a nice sprite with transparency, but I get an image with a blackbackground where the transparecny should be !!! What's up??
Please help.. thank you so very much
Here is the code, maybe i need another eye to figure this one out.
Okay, so I'm loading the texture:
ColorKey = Manganta
LoadTexture = TextureLoader.FromFile(device, strFilename, nW, nH, 1, 0, Format.X8R8G8B8, Pool.Managed, 3, 3, ColorKey.ToArgb)
Now I'm setting the alpha values:
device.RenderState.AlphaBlendEnable = True
device.RenderState.SourceBlend = Blend.SourceAlpha
device.RenderState.DestinationBlend = Blend.InvSourceAlpha
And, finally I'm drawing it:
device.SetStreamSource(0, vertexBuffer, 0)
device.VertexFormat = CustomVertex.TransformedColoredTextured.Format
device.SetTexture(0, Texture)
device.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2)
The results should be a nice sprite with transparency, but I get an image with a blackbackground where the transparecny should be !!! What's up??
Please help.. thank you so very much