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 - cookie

#1
Thank you! It works perfectly now.
And btw what is the difference between an EditBox and a TextBox?
#2
Yeah, just downloaded the latest SFML version, but I get some errors while compiling (during the make command on windows).

Output:


[ 53%] Building CXX object src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Texture.cpp.o
In file included from c:/Users/Bruno/Programmieren/Bibliotheken/C++/SFML-2.3.2-github-09-05-16/src/SFML/Graphics/GLCheck.hpp:32:0,

                 from c:/Users/Bruno/Programmieren/Bibliotheken/C++/SFML-2.3.2-github-09-05-16/src/SFML/Graphics/Texture.cpp:30:
c:/Users/Bruno/Programmieren/Bibliotheken/C++/SFML-2.3.2-github-09-05-16/src/SFML/Graphics/Texture.cpp: In member function 'bool s
f::Texture::create(unsigned int, unsigned int)':
c:/Users/Bruno/Programmieren/Bibliotheken/C++/SFML-2.3.2-github-09-05-16/src/SFML/Graphics/GLExtensions.hpp:115:55: error: 'GL_EXT
_sRGB' was not declared in this scope
     #define GLEXT_texture_sRGB                        GL_EXT_sRGB
                                                       ^
c:/Users/Bruno/Programmieren/Bibliotheken/C++/SFML-2.3.2-github-09-05-16/src/SFML/Graphics/Texture.cpp:192:31: note: in expansion
of macro 'GLEXT_texture_sRGB'
     static bool textureSrgb = GLEXT_texture_sRGB;
                               ^
In file included from c:/Users/Bruno/Programmieren/Bibliotheken/C++/SFML-2.3.2-github-09-05-16/src/SFML/Graphics/Texture.cpp:30:0:

c:/Users/Bruno/Programmieren/Bibliotheken/C++/SFML-2.3.2-github-09-05-16/src/SFML/Graphics/GLExtensions.hpp:116:55: error: 'GL_SRG
B8_ALPHA8_EXT' was not declared in this scope
     #define GLEXT_GL_SRGB8_ALPHA8                     GL_SRGB8_ALPHA8_EXT
                                                       ^
c:/Users/Bruno/Programmieren/Bibliotheken/C++/SFML-2.3.2-github-09-05-16/src/SFML/Graphics/GLCheck.hpp:51:28: note: in definition
of macro 'glCheck'
     #define glCheck(expr) (expr)
                            ^
c:/Users/Bruno/Programmieren/Bibliotheken/C++/SFML-2.3.2-github-09-05-16/src/SFML/Graphics/Texture.cpp:215:54: note: in expansion
of macro 'GLEXT_GL_SRGB8_ALPHA8'
     glCheck(glTexImage2D(GL_TEXTURE_2D, 0, (m_sRgb ? GLEXT_GL_SRGB8_ALPHA8 : GL_RGBA), m_actualSize.x, m_actualSize.y, 0, GL_RGBA
, GL_UNSIGNED_BYTE, NULL));
                                                      ^
make[2]: *** [src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/Texture.cpp.o] Error 1
make[1]: *** [src/SFML/Graphics/CMakeFiles/sfml-graphics.dir/all] Error 2
make: *** [all] Error 2


Is it a new bug? And if so, can I somehow get the SFML branch from 1st may?
#3
Ah, right. The versions.

I use the SFML 2.3.2 release from the SFML website.
My Android Version is 5.0.2 and I have a Samsung Galaxy Alpha.

Now I tried to set the virtual keyboard visible as you described in the bug report and the same behaviour occoured. Keyboard comes alive and then it crashes, unless you set it visible imideatly after the app started. Then it just crashes.
#4
Hey there,

I've just tested tgui on Android and it works well, Buttons and callbacks do what they need to do. But when I create a EditBox there are some problems. Firtly it appears as normal in the App-Display, when I set a Text from code it'll also appear, but as soon as I tap with my finger on the EditBox to type in sth. the App crashes with the standart Android error msg: "Unfortunately, TheApp has stopped."

Here is my Code:


auto editBox = std::make_shared<tgui::EditBox>();
editBox ->setSize(700, 100);
editBox ->setPosition(10, 500);
// editBox ->setText("Some Text");
GUI->add(editBox );


At least the virtual keyboard on Android appears, then after like one second it crashes.
I already tryed other keyboards (Googles Keyboard & Samsung Keyboard).
My first try was to compile the 0.7-tgui release. After I got the error I compiled the current code from Github.
Both didn't work.

Have you any solutions fir this problem?
#5
Help requests / Worked!
07 December 2015, 19:17:01
Thanks Texus!
The latest code from github worked for me!

cookie
#6
Hey there,
I'm using the precompiled TGUI v0.7-alpha2 for Visual C++14 (2015) 32 bit with SFML-2.3.2. I have linked it static.
Since I just had started using this awesome library, I copied the example code (https://tgui.eu/example-code/v0.7/scalable-login-screen/) for the scalable login screen and modified it to produce the error.
The scalable screen worked well when I directly attached the widgets to the gui like in the original example, but when I have started using the tgui::VerticalLayout things get a bit wired.
When I uncomment line 21 where I insert a space in between the two buttons in the layout, it will throw a assertion error when you scale the window on the y axis. Scaling on the x axis works perfectly. It also works perfect if there is no space in the layout or if I don't use a layout at all.

The error occours in line 56 when gui.setView(window.getView()); is called.

The exact error:

Debug Assertion Failed!
File: [...]\Microsoft Visual Studio\14.0\VC\include\vector
Line: 101
Vector iterator not incrementable


The release mode will also throw an error, but a little bit different.

The code used to get this error:
(mostly the example)
#include <TGUI/TGUI.hpp>

void loadWidgets(tgui::Gui& gui)
{
// Create GUI
// Update size on window resize
auto windowWidth = tgui::bindWidth(gui);
auto windowHeight = tgui::bindHeight(gui);

// Vertical Layout
auto MenuLayout = std::make_shared<tgui::VerticalLayout>();
MenuLayout->setSize(windowWidth * 0.6f, windowHeight * 0.8f);
MenuLayout->setPosition(windowWidth * 0.2f, windowHeight * 0.1f);
gui.add(MenuLayout);

// Play Button
auto PlayBtn = std::make_shared<tgui::Button>();
//MenuLayout->add(PlayBtn);

/* ### Error line ### */
MenuLayout->addSpace(0.5f);

// Exit Button
auto ExitBtn = std::make_shared<tgui::Button>();
MenuLayout->add(ExitBtn);
}

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

try {
// Load the font
gui.setFont("Arial.ttf");

// Load the widgets
loadWidgets(gui);
} catch(const tgui::Exception& e) {
std::cerr << "Failed to load TGUI widgets: " << e.what() << std::endl;
return 1;
}

// Main loop
while(window.isOpen()) {
sf::Event event;
while(window.pollEvent(event)) {
// When the window is closed, the application ends
if(event.type == sf::Event::Closed)
window.close();

// When the window is resized, the view is changed
else if(event.type == sf::Event::Resized) {
window.setView(sf::View(sf::FloatRect(0, 0, event.size.width, event.size.height)));
gui.setView(window.getView());
}

// Pass the event to all the widgets
gui.handleEvent(event);
}

window.clear();

// Draw all created widgets
gui.draw();

window.display();
}

return EXIT_SUCCESS;
}


Thanks for your help :)

cookie