Most of the graphics are stored in png format, hence I found textures to be very useful (easy to load png files with "D3DXCreateTextureFromFile").
In order to be able to draw the textures on the screen in 2D, I used one sprite (LPD3DXSPRITE). This seemed like a simple solution and works perfectly fine for textures.
Now I would like to additionally draw some colored rectangles in between the drawing of images. Surprisingly for me, sprites in DirectX don't support any kind of primitive drawing. There is only one "Draw" method that will render a texture to the display device.
So far I've been pondering about the following solutions:
1. Create textures that contain a certain area of solid color. Then draw any kind of rectangle by aligning the small single-colored textures next to each other. I guess it will work but seems really cumbersome, as I will need to write lots of code to manage the color textures and do the drawing.
2. Find a better way to draw my images to the display device, so that i can mix the image-drawing with primitive drawing operations. So far I couldn't figure out how to do it. I suspect I will need some kind of intermediate "surface" object to draw my texture on.
3. Mix sprite drawing operations with device drawing operations. This would require to split up my drawing code to use many different sprites for different purposes. I will need to call sprite.Begin/End very often. On the whole I don't like this idea because it seems "messy".
Thank you for any kind of feedback that will point me in the right direction!






