Untransformed 2d Imagry

Slade

Newcomer
Joined
Sep 17, 2003
Messages
8
I'm attempting to convert my UI code that is successfully using TransformedTextured to code that uses PositionTextured so that my imagry changes size to fit when resolution is changed.

From my understanding I simply need to set my view and world matrices to Identity and then setup my projection matrix to fit the screen.. I've put together a little test app that does it as such.

device.Transform.World = Matrix.Identity;
device.Transform.View = Matrix.Identity;
device.Transform.Projection = Matrix.OrthoOffCenterLH(0, 640, 480, 0, 0, 1);

However I'm not getting the results I expect.

Does anyone have any ideas?

(I've attached the complete source to my test)
 

Attachments

Last edited:
I've actually narrowed it down to a problem with alpha

// These two lines cause the code to render nothing
device.RenderState.SourceBlend = Blend.SourceAlpha;
device.RenderState.DestinationBlend = Blend.InvSourceAlpha;

// These two lines cause it to work.
device.RenderState.SourceBlend = Blend.One;
device.RenderState.DestinationBlend = Blend.Zero;

this kills the alpha blending however :/

I guess now I'm lost on why this works as I'd like it to with transformed vertices, but not with position ones.
 
i dont know... but u can go and pretend stupid (like me) and do this

- dont change the SourceBlend nor the DestinationBlend properties
- use color keying when painting the images (this keeps the alpha values).
 
Back
Top