I'm converting a game I started in SDL over to DirectX 9 as my game will eventually contain 3D elements.
At the moment I'm working on the GUI. Each GUI element has a draw function and in SDL this simply blitted a texture onto the screen at the control's co-ordinates.
In directx I'm planning to do this with textured quads, I have a general idea on how it works but I'd like to know I'm on the right track or if there is a much better solution.
- Before calling any draw() meathod my GUI manager will call IDirect3DDevice::SetTransform to set the device to render from transformed model co-ordinates.
- Each draw function will call SetTexture to set the correct texture from an array of GUI textures.
- Then I must call SetTextureStageState for the texture (maybe this should just be called once before drawing all of the controls?)
- Then call DrawPrimitive to draw the control.
Should each control have it's own vertex buffer for storing co-ordinates?
Thanx for any advice