That's some quick response!
sf::RenderWindow win(sf::VideoMode(800, 600, 32), "Untitled!", sf::Style::Close, sf::ContextSettings(24, 8, 0, 1, 5));
win.Show(true);
win.SetActive();
Timer myTime;
Uint32 fps = 0;
Str typed = (Char)20140;
typed += (Char)20540;
typed += (Char)20940;
sf::Image img;
img.LoadFromFile(Str("Data/Raw/image.png").GetFilePath());
sf::Font font;
font.LoadFromFile(Str("Data/Raw/font2.ttc").GetFilePath());
glEnable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
sf::Text text;
while(1)
{
++fps;
if(myTime.IsOver())
{
SetWindowText(GetActiveWindow(), StrHelper.Put("Untitled! - %@1 fps", fps).ToWCString());
fps = 0;
myTime.SetTimer(1.0f);
}
sf::Event e;
while(win.GetEvent(e))
{
if(e.Type == sf::Event::Closed)
{
win.Close();
return;
}
if(e.Type == sf::Event::TextEntered)
{
if(e.Text.Unicode == '\b')
typed = typed.Substr(0, typed.GetSize()-1);
else
typed += (Char)e.Text.Unicode;
}
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//glViewport(0, 0, 400, 300);
// glMatrixMode(GL_PROJECTION);
// glLoadIdentity();
// gluPerspective(45.f, 1.333f, 1.f, 500.f);
// glMatrixMode(GL_MODELVIEW);
// glLoadIdentity();
// glTranslatef(0.f, 0.f, -200.f);
// glRotatef(Time.GetElapsedTime() * 50, 1.f, 0.f, 0.f);
// glRotatef(Time.GetElapsedTime() * 30, 0.f, 1.f, 0.f);
// glRotatef(Time.GetElapsedTime() * 90, 0.f, 0.f, 1.f);
// img.Bind();
// glBegin(GL_QUADS);
// glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
// //glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
// glTexCoord2f(0, 0);
// glVertex3f(-50.f, -50.f, -50.f);
// glTexCoord2f(1, 0);
// glVertex3f(-50.f, 50.f, -50.f);
// glTexCoord2f(1, 1);
// glVertex3f( 50.f, 50.f, -50.f);
// glTexCoord2f(0, 1);
// glVertex3f( 50.f, -50.f, -50.f);
// //glColor4f(0.0f, 1.0f, 0.0f, 1.0f);
// glTexCoord2f(0, 0);
// glVertex3f(-50.f, -50.f, 50.f);
// glTexCoord2f(1, 0);
// glVertex3f(-50.f, 50.f, 50.f);
// glTexCoord2f(1, 1);
// glVertex3f( 50.f, 50.f, 50.f);
// glTexCoord2f(0, 1);
// glVertex3f( 50.f, -50.f, 50.f);
// //glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
// glTexCoord2f(0, 0);
// glVertex3f(-50.f, -50.f, -50.f);
// glTexCoord2f(1, 0);
// glVertex3f(-50.f, 50.f, -50.f);
// glTexCoord2f(1, 1);
// glVertex3f(-50.f, 50.f, 50.f);
// glTexCoord2f(0, 1);
// glVertex3f(-50.f, -50.f, 50.f);
// //glColor4f(1.0f, 1.0f, 0.0f, 1.0f);
// glTexCoord2f(0, 0);
// glVertex3f(50.f, -50.f, -50.f);
// glTexCoord2f(1, 0);
// glVertex3f(50.f, 50.f, -50.f);
// glTexCoord2f(1, 1);
// glVertex3f(50.f, 50.f, 50.f);
// glTexCoord2f(0, 1);
// glVertex3f(50.f, -50.f, 50.f);
// //glColor4f(1.0f, 0.0f, 1.0f, 1.0f);
// glTexCoord2f(0, 0);
// glVertex3f(-50.f, -50.f, 50.f);
// glTexCoord2f(1, 0);
// glVertex3f(-50.f, -50.f, -50.f);
// glTexCoord2f(1, 1);
// glVertex3f( 50.f, -50.f, -50.f);
// glTexCoord2f(0, 1);
// glVertex3f( 50.f, -50.f, 50.f);
// //glColor4f(0.0f, 1.0f, 1.0f, 1.0f);
// glTexCoord2f(0, 0);
// glVertex3f(-50.f, 50.f, 50.f);
// glTexCoord2f(1, 0);
// glVertex3f(-50.f, 50.f, -50.f);
// glTexCoord2f(1, 1);
// glVertex3f( 50.f, 50.f, -50.f);
// glTexCoord2f(0, 1);
// glVertex3f( 50.f, 50.f, 50.f);
// glEnd();
glViewport(400, 300, 400, 300);
glDisable(GL_TEXTURE_2D);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.f, 1.333f, 1.f, 500.f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.f, 0.f, -200.f);
glRotatef(Time.GetElapsedTime() * 50, 1.f, 0.f, 0.f);
glRotatef(Time.GetElapsedTime() * 30, 0.f, 1.f, 0.f);
glRotatef(Time.GetElapsedTime() * 90, 0.f, 0.f, 1.f);
glBegin(GL_QUADS);
glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
glVertex3f(-50.f, -50.f, -50.f);
glVertex3f(-50.f, 50.f, -50.f);
glVertex3f( 50.f, 50.f, -50.f);
glVertex3f( 50.f, -50.f, -50.f);
glColor4f(0.0f, 1.0f, 0.0f, 1.0f);
glVertex3f(-50.f, -50.f, 50.f);
glVertex3f(-50.f, 50.f, 50.f);
glVertex3f( 50.f, 50.f, 50.f);
glVertex3f( 50.f, -50.f, 50.f);
glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
glVertex3f(-50.f, -50.f, -50.f);
glVertex3f(-50.f, 50.f, -50.f);
glVertex3f(-50.f, 50.f, 50.f);
glVertex3f(-50.f, -50.f, 50.f);
glColor4f(1.0f, 1.0f, 0.0f, 1.0f);
glVertex3f(50.f, -50.f, -50.f);
glVertex3f(50.f, 50.f, -50.f);
glVertex3f(50.f, 50.f, 50.f);
glVertex3f(50.f, -50.f, 50.f);
glColor4f(1.0f, 0.0f, 1.0f, 1.0f);
glVertex3f(-50.f, -50.f, 50.f);
glVertex3f(-50.f, -50.f, -50.f);
glVertex3f( 50.f, -50.f, -50.f);
glVertex3f( 50.f, -50.f, 50.f);
glColor4f(0.0f, 1.0f, 1.0f, 1.0f);
glVertex3f(-50.f, 50.f, 50.f);
glVertex3f(-50.f, 50.f, -50.f);
glVertex3f( 50.f, 50.f, -50.f);
glVertex3f( 50.f, 50.f, 50.f);
glEnd();
glEnable(GL_TEXTURE_2D);
glViewport(0, 0, 800, 600);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0, 800, 600, 0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
text.SetFont(font);
text.SetString(typed.ToWCString());
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
win.Draw(text);
glEnable(GL_DEPTH_TEST);
win.Display();
}