c = # of characters
its probably fine unless you have 1 million characters in your text. each character is just a rectangle aka 2 triangles. ideally the game maker text rendering uses a texture atlas so that should be decently cheap. likely the most expensive part of the operation (cpu-side) is generating the rectangles that the characters have to fill.
your method:
generates
c*2*9 triangles
ideally requires 0 texture swaps
requires 0 buffer swaps
a good test is to try a really long string with your current system and see what happens. if performance is bad, you could try the following method:
- render the text to a surface
- render the surface to the screen with an offset and a color to give the text an outline
- render surface to the screen to draw the text
this method:
generates (
c+9)*2 triangles
probably requires 2 texture swaps (switch to surface, then back to game atlas)
requires 2 buffer swaps (switch to surface, then back to screen)