Welcome, Guest. Please login or register. Did you miss your activation email?

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.


Messages - thunem

Pages: [1]
1
Sorry for necroposting, but maybe others will need this?

https://github.com/Groogy/rbSFML

2
System / Re: SFML 2.5.1 THOR and MOUSE BUTTON CLICK issues
« on: June 22, 2020, 02:44:31 pm »
Yes, this is a perfect answer :-)

I will mark solved then, and yes so in conclusion you have the method as mine, and we are all in the same boat XD

Experience is a big jump in speed that's for sure tho

This video is pretty much what happen to all us :-) :




3
System / Re: SFML 2.5.1 THOR and MOUSE BUTTON CLICK issues
« on: June 22, 2020, 10:41:00 am »
Thanks!
This user in that topic says:
//Ok, I'm getting 8 errors and I have no clue why...
//Here is the line of code that I've narrowed it down too:
if (exitRect.getGlobalBounds().contains(window.mapPixelToCoords(sf::Mouse::getPosition(window))))
 

I mean how do you reach / or how to arrive to that solution?
You most likely include (something that includes) <windows.h> before SFML headers. Several possible solutions:
- get rid of that include if you don't need it
- define the preprocessor symbol NOMINMAX in your project settings
- #undef "min" and "max" symbols immediatly after including windows.h
- do not include any SFML header after windows.h, if possible

solution #2 is the cleanest (or #1 if you have windows.h included just for fun).

It's that based on your experience like damning the screen, or invoke mistic creatures, cursing the lamp etc ?

4
System / Re: SFML 2.5.1 THOR and MOUSE BUTTON CLICK issues
« on: June 21, 2020, 09:39:17 pm »
Thanks! For errors like those, what are your techniques if I may ask? I am interested to understand better those errors, I mean I have solved this error only because I have luckily found this topic in the link above, I was about to install an older version (2.4.2) just afterward to find that probably was totally another thing.

Best advices?

5
System / Re: SFML 2.5.1 THOR and MOUSE BUTTON CLICK issues
« on: June 20, 2020, 02:51:50 pm »
Solved!
As reported there :
https://en.sfml-dev.org/forums/index.php?topic=21182.0

If someone stomp in this issue It's probably because you have <windows.h> before the SFML includes.

But since I haven't been able to move because the Selbaward library start to output errors, I had to try the preprocessor second solution from Laurent: NOMINMAX for both Release and Debug.

So, after that was added, when clicking compile no issues anymore :-) !

Perfect!

Since @Laurent replied in the other thread, can you please tell me what NOMINMAX remove/add/change? What can be the other face to do that preprocessor instruction?

6
System / Re: SFML 2.5.1 THOR and MOUSE BUTTON CLICK issues
« on: June 19, 2020, 11:43:41 pm »
I found a source from another game that uses closeButton.getGlobalBounds().contains(mouse.x,mouse.y)
and the library that I used to compile is 2.4.2 (from config.hpp MAJOR MINOR etc )
So maybe something has changed and I cannot use contains (breaking the item mouse clicking workflow)?

It's this new behavior a change in 2.5.1?

This is one, I have still to find the one from a user that wanted to fix the engine because the rect gave the same error as mine, I was wondering tho if I can overcome in 2.5.1 without recompiling that part etc...
https://stackoverflow.com/questions/51630900/how-do-i-do-collision-between-two-rectangleshapes-in-sfml-2-5-0-c

Thanks for your help !

7
System / [SOLVED] SFML 2.5.1 THOR and MOUSE BUTTON CLICK issues
« on: June 19, 2020, 09:36:06 pm »
Hi, I am using SFML2.5.1 and Thor, and I am not able to get a getGlobalBounds().contains to have the mouse button click over a sprite, someone can tell me why :-( ?


THE OBJECTS THAT I TRIED
//RECTANGLE
        //sf::RectangleShape closeButton;
        //closeButton.setSize(sf::Vector2f(200.0f, 80.0f));
        //closeButton.setPosition(300.0f, 260.0f);
        //closeButton.setFillColor(sf::Color::Red);

A FLOAT RECT
sf::FloatRect area1(550,0, 50, 20);

THE SAMPLE ROUNDEDRECT FROM THOR LIB
sf::ConvexShape roundedRect = thor::Shapes::roundedRect(sf::Vector2f(200.f, 100.f), 30.f, sf::Color(200, 190, 120), 3.f, sf::Color(150, 140, 80));

if (event.type == sf::Event::MouseButtonPressed )
{
        if (event.mouseButton.button == sf::Mouse::Left) {                                     

//THIS IS NOT WORKING Thats is the supposed way to operate but is not working for me
//if (closeButton.getGlobalBounds().contains(window.mapPixelToCoords(sf::Vector2i(event.mouseButton.x, event.mouseButton.y)))) {

//THIS WORK but is not precise, is not using the shape surface
//if ( sf::Mouse::getPosition(window).x > 550 && sf::Mouse::getPosition(window).y < 20 ) {                                     

                                // Mouse is inside the sprite.
                                std::cout << "Button pressed" << std::endl;
                                               
                        }

                }                              
                               
}
 

COMPILER ERRORS:

Error(active)   E0864   Rect is not  a model    Shapes  C:\Users\pc\Documents\Visual Studio 2017\Resources\SFML-2.5.1-win32\include\SFML\Graphics\Rect.inl      52     


Errore (attivo) E0864   Vector2 is not  a model Shapes  C:\Users\pc\Documents\Visual Studio 2017\Resources\SFML-2.5.1-win32\include\SFML\Graphics\Rect.inl      52     


Errore (attivo) E1670   qualificator not permitted in a non member function     Shapes  C:\Users\pc\Documents\Visual Studio 2017\Resources\SFML-2.5.1-win32\include\SFML\Graphics\Rect.inl      76     
 

8
Graphics / Re: FFMpeg and SFML
« on: June 01, 2020, 01:04:47 pm »
Many thanks  :) ! I will try to address this issue, on stack overflow website they said that may be a spaced directory path, so I will try to compile somewher in C root

https://stackoverflow.com/questions/13118947/error-msb6006-cmd-exe-exited-with-code-1

I imagine that too arguments error is because the paths are passed without quotation marks " " and they are seen as multiple parameters like "C:\My" "BeautifulPath\SFML\include"

If someone in the meantime solved this issue or can give a clue I will listen with all my ears (o) o_o (o)  :)

9
Graphics / Re: FFMpeg and SFML
« on: May 31, 2020, 11:54:00 pm »
Ok, thanks again, I was using the SFML compiled from source, the cmake was in a weird position
Now after the generate went fine, on project open and running the ALL_BUILD I had 2  compiled projects, and 4 failed ones, about ffmpeg for example in the output log is saying too much arguments passed to bash, what's happening from your experiences ?  :-\

(I am italian so I will try to translate the output messages ):

1>------ Start Building: Project: FFmpeg, Configuration: Debug Win32 ------
1>Generating ../FFmpeg-binaries/lib/avformat.lib, ../FFmpeg-binaries/lib/avdevice.lib, ../FFmpeg-binaries/lib/avcodec.lib, ../FFmpeg-binaries/lib/avutil.lib, ../FFmpeg-binaries/lib/swscale.lib, ../FFmpeg-binaries/lib/swresample.lib
1>/usr/bin/bash: riga 0: cd: too parameters /arguments
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" terminated with code 1.
1>Building project"FFmpeg.vcxproj" NOT Completed.
2>------ Start building: project: sfeMovie, Configuration: Debug Win32 ------
2>Error copying directory from "C:/Users/pc/Documents/Visual Studio 2017/Projects/sfeMovieLaTest/build/FFmpeg-binaries/bin" to "C:/Users/pc/Documents/Visual Studio 2017/Projects/sfeMovieLaTest/build/bin".
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: uscita dal comando "setlocal
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: "C:\Program Files (x86)\CMake\bin\cmake.exe" -E copy_directory "C:/Users/pc/Documents/Visual Studio 2017/Projects/sfeMovieLaTest/build/FFmpeg-binaries/lib" "C:/Users/pc/Documents/Visual Studio 2017/Projects/sfeMovieLaTest/build/bin"
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmEnd
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmErrorLevel
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: exit /b %1
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmDone
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: setlocal
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: "C:\Program Files (x86)\CMake\bin\cmake.exe" -E copy_directory "C:/Users/pc/Documents/Visual Studio 2017/Projects/sfeMovieLaTest/build/FFmpeg-binaries/bin" "C:/Users/pc/Documents/Visual Studio 2017/Projects/sfeMovieLaTest/build/bin"
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmEnd
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmErrorLevel
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: exit /b %1
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmDone
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(133,5): error MSB3073: :VCEnd" with code 1.
2>Project building "sfeMovie.vcxproj" NOT COMPLETED.
3>------ Start building: Project: sfeMovieDemo, Configuration: Debug Win32 ------
4>------ Start building: Project: sfeMovieMinimalistDemo, Configuration: Debug Win32 ------
3>main.cpp
4>main.cpp
4>C:\Users\pc\Documents\Visual Studio 2017\Projects\sfeMovieLaTest\examples\MinimalistDemo\main.cpp(26): fatal error C1083: It's not possible to open include file: 'SFML/Config.hpp': No such file or directory
3>C:\Users\pc\Documents\Visual Studio 2017\Projects\sfeMovieLaTest\examples\Demo\main.cpp(26): fatal error C1083: It's not possible to open include file: 'SFML/Config.hpp': No such file or directory
3>MediaInfo.cpp
4>Compilazione progetto "sfeMovieMinimalistDemo.vcxproj" NOT COMPLETED.
3>C:\Users\pc\Documents\Visual Studio 2017\Projects\sfeMovieLaTest\include\sfeMovie/Movie.hpp(29): fatal error C1083: It's not possible to open include file: 'SFML/Graphics.hpp': No such file or directory
3>StreamSelector.cpp
3>C:\Users\pc\Documents\Visual Studio 2017\Projects\sfeMovieLaTest\include\sfeMovie/Movie.hpp(29): fatal error C1083: It's not possible to open include file: 'SFML/Graphics.hpp': No such file or directory
3>UserInterface.cpp
3>c:\users\pc\documents\visual studio 2017\projects\sfemovielatest\examples\demo\UserInterface.hpp(29): fatal error C1083: It's not possible to open include file: 'SFML/Graphics/RenderWindow.hpp': No such file or directory
3>Generating code...
3>Project building "sfeMovieDemo.vcxproj" NOT COMPLETED.
========== Compilazione: 2 completed, 4 non riuscite, 0 updated, 0 ignored ==========


10
Graphics / Re: FFMpeg and SFML
« on: May 31, 2020, 07:37:11 pm »
Thanks for your replies, but I can't understand this error, I have deleted in sfeMovieRepo->cmake->Modules the FindSFML.cmake
Then in sfeMovieRepo I put the new CmakeLists.txt file from Exploiter, then ran CMake and set those variables in the image attached, but on Generate want again SFML_DIR?
And in any case is searching for those files I found no files with that name (when I built sfml repo I haven't found any on include directory), but found a cmake->SFMLConfig.cmake.in (in the SFML repo)
I have to rename and move that file somewhere in the SFML repo?

11
Graphics / Re: FFMpeg and SFML
« on: May 28, 2020, 10:48:33 pm »
Hey thanks for reply! I have tried to contact you but forum PM don't works, because on Sent Items there's nothing I sent... :(
One small addition to this puzzle is to remove FindSFML.cmake on the sfeMovie Because was not let me continue (same error even with your file)

So, I downloaded sfeMovie package
created a folder in VS2017 projects and placed the code there
changed cmakeLists.txt to this new one you've created
deleted FindSFML.cmake to be able to continue
OK solution built
Now compiling ALL_BUILD inside solution gave me this error:
Could not open those files:
#include <SFML/Config.hpp>
#include <SFML/Graphics.hpp>

But the inclusion on cmake was all correct, and all the paths correspond (you can see in the image):

Also do you have an email so I can contact you quickly? I need this because it's the best solution by now :)

12
Graphics / Re: FFMpeg and SFML
« on: May 26, 2020, 03:37:22 pm »
Hi, thanks for your reply  :)

I want to play video and audio inside my application, I have at the end compiled some examples on the net but got around 1000 unresolved symbols, I have to investigate better on that  :(

About sfeMovie.
I put that with title modified to FindSFML.cmake as requested from the main cmake script in sfeMovie but eventually got another message:

Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.15063.
Needs to (re)build FFmpeg: TRUE
Parallel jobs: 8
CMake Error at cmake/Modules/FindSFML.cmake:139 (message):
  Requested SFML configuration (Shared) was not found
Call Stack (most recent call first):
  CMakeLists.txt:104 (find_package)


Configuring incomplete, errors occurred!
See also "C:/Users/pc/Documents/Visual Studio 2017/Projects/sfeMovie/CMakeFiles/CMakeOutput.log".

13
Graphics / Re: FFMpeg and SFML
« on: May 26, 2020, 03:17:14 am »
Seems that the error is something FindSFML.cmake script.

Tried solutions over the web, in this link there the error reported:
https://github.com/SFML/SFML/issues/873

I have tried multiple solutions, from editing the file myself and hardcoding the version numbers but nothing. Also I have downloaded multiple SFML versions (2.3.2 , 2.4.2 , 2.5.1) and multiple FindSFML.cmake from various spots, but nothing...

Someone had those problems in the past? I have seen that this issue is relatively old (2015 is reported in the link above)

Thanks in advance!

14
Graphics / Re: FFMpeg and SFML
« on: May 25, 2020, 10:18:23 pm »
Thanks for reply! I have already checked that, but last time I tried to compile first I had to download msys, after that even if sfml was found (with CMake) I had this error:

In reality the libraries are sfml 2.5.1 and 2.4.2



Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.15063.
Needs to (re)build FFmpeg: TRUE
Parallel jobs: 8
CMake Error at cmake/Modules/FindSFML.cmake:91 (FILE):
  FILE failed to open for reading (No such file or directory):

    C:/Users/pc/Documents/Visual Studio 2017/Resources/SFML-2.5.1/include/SFML/SFML/Config.hpp
Call Stack (most recent call first):
  CMakeLists.txt:104 (find_package)


CMake Error at cmake/Modules/FindSFML.cmake:356 (message):
  SFML found but version too low (requested: 2.3, found: 1.x.x)
Call Stack (most recent call first):
  CMakeLists.txt:104 (find_package)


Configuring incomplete, errors occurred!
See also "C:/Users/pc/Documents/Visual Studio 2017/Projects/sfeMovie/CMakeFiles/CMakeOutput.log".


15
Graphics / FFMpeg and SFML
« on: May 25, 2020, 07:40:25 pm »
Hi, I have tried to integrate FFMpeg with SFML in the last two days, but I haven't got any results sadly, the examples on the net are all old versions or unclear.
There are some examples for ffmpeg 3.3.1 but I can't find that development version prebuilt, or I have ffmpeg 4 + but examples are not working for me anymore, I don't know why.

I have tried to convert one by one the old deprecated functions with the new ones, but I am really stuck on understanding all the code.

Are there or on the net an updated ffmpeg and sfml tutorial or maybe can someone please convert or help me to convert one that is the most easily transferable to sfml 2.4 +?

Those are the tutorials or forum topics that I have followed:
https://en.sfml-dev.org/forums/index.php?topic=20593.0
https://github.com/shi-yan/videosamples
https://stackoverflow.com/questions/11701635/use-ffmpeg-in-visual-studio
https://en.sfml-dev.org/forums/index.php?topic=2474.0

Pages: [1]
anything