00001 #pragma once
00002 #include "common.h"
00003 #include "Vector.h"
00004
00006
00013 class Font
00014 {
00015 public:
00019 Font() : m_pos(0,0,-1)
00020 {
00021 m_text = "";
00022 };
00023
00028 Font(std::string text) : m_pos(0,0,-1)
00029 {
00030 m_text = text;
00031 };
00032
00037 void SetText(std::string text)
00038 {
00039 m_text = text;
00040 };
00041
00046 std::string GetText()
00047 {
00048 return m_text;
00049 };
00050
00055 void SetPosition(Vector pos)
00056 {
00057 m_pos = pos;
00058 };
00059
00064 Vector GetPosition()
00065 {
00066 return m_pos;
00067 };
00068
00075 void Draw(float x, float y, float z)
00076 {
00077 const unsigned char* vpMessage = (const unsigned char*) m_text.c_str();
00078 glColor4f(1.0f,1.0f,1.0f,1.0f);
00079 glRasterPos3f(x, y, z);
00080 glutBitmapString(GLUT_BITMAP_HELVETICA_12,vpMessage);
00081 glRasterPos2f(0.0f,0.0f);
00082 };
00083
00087 void Draw()
00088 {
00089 const unsigned char* vpMessage = (const unsigned char*) m_text.c_str();
00090 glColor4f(1.0f,1.0f,1.0f,1.0f);
00091 glRasterPos3f(m_pos.GetX(), m_pos.GetY(), m_pos.GetZ());
00092
00093 glutBitmapString(GLUT_BITMAP_HELVETICA_12,vpMessage);
00094 glRasterPos2f(0.0f,0.0f);
00095 };
00096
00097 private:
00098 std::string m_text;
00099 Vector m_pos;
00100 };