Code Editor
I'm currently in the process of writing an code editor. I want my editor to be fast. I don't want there to be noticable delay. I don't need a lot of features in a code editor. The only features I want are syntax highlighting, vim keybinds and info about the function signature I try to call.
To keep the editor somewhat cross-platform-compatible, I decided to use libraries supported by most platforms. The editor uses GLFW for window creation, FreeType for font loading, and Treesitter for syntax highlighting. The actual renderer relies on OpenGL 4.3 or higher. It uses SSBOs and a compute shader to do its rendering. Unfortunately, this means that MacOS is not supported.
One of the design decision I made for this editor is that the editor exclusively supports monospaced fonts for the code editing. This constraint allows for more efficient and simplified rendering. Other UI elements support non-monospaced fonts. The main code editing area is split up into cells, making up a grid, with each cell being of equal width and height. Each cell stores information about color, effects and, most importantly, which glyph it holds. The glyph encodes a position into the glyphmap. The glyphmap is a prerendered texture, regenerated using FreeType each time the font or the font size changes, and updated for first-time uses of specific symbols. The glyphmap and the cells are uploaded to the GPU as a texture and as a SSBO, respectively. The compute shader renders the cells to a texture, which is thereafter rendered to the screen and combined with other UI elements.
View on GitHub (Not yet open sourced)