Commit Graph

9 Commits

Author SHA1 Message Date
Joe Wilm 2f98871b02
Refactor renderer functions out of main.rs
This moves the rendering logic to draw the grid, to draw strings, and to
draw the cursor into the renderere module. In addition to being an
organizational improvement, this also allowed for some optimizations
managing OpenGL state. Render times for a moderate screen of text
dropped from ~10ms to ~4ms.
2016-06-02 20:27:07 -07:00
Joe Wilm 30ec145109
Initial support for Terminal Emulation (woo!)
This patch introduces basic support for terminal emulation. Basic means
commands that don't use paging and are not full screen applications like
vim or tmux. Some paging applications are working properly, such as as
`git log`. Other pagers work reasonably well as long as the help menu is
not accessed.

There is now a central Rgb color type which is shared by the renderer,
terminal emulation, and the pty parser.

The parser no longer owns a Handler. Instead, a mutable reference to a
Handler is provided whenever advancing the parser. This resolved some
potential ownership issues (eg parser owning the `Term` type would've
been unworkable).
2016-06-02 19:42:28 -07:00
Joe Wilm 855ae75697
Add render time meter
Optimization is impossible without measurement!
2016-05-21 11:08:50 -07:00
Joe Wilm c70acbac0b
Correct sub-pixel font rendering with OpenGL
Uses the GL_ARB_blend_func_extended to get single-pass, per-channel
alpha blending. gl_generator is now used instead of gl to enable the
extension.

The background color is removed since that presumably needs to run in a
separate pass.
2016-05-20 21:36:28 -07:00
Joe Wilm e794bc11b9
Use subpixel font rendering
OpenGL only supports shared alpha blending. Subpixel font rendering
requires using the font RGB values as alpha masks for the corresponding
RGB channels. To support this, blending is implemented in the fragment
shader.
2016-04-11 08:05:19 -07:00
Joe Wilm 97c1a17bf1 Cleanup PackedVertex initialization 2016-02-27 13:16:40 -08:00
Joe Wilm 77cfb7b5cd Implement per vertex struct 2016-02-27 13:08:39 -08:00
Joe Wilm eac2d01af4 Organize buffer data into struct 2016-02-26 22:30:42 -08:00
Joe Wilm 07640b392c Move rendering stuff into renderer mod 2016-02-25 21:02:01 -08:00