Downloads: ZeroOne Realm
2D Lines and filled rects in Direct3D
I am using D3DXSprite to blit 2D sprites, though I need to be able to blit single pixel lines and rects as like in DirectDraw using the rectangle() and lintto().
Is this possible?
Or would I need to blit the lines with textures?
Pls supply the code if possible.
Thankx in advance.
Thanks ill look into it, in the mean time are there any tutorials covering this topic?
Edited by - SikCiv on October 18, 2001 12:30:20 AM
Edited by - SikCiv on October 18, 2001 12:30:20 AM
For filled rectangles you can always "cheat" and use the IDirect3DDevice8::Clear function and pass in the RECT you want to draw.
This method isn''t the geatest since it doesn''t support the alpha colour and your out of luck if you want to do any transformations on it.
-------
Andrew
This method isn''t the geatest since it doesn''t support the alpha colour and your out of luck if you want to do any transformations on it.
-------
Andrew
There are some tutorials on FlipCode, but basically create a bunch of vertices, draw them as a line strip and voila, connected lines. Works exactly the same as triangles.
The only problem is that DX does not have the notion of line width (OpenGL rules, man!) so you have to get clever if you want thick lines. I do it by jittering the line and redrawing it several times, others draw very thin rectangles.
The only problem is that DX does not have the notion of line width (OpenGL rules, man!) so you have to get clever if you want thick lines. I do it by jittering the line and redrawing it several times, others draw very thin rectangles.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement