So, I’m learning how to create a text editor, and I’m using Rust for that. I don’t think it’ll grow to be an actual editor in the future, but I wanted to do it in a fast language. I am trying to use Piston as far as possible and until now I got everything I needed. I’m even creating the components myself (I’m not using conrod).
The code itself is hosted at https://github.com/Razican/Editor
Text::draw() to draw the text, as you can see here: https://github.com/Razican/Editor/blob/master/src/main.rs#L126. For a small text file I’m getting really low frame rates. Of course the buffer is still not optimized, but the main problem gets when rendering the text. The CPU gets really hot, in fact, so it’s doing everything it can.
What could it be? can it be improved?
And about resizing, if you try it out, you’ll see how the text gets smaller if you make the window bigger. Why could that be?
Thanks in advance for the help!