did a bunch of other stuff, sorry about the monolithic changeset but the diffs should be understandable enough

This commit is contained in:
Bill Meltsner
2010-04-15 10:19:01 -04:00
parent 17d7770eec
commit f8f812a719
18 changed files with 338 additions and 237 deletions
+14 -2
View File
@@ -34,7 +34,6 @@ namespace opengl
: data(data), width((float)data->getWidth()), height((float)data->getHeight()), texture(0)
{
data->retain();
data->getWidth();
memset(vertices, 255, sizeof(vertex)*4);
@@ -94,6 +93,9 @@ namespace opengl
bool Glyph::loadVolatile()
{
GLint format = GL_RGBA;
if (data->getFormat() == love::font::GlyphData::FORMAT_LUMINOSITY_ALPHA) format = GL_LUMINANCE_ALPHA;
glGenTextures(1,&texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -108,7 +110,7 @@ namespace opengl
(GLsizei)width,
(GLsizei)height,
0,
GL_RGBA,
format,
GL_UNSIGNED_BYTE,
data->getData());
@@ -124,6 +126,16 @@ namespace opengl
texture = 0;
}
}
float Glyph::getWidth() const
{
return width;
}
float Glyph::getHeight() const
{
return height;
}
} // opengl
} // graphics