V
Vic
Guest
I took a look at the DirectX code and the FontEngine yesterday. One thing that struck me was the way that text is drawn to screen. Currently you draw all strings on screen using two triangles and four vertices per letter. This seems to be done every frame.
Wouldn't it be better to render the text once to a texture and then simply use that texture from then on to display the text using just two triangles? The same would be applied to all controls, i.e. render them once to a texture and then use that one until the control changes appearance in one way or another. To reduce the amount of texture switching, all controls could be drawn to the same offscreen surface just on different locations (a little bit tricky, but can be done).
Additionally, each control could have a matrix transformation attached to it to translate and/or rotate it without needing to update the vertex buffer. This way you do not need to lock and update the vertex buffer at all. however, I'm not sure if this would be better than locking and updating the vertices since the amount of vertices is quite small for each control.
If you want, I could take a closer look and see if I could implement some of this...
Wouldn't it be better to render the text once to a texture and then simply use that texture from then on to display the text using just two triangles? The same would be applied to all controls, i.e. render them once to a texture and then use that one until the control changes appearance in one way or another. To reduce the amount of texture switching, all controls could be drawn to the same offscreen surface just on different locations (a little bit tricky, but can be done).
Additionally, each control could have a matrix transformation attached to it to translate and/or rotate it without needing to update the vertex buffer. This way you do not need to lock and update the vertex buffer at all. however, I'm not sure if this would be better than locking and updating the vertices since the amount of vertices is quite small for each control.
If you want, I could take a closer look and see if I could implement some of this...