Mercurial > projects > mde
comparison mde/gl/draw.d @ 48:a98ffb64f066
Implemented font rendering (grayscale only; i.e. non-LCD).
FontTexture creates a texture and caches glyphs.
Font supports multiple styles/faces, loaded from config file (should probably be loaded via Options instead).
TextBlock cache for glyph placement within a string.
committer: Diggory Hardy <diggory.hardy@gmail.com>
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 31 May 2008 12:40:26 +0100 |
parents | 0fd51d2c6c8a |
children | bca7e2342d77 |
comparison
equal
deleted
inserted
replaced
47:e0839643ff52 | 48:a98ffb64f066 |
---|---|
24 import derelict.opengl.gl; | 24 import derelict.opengl.gl; |
25 | 25 |
26 import tango.time.Time; // TimeSpan (type only; unused) | 26 import tango.time.Time; // TimeSpan (type only; unused) |
27 import tango.util.log.Log : Log, Logger; | 27 import tango.util.log.Log : Log, Logger; |
28 | 28 |
29 import mde.resource.font; | |
29 private Logger logger; | 30 private Logger logger; |
30 static this () { | 31 static this () { |
31 logger = Log.getLogger ("mde.gl.draw"); | 32 logger = Log.getLogger ("mde.gl.draw"); |
32 } | 33 } |
33 | 34 |
35 // Temporary draw function | 36 // Temporary draw function |
36 void draw (TimeSpan) { | 37 void draw (TimeSpan) { |
37 glClear(GL_COLOR_BUFFER_BIT); | 38 glClear(GL_COLOR_BUFFER_BIT); |
38 | 39 |
39 gui.draw (); | 40 gui.draw (); |
41 FontStyle.drawTexture; | |
40 | 42 |
41 GLenum err = glGetError(); | 43 GLenum err = glGetError(); |
42 if (err != GL_NO_ERROR) { | 44 if (err != GL_NO_ERROR) { |
43 char[128] tmp; | 45 char[128] tmp; |
44 logger.error (logger.format (tmp, "GL error: {}", err)); | 46 logger.error (logger.format (tmp, "GL error: {}", err)); |