diff options
author | Joe Wilm <joe@jwilm.com> | 2016-05-21 11:08:50 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-05-21 11:08:50 -0700 |
commit | 855ae756973990be35186d554562a75f692c06e7 (patch) | |
tree | 82506bd1a0e75cf3d04cac86e0043fcc0dd6ba8f /src/renderer | |
parent | c70acbac0b721ea2f1b1442898c22aee0f360ef2 (diff) | |
download | alacritty-855ae756973990be35186d554562a75f692c06e7.tar.gz alacritty-855ae756973990be35186d554562a75f692c06e7.zip |
Add render time meter
Optimization is impossible without measurement!
Diffstat (limited to 'src/renderer')
-rw-r--r-- | src/renderer/mod.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index 4666981b..b88357b3 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -32,6 +32,13 @@ pub struct PackedVertex { v: f32, } +#[derive(Debug)] +pub struct Rgb { + pub r: f32, + pub g: f32, + pub b: f32, +} + impl QuadRenderer { // TODO should probably hand this a transform instead of width/height pub fn new(width: u32, height: u32) -> QuadRenderer { @@ -92,11 +99,11 @@ impl QuadRenderer { } } - pub fn render(&self, glyph: &Glyph, x: f32, y: f32) { + pub fn render(&self, glyph: &Glyph, x: f32, y: f32, color: &Rgb) { self.program.activate(); unsafe { // set color - gl::Uniform3f(self.program.u_color, 0.917, 0.917, 0.917); + gl::Uniform3f(self.program.u_color, color.r, color.g, color.b); } let rect = get_rect(glyph, x, y); |