I have a problem using the ChatBox widget in a ChildWindow.
As soon as the ChatBox leaves its original position the text in it is cut off. (Screen1)
And when the ChildWindow is too far in the bottom right corner of the window a GL_INVALID_Value gets thrown. (Screen2)
Minimal Code to repoduce the error is:
#include "stdafx.h"
using namespace std;
using namespace sf;
using namespace tgui;
using namespace placeholders;
int main()
{
// Create the window
RenderWindow window{ { 1080, 720 }, "Window" };
Gui gui{ window };
// Load the font
gui.setFont( "./DejaVuSans.ttf" );
auto childWindow = make_shared<ChildWindow>();
childWindow->setSize( 800, 400 );
auto chatBox = make_shared<ChatBox>();
chatBox->addLine( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
childWindow->add( chatBox );
gui.add( childWindow );
while( window.isOpen() )
{
Event event;
while( window.pollEvent( event ) )
{
if( event.type == Event::Closed )
window.close();
// Pass the event to all the widgets
gui.handleEvent( event );
}
window.clear();
// Draw all created widgets
gui.draw();
window.display();
//output GL_ERROR
while( true )
{
GLenum err = glGetError();
if( err == GL_NO_ERROR )
break;
cout << err << endl;
}
}
}
I compiled TGUI myself with SFML 2.3.2 precompiled binaries using VisualStudio 2015.