I just updated my XCode to final release of 5.1.
And I have a problem with tgui, probably gui.draw() is not working or it might be something else. Code i am about to post works great on linux. Here i get window flickering, which shouldn't happen.
main.cpp:
loginScreen.hpp:
only output i get in terminal is:
Just sfml code without tGui works great.
EDIT: i just updated tGui to 0.6.2, i have same problem.
And I have a problem with tgui, probably gui.draw() is not working or it might be something else. Code i am about to post works great on linux. Here i get window flickering, which shouldn't happen.
main.cpp:
Code Select
#include <TGUI/TGUI.hpp>
#include "loginScreen.hpp"
// Here is a small helper for you ! Have a look.
#include "ResourcePath.hpp"
int main(int, char const**)
{
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
tgui::Gui gui(window);
gui.setGlobalFont("Data/Fonts/DejaVuSans.ttf");
loginScreen(gui);
gui.get("loginScreen")->show();
// Start the game loop
while (window.isOpen())
{
// Process events
sf::Event event;
while (window.pollEvent(event))
{
// Close window : exit
if (event.type == sf::Event::Closed) {
window.close();
}
// Espace pressed : exit
if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) {
window.close();
}
gui.handleEvent(event);
}
tgui::Callback callback;
while (gui.pollCallback(callback))
{
// Make sure that callback comes from the button
if (callback.id == 1) // login button
{
}
}
// Clear screen
window.clear();
gui.draw();
// Update the window
window.display();
}
return EXIT_SUCCESS;
}
loginScreen.hpp:
Code Select
#ifndef fml_test_loginScreen_hpp
#define fml_test_loginScreen_hpp
void loginScreen( tgui::Gui& gui )
{
tgui::Panel::Ptr loginScreen(gui, "loginScreen");
loginScreen->setSize(800, 600);
// Create the background image
tgui::Picture::Ptr picture(*loginScreen);
picture->load("Data/Backgrounds/loginBackground.tex");
picture->setSize(800, 600);
tgui::Button::Ptr jebise(*loginScreen);
jebise->load("Data/Buttons/Black.conf");
jebise->setSize(80,25);
jebise->setText("Tuck off");
jebise->setPosition(100, 100);
jebise->bindCallback(tgui::Button::LeftMouseClicked);
jebise->setCallbackId(1);
}
#endif
only output i get in terminal is:
Code Select
objc[2442]: Class SFApplication is implemented in both /Library/Frameworks/sfml-window.framework/Versions/2.1.0/sfml-window and /Users/cola/Desktop/fml test/Debug/fml test.app/Contents/Frameworks/libsfml-window.2.dylib. One of the two will be used. Which one is undefined.
objc[2442]: Class SFOpenGLView is implemented in both /Library/Frameworks/sfml-window.framework/Versions/2.1.0/sfml-window and /Users/cola/Desktop/fml test/Debug/fml test.app/Contents/Frameworks/libsfml-window.2.dylib. One of the two will be used. Which one is undefined.
objc[2442]: Class SFSilentResponder is implemented in both /Library/Frameworks/sfml-window.framework/Versions/2.1.0/sfml-window and /Users/cola/Desktop/fml test/Debug/fml test.app/Contents/Frameworks/libsfml-window.2.dylib. One of the two will be used. Which one is undefined.
objc[2442]: Class SFWindow is implemented in both /Library/Frameworks/sfml-window.framework/Versions/2.1.0/sfml-window and /Users/cola/Desktop/fml test/Debug/fml test.app/Contents/Frameworks/libsfml-window.2.dylib. One of the two will be used. Which one is undefined.
objc[2442]: Class SFWindowController is implemented in both /Library/Frameworks/sfml-window.framework/Versions/2.1.0/sfml-window and /Users/cola/Desktop/fml test/Debug/fml test.app/Contents/Frameworks/libsfml-window.2.dylib. One of the two will be used. Which one is undefined.
objc[2442]: Class SFViewController is implemented in both /Library/Frameworks/sfml-window.framework/Versions/2.1.0/sfml-window and /Users/cola/Desktop/fml test/Debug/fml test.app/Contents/Frameworks/libsfml-window.2.dylib. One of the two will be used. Which one is undefined.
Segmentation fault: 11
Just sfml code without tGui works great.
EDIT: i just updated tGui to 0.6.2, i have same problem.