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

#1
When I just use "android" it says:
**************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools\bin\sdkmanager.bat
and tools\bin\avdmanager.bat
**************************************************************************

Invalid or unsupported command ""

Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
android update sdk


But maybe it's because it's from the SDK shipped with Android Studio, but I don't think thats the problem since i'm using this SDK with gradle and it works.
And yes, SFML for Android is even too much of a WIP state, I don't think i'm going to use it in the end :s It's too troublesome, and I have a simple error that I can't find for 2 days now while it compile and run fine on desktop...

Thanks for the answers though, I managed to make the example work ^^'
#2
Ok, thanks for the answer. I saw the line in the CMake script that try to find SFML in the NDK folder, and the .cmake files do exist.

So the command
cmake -DSFML_DIR=/ndk/sources/third_party/sfml/lib/armeabi-v7a/cmake/SFML -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=/ndk -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug .. -G "MinGW Makefiles"
worked !

It's weird that the CMake script didn't use that folder since it's written to search that folder, line 169:
...
elseif(TGUI_OS_ANDROID)  # Search for SFML in the android NDK (if no other directory is specified)
    find_package(SFML 2 COMPONENTS graphics window system PATHS "${CMAKE_ANDROID_NDK}/sources/third_party/sfml/lib/${CMAKE_ANDROID_ARCH_ABI}/cmake/SFML")
...


Now I have another problem, when I start the application the activity start but the SFML window don't show...
Also, I couldn't build the example using your tutorial since it says that the android program is deprecated, and the command "update project --name TGUI --path . --target android-23" doesn't exist, so I made it using Gradle and following the SFML Android example and adding the tgui lines needed, but it doesn't work :|

I tried many tests to find why, and I managed to make the sfml example to work with TGUI https://i.imgur.com/6Now8YD.jpg, the difference between the elements is huge but I think it's just a font size problem since the text that is not from a TGUI Widget have a font size of 64.

What blocked the example from working is the meta-data in the AndroidManifest.xml:
<meta-data android:name="android.app.lib_name" android:value="sfml-activity-d" />
<meta-data android:name="tgui.app.lib_name" android:value="tgui-activity-d" />
<meta-data android:name="sfml.app.lib_name" android:value="sfml-example" />

Having them with these names make it work, even with the tgui one last.

With a working project I replaced the SFML example main.cpp with your TGUI example main.cpp and it works fine.
I uploaded the working example: http://files.nikurasu.org/tgui/example.zip, you only need to change the file local.properties with your Android SDK and NDK path, and an optionnal path to the file "tools.jar" found in Android Studio jre folder (used by gradle) which wasn't in the default Java folder for me.

Maybe the example in the repository need to be updated, but I don't know if the one I uploaded is fine, since I just copy/paste it from SFML without knowing a lot about it :/
#3
Installation help / Compiling TGUI for Android
12 October 2018, 22:13:29
Hi, i'm trying to build (well, link) TGUI version 0.8 for Android but i'm having a bit of trouble.
I'm on Windows 10 and using GCC-6.3.0-1.

