Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - JerzyP

#1
Thanks, finally all works. I had to add some .lib files to both Debug and Release folders.
#2
Hi all,
I'm new with the TGUI library and I don't really know how to fix this problem. I've tried to add a simple widget to my program (as it's showed in the tutorial):

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <TGUI/TGUI.hpp>

int main()
{
sf::RenderWindow window(sf::VideoMode(400, 300), "TGUI window");
tgui::Gui gui(window);

while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();

else if (event.type == sf::Event::Resized)
{
window.setView(sf::View(sf::FloatRect(0, 0, (float)event.size.width, (float)event.size.height)));
gui.setView(window.getView());
}

gui.handleEvent(event);
}

tgui::Button::Ptr button = tgui::Button::create("Login");
button->setSize("10%", "5%");
button->setPosition("30%", "10%");

gui.add(button);

window.clear();

gui.draw();

window.display();
}

return 0;
}


After debugging the whole code I got the following error in the console window:
"sfml-graphics requires support for OpenGL 1.1 or greater
Ensure that hardware acceleration is enabled if available"

Also, Visual Studio points out an unhandled exception at "gui.draw();" line.
Do you have any ideas how to fix this? (Sorry for my bad english)