Wouldn't compile on linux due memset and strlen not members of std-namespace
Signed-off-by: James Turk <james.p.turk@gmail.com>
This commit is contained in:
parent
ec14f0c1b5
commit
97a65f92d1
@ -36,6 +36,8 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "GLFT_Font.hpp"
|
#include "GLFT_Font.hpp"
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
|
||||||
// static members
|
// static members
|
||||||
FT_Library FTLibraryContainer::library_;
|
FT_Library FTLibraryContainer::library_;
|
||||||
@ -162,7 +164,7 @@ void GLFT_Font::open(const std::string& filename, unsigned int size)
|
|||||||
|
|
||||||
// create and zero the memory
|
// create and zero the memory
|
||||||
unsigned char* image = new unsigned char[imageHeight * imageWidth];
|
unsigned char* image = new unsigned char[imageHeight * imageWidth];
|
||||||
std::memset(image, 0, imageHeight * imageWidth);
|
memset(image, 0, imageHeight * imageWidth);
|
||||||
|
|
||||||
// These are the position at which to draw the next glyph
|
// These are the position at which to draw the next glyph
|
||||||
size_t x = MARGIN;
|
size_t x = MARGIN;
|
||||||
@ -273,7 +275,7 @@ void GLFT_Font::drawText(float x, float y, const char *str, ...) const
|
|||||||
glBindTexture(GL_TEXTURE_2D, texID_);
|
glBindTexture(GL_TEXTURE_2D, texID_);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslated(x,y,0);
|
glTranslated(x,y,0);
|
||||||
for(unsigned int i=0; i < std::strlen(buf); ++i)
|
for(unsigned int i=0; i < strlen(buf); ++i)
|
||||||
{
|
{
|
||||||
unsigned char ch( buf[i] - SPACE ); // ch-SPACE = DisplayList offset
|
unsigned char ch( buf[i] - SPACE ); // ch-SPACE = DisplayList offset
|
||||||
// replace characters outside the valid range with undrawable
|
// replace characters outside the valid range with undrawable
|
||||||
|
Loading…
Reference in New Issue
Block a user