I already compiled SFML for Android with success, using the armeab-v7a ABI architecture and the example application is working fine.
I used the tutorial they have on Github (https://github.com/SFML/SFML/wiki/Tutorial%3A-Building-SFML-for-Android).

I also used the NDK r17c since it wasn't working with r18b, and SFML is in the /third_party folder as it should be.

So, everything is set up (I followed your tutorial) and I used cmake:
cmake -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_NDK=/ndk -DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_BUILD_TYPE=Debug .. -G "MinGW Makefiles"
-- Android: Targeting API '28' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
-- Android: Selected GCC toolchain 'arm-linux-androideabi-4.9'
-- The C compiler identification is GNU 4.9.0
-- The CXX compiler identification is GNU 4.9.0
-- Check for working C compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe
-- Check for working C compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++.exe
-- Check for working CXX compiler: /ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SFML 2.5.0 in C:/SFML/lib/cmake/SFML
-- Configuring done
-- Generating done
-- Build files have been written to: /TGUI/armeabi-v7a


I shortened the ndk path but I used a good and working one. Everything is still fine, so I build TGUI.
mingw32-make
... everything compile ...
[97%] Linking CXX shared library ..\..\lib\libtgui-d.so
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-graphics-d-2.dll:1:3: invalid character
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-graphics-d-2.dll:1:3: syntax error, unexpected $end
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-graphics-d-2.dll: not an object or archive
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-window-d-2.dll:1:3: invalid character
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-window-d-2.dll:1:3: syntax error, unexpected $end
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-window-d-2.dll: not an object or archive
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-system-d-2.dll:1:3: invalid character
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-system-d-2.dll:1:3: syntax error, unexpected $end
/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.exe: error: C:\SFML\bin\sfml-system-d-2.dll: not an object or archive
collect2.exe: error: ld returned 1 exit status
src\TGUI\CMakeFiles\tgui.dir\build.make:2176: recipe for target 'lib/libtgui-d.so' failed
mingw32-make[2]: *** [lib/libtgui-d.so] Error 1
CMakeFiles\Makefile2:86: recipe for target 'src/TGUI/CMakeFiles/tgui.dir/all' failed
mingw32-make[1]: *** [src/TGUI/CMakeFiles/tgui.dir/all] Error 2
Makefile:128: recipe for target 'all' failed
mingw32-make: *** [all] Error 2


And that's the error, the .dll used when linking have "invalid character", but the .dll are working and I am using them, I also compiled them myself using the same compiler.
Am I supposed to build SFML with the same toolchain as the one used by the NDK, or do I need to pass the toolchain I used ?
Also, is the linker supposed to use the lib build for Windows and not those build for Android (in the ndk folder) ?

Thanks.
#4
Help requests / Re: ChildWindow closed event
15 August 2018, 21:20:11
Everything works now ! Thanks, seems like it was a tricky yet simple problem :)
#5
Help requests / Re: ChildWindow closed event
15 August 2018, 15:27:58
I uploaded the clean project (with everything fixed), TGUI and SFML : https://www.dropbox.com/s/ipddlbaxwgu3qx5/TestChildWindow.7z?dl=1
I didn't move the .dll to the bin folder of the project.
#6
Help requests / Re: ChildWindow closed event
15 August 2018, 12:45:54
The flag -std=c++14 is set globally for both Release and Debug mode, then I append the -g flag only in Debug mode and the -O2 and -s flags only in Release mode.
And the same for the linker, everything is set for both and then I set libtgui and sfml with '-d' only in debug mode and without '-d' in release mode, i did not make it static and i updated the .dll and rebuild the whole project each time I changed anything.

The _64 is not a 64-bit version it's just when I was trying to build with GCC-7.3.0 I used MinGW-64 and SFML and TGUI were in the same folder, so I put the _64 suffix to differentiate them.

And sorry everything wasn't set at it's real values in the .cbp project, I guess I played with it and didn't save it before sending it, here it is with good values that still don't work: https://pastebin.com/j3dqji1z
I also just tried to compile a static version but the result is the same :-/
#7
Help requests / Re: ChildWindow closed event
14 August 2018, 01:29:55
The code I posted on a new empty project with only it inside produce the same output.
But here's a full main.cpp alone that crash for me : https://pastebin.com/uFSefVMq (And the .cbp project https://pastebin.com/mYqkF3v7)

I'm using Windows 10 Enterprise 1709 (16299.492), and my compiler is GCC-6.3.0-1 (The default one that come with MinGW).
I also compiled both SFML and TGUI myself using the same compiler.
I compile with that in the linker:
mingw32
user32
gdi32
winmm
dxguid
libtgui
sfml-graphics
sfml-window
sfml-system

And I don't even need the -O2 flag in the clean project to make it crash.

I tried to compile on another computer, same compiler but different Windows version (Windows 10 Professional 1511, 10586.1176), and the same compiler and it does the same (crash).
It does work on Ubuntu 18.04 with GCC-7.3.0-16ubuntu3.
So I tried to compile using GCC-7.3.0 (x86_64-win32-seh-rev0) that come with MinGW-64 by default but it still doesn't work :-/
#8
Help requests / ChildWindow closed event
13 August 2018, 21:11:05
Hi, when you set a callback to the "closed" event of a ChildWindow, the program just crash.
This code doesn't work :
auto child = tgui::ChildWindow::create();
child->connect("closed", [&](tgui::ChildWindow::Ptr window) {
    std::cout << "callback" << std::endl;
});
gui.add(child); // Closing the window make the program crash.

However, this only happen when the "-O2" flag is set when compiling, when there is no "-O" flag and the "-g" flag is set the program works fine, so i can't enter debug mode either to know what's happening...  :-\
#9
It works perfectly :) Thanks again !
#10
The AnimationFinished callback would be really great i think, i actually searched for one when i had the problem and you made one that is called when the animation is done but it's only used for internal purpose :(

Also, the issue where i'm not able to scroll a scrollable panel inside a panel is wrong, i didn't check first but it's a scrollable panel inside another scrollable panel, so... this issue was kind of dumb for my purpose, i can simply remplace the outter one with a simple Panel and it will work, since the outter one is just a container with fixed size, there is no need for it to have a scrollbar (i don't know why i did that).
But the issue may be a real one ? I don't know, it could be tricky to fix with even more nested scrollable panel.

Thanks.
#11
Hi, I'm creating a menu that is hidden by default, and when i click a button, it is introduced with a nice showWithEffect().
The thing here is that the button is binded to the right of the menu, and it moves with it when it's showing. Everything is fine for now, the default width of the menu is it's real size and buttons are binded to 0% by default.
I also hide the menu with hideWithEffect(), and the problem is here, after hideWithEffect is called it's original position is set back, and so my buttons are to the right again, floating in the middle of nowhere.

So, i want the buttons to actually stay at 0%, on the left, after the animation is over.
To achieve that i created a tiny class "Timer" that execute an action after a set amount of time, and i use that to set the buttons position to 0 after the same amount of time as the animation.
My solution seems kind of overkill, so is there an easier solution that i just didn't think of or not ?  :-X

Here is what's happening on the first link, and what i want to achieve on the second link (working with my solution):
First gif https://gfycat.com/IdolizedOptimalCondor and the second gif https://gfycat.com/GleamingWavyGodwit

Also, i'm actually creating the menus (3 of them in the gif) individually, by that i mean that each menu is totally independent from the others.
I actually did that for a reason. On my first try, i did a "MenuContainer" where i would put menus inside and hide them at choice, but i couldn't scroll a ScrollablePanel inside a panel and so i create them "individually".
Does ignoreMouseEvents() could actually help me scroll in a panel inside another panel ? Or another option that i didn't see ? I'm actually asking before trying again because i don't want to try everything again if there is no solution :x

Thanks and sorry for the long post.
#12
I knew it would be complicated since you need to know the parent height :(
I actually know when the tooltip will not be visible, so the code you wrote actually works and it's fine for me, thanks for the answers :)
I replaced - 20 with - bindHeight(tooltip) and it works.
#13
Thanks, it works now :)
The tooltip did show up, but you had to hover the old position of the element (without scroll) to show it.

One last problem is that tooltips are not really visible when you hover an element at the bottom of the window, the tooltip is "out" of the window.
A simple trick would be to display the tooltip above the mouse instead of below. I tried to do it but I still don't really understand how everything works ^^'
#14
Hi, when you add ToolTips to elements in a ScrollablePanel, the tooltip stay fixed, after scrolling the tooltip is at the same place.

Thanks.