Skip to main content
gamedev.net
🔒 Locked

simple fill Rect

Started by lo1989 2 replies 1.2k views
Original Post
lo1989
lo1989
whats the simplest solution to drwaw a filled rect? is it possible without vertices?
neneboricua19
neneboricua19
Simplest way to do it is probably to just draw 2 triangles in screenspace. Basically the same way its done in Tutorial 2 from the SDK. Set the colors of the vertices to whatever you want and render it.

The only way to do it without using vertices at all would be to lock the actual backbuffer and fill in the pixels yourself. You'd have to create a backbuffer which is lockable (performance hit) and then lock the sections you need during rendering and fill them yourself (large performance hit).

neneboricua
Endurion
Endurion
You can also simply use the Clear function as you can provide a rect and a z value.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
don
don
If the surface is from D3DMPOOL_DEFAULT you can use IDirect3DDevice9::ColorFill.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.