DirectX - adding a bitmap to a drawing
-
Hi, I'm new to DirectX so sorry if this is a stupid question. I'm trying to draw stuff and add a bitmap (texture) at the same time. After I draw some rectangles I say:
this.OnCreateVertexBuffer(vb, null); device.SetTexture(0, tex); device.VertexFormat = CustomVertex.PositionColoredTextured.Format; device.SetStreamSource(0, vb, 0); device.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2);
but the rectangles vanish just afterOnCreateVertexBuffer();
though the bitmap does appear. What do I need to do so that I can have both my rectangles and the texture at the same time? Let me know if you need more of my code to see what I'm screwing up. Thanks so much! :) Mel -
Hi, I'm new to DirectX so sorry if this is a stupid question. I'm trying to draw stuff and add a bitmap (texture) at the same time. After I draw some rectangles I say:
this.OnCreateVertexBuffer(vb, null); device.SetTexture(0, tex); device.VertexFormat = CustomVertex.PositionColoredTextured.Format; device.SetStreamSource(0, vb, 0); device.DrawPrimitives(PrimitiveType.TriangleStrip, 0, 2);
but the rectangles vanish just afterOnCreateVertexBuffer();
though the bitmap does appear. What do I need to do so that I can have both my rectangles and the texture at the same time? Let me know if you need more of my code to see what I'm screwing up. Thanks so much! :) Mel