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

Pages: [1] 2 3
1
Audio / Re: getting libopenal32.a for static compilation
« on: December 11, 2025, 04:25:47 pm »
your detailed reply is appreciated. Thank you for your time

2
Audio / Re: getting libopenal32.a for static compilation
« on: December 11, 2025, 03:56:09 pm »
You say: Due to licensing reasons, as OpenAL is licensed under LGPL, SFML doesn't provide a way to link OpenAL statically.

is there a contradiction with  "Usually, we're linking the audio dependencies statically" you wrote in  https://en.sfml-dev.org/forums/index.php?topic=29587.0   ?  What am I getting wrong?

3
Audio / Re: getting libopenal32.a for static compilation
« on: December 11, 2025, 01:14:36 pm »
Thank you again for the detailed reply.
1. SFML 3 doesn't use OpenAL at all. So you don't have any licensing issues and can link everything statically.
I've got that from your first reply. I wanted to be sure that SFML 3 (GCC 14.2.0 MinGW (DW2) (UCRT) ) comes with all files/libs required for static linking project which use sounds.

2.You need to understand that a *.a file on Windows can be either a static library OR an import library for a dynamic library.
Do you mean that there are two different types (static and dynamic) of a .a file with the same name? Of so, how to tell one from the other?

Also I cannot understand this bit of your phrase: "either a static library OR an import library for a dynamic library."  Does this mean that a static library is built into SFML while  library for a dynamic library has to be imported? Or import library means that it does not belong to SFML but is already imported  from somewhere into SFML?

3. SFML always has shipped a libopenal.a import library and you can get it from the previously linked extlibs folder.
Yes, as I said, I did exactly that but it would not compile. Errors are so numerous and verbose I cannot show them here.

4.  If you want to stick with your compiler, then you have to build SFML from source.
That's why we link the specific compiler on the download page.
No, I do not care about compiler version as long as it compiles given SFML version

If we take SFML 3.0.2  (https://www.sfml-dev.org/download/sfml/3.0.2/) - does it come with its own compiler built in? If it does not, is it correct to assume that for 32-bit  GCC 14.2.0 MinGW (DW2) (UCRT)  the matching compiler is WinLibs UCRT 14.2.0 (32-bit)

4
Audio / Re: getting libopenal32.a for static compilation
« on: December 10, 2025, 07:46:14 pm »
Thank you very much. Just to clarify several points:
1. You may also want to consider upgrading to SFML 3, which no longer uses OpenAL.
You mean  SFML 3 renders sound without OpenAL and all the necessary import library files are there?

2. I had to CMake my SFML because the pre-built ones turned out to be incompatible with compiler TDM-GCC-32. it worked fine as long as I did not use sound.
Precompiled  SFML 3 is free from these problems?

3. I found  libopenal32.a in the old SFML version on my PC and copied it to the new one. Yet it would not build - now I see for licensing reasons. Does this mean that static linking of SFML projects with sounds is not possible? 

PS. I consulted AI and it suggested this is because SFML by default has built-in support for FLAC/OGG audio files which requires relevant libraries and that it is not easy to disable this support. I tried removing them from CMakeLists.txt but it turned out they are mentioned in headers like SoundFileReaderFlac.hpp and then in some cpp so I dropped this idea

5
Audio / getting libopenal32.a for static compilation
« on: December 10, 2025, 01:33:31 pm »
I cannot build a SFML C++ project which uses sound: cannot find libopenal32.a
Google search cannot find it either offering install OpenAL. I heard installing OpenAL is a headache. Besides installing the whole thing just for one little file seems to be overkill.
Could someone offer a link to libopenal32.a  for static compilation?
Or perhaps share with me this file?

6
Window / Re: simulating mouseClick
« on: January 22, 2024, 10:41:39 am »
thank you very much for your comment.
I did not understand your question "How is the mouse simulated?"
I thought "mouse simulated" means using relevant function. In my case Mouse::isButtonPressed

From your question I suspect that apart from using  function like Mouse::isButtonPressed or event, mouse simulation requires more than just using function or event - is this the case?

PS. I tried to use C++ built-in function GetAsyncKeyState(). For some reason it even in the simplest test-code for Left Click like

int main()
{
   Sleep(100);
   if(GetAsyncKeyState(0x01))
        {
                cout<<"mouse"<<endl;
        }
}
 
it behave not as expected (no mater which integer I put inside  Sleep();
But for the Right button GetAsyncKeyState(0x02) works fine

7
Window / simulating mouseClick
« on: January 20, 2024, 07:48:53 pm »
I am trying to develop an application to work with the mouse coursor controlled by laser pointer (a webcam scanning the screen, a program scanning frames in search of laser dot, calculates its coordinated and simulates mouse click in these coordinates).

I am coding it in MSVS Community 2019 C++ and SFML.
One of the things I am trying to do is to place a sprite (just a red circle) into a certain place (x,y) which is different for every click using:

if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
        {
                spriteSircle.setPosition(x, y); //x and y are calculated earlier in the program
        }

To simulate mouseClick the laser pointer is set to generate a short (50 msec) laser pulse.

With the standard mouse it works fine.
Yet with  the laser pointer two things do happen very often:
1. It misses laser clicks
2. It places the red circle at the coordinates of the PREVIOUS place. I.e. where it should have been places at the previous click

Where might be the error? It might be with the program which scans the frames and simulates the mouseclick, but I have no access to its code, and therefore need to make sure that the problem is not in my code.

8
General / Re: "SFML Works!" test code using Class
« on: December 19, 2021, 03:29:15 pm »
I see now. Creating window in Windows native way is big pain indeed. Thanks again for the most professional aid

9
General / Re: "SFML Works!" test code using Class
« on: December 19, 2021, 01:47:49 pm »
Thank you very much. The link to C++ tutorials will certainly be of help. Now I see that things changed since I last used C++. Till now I have not come across the term "operating system window". Against  this term Google returns plenty of links to articles about operating system Windows but none about its meaning in this here context

10
General / Re: "SFML Works!" test code using Class
« on: December 19, 2021, 10:32:17 am »
Thank you, kojack, for taking time to write the detailed explanation. Impressed with the depth of your knowleadge.
Actually I suspected that something wrong was with the line you pointed at:
Quote
sf::RenderWindow mWindow(sf::VideoMode(640, 480), "SFML Application");

Using sf::RenderWindow both inside class definition and outside it might be confusing for compiler. The reason I had to use it outside class definition was:

In Game Class two private members were declared the same way:
Quote
private:
    sf::RenderWindow mWindow;
    sf::CircleShape mPlayer;

However initializing the second member
Quote
mPlayer.setRadius(40.f);
worked, while similar initializing the first member
Quote
mWindow(sf::VideoMode(640, 480), "SFML Application");
generated an error
Quote
no match for call to '(sf::RenderWindow) (sf::VideoMode, const chat[17])'
Why didn't it work and why it required calling "create", while similar declared mPlayer worked without "create"?

11
General / Re: "SFML Works!" test code using Class
« on: December 18, 2021, 02:30:58 pm »
Thank you, this is a great relief!
I tried to modify it to look more familiar to me:
Quote
Game::Game()
{
   sf::RenderWindow mWindow(sf::VideoMode(640, 480), "SFML Application");
   //{mWindow(sf::VideoMode(640, 480), "SFML Application"); this cause error no match for call to '(sf::RenderWindow) (sf::VideoMode, const chat[17])'
    mPlayer.setRadius(40.f);
    mPlayer.setPosition(100.f, 100.f);
    mPlayer.setFillColor(sf::Color::Cyan);
};
The other functions copied from the book:
Quote
void Game::run()
{
    while (mWindow.isOpen())
    {
        processEvents();
        update();
        render();
    }
}

void Game::processEvents()
{
    sf::Event event;
    while (mWindow.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
            mWindow.close();
        }
}

void Game::update()
{
}

void Game::render()
{
    mWindow.clear();
    mWindow.draw(mPlayer);
    mWindow.display();
}

int main()
{
    Game game;
    game.run();
    return 0;
}
It compiles and runs with no errors yet it just flashes for a split second that 640x480 window with white background and no circle.
What I am missing?

12
General / "SFML Works!" test code using Class
« on: December 18, 2021, 12:23:34 pm »
I am trying the book SFML Game Development recommended on www.sfml-dev.org/learn.php
They start with the classic "SFML Works!" test code, but do it using Class:
Quote
class Game
{
 public:
    Game();
    void run();
 private:
    void processEvents();
    void update();
    void render();
 private:
    sf::RenderWindow mWindow;
    sf::CircleShape mPlayer;
};

So far so good. But the following definition of Game() constructor, I cut and copy it here:

Quote
Game::Game()
: mWindow(sf::VideoMode(640, 480), "SFML Application")
, mPlayer()
{
 mPlayer.setRadius(40.f);
 mPlayer.setPosition(100.f, 100.f);
 mPlayer.setFillColor(sf::Color::Cyan);
}
I learned C++  in 1998 using "How to programm C++" by H.M. and P.J. Deitel and this syntax puzzles me. Is this a new version C++ or just slip of pen? Anyway, as is it would not compile.

13
General / Re: libstdc++-6.dll and libgcc_s_seh-1.dll are not found
« on: December 14, 2021, 03:15:08 pm »
thank you. I will follow your advice

14
General / Re: Process terminated with status -1073741510
« on: December 14, 2021, 03:13:50 pm »
Thank you. Actually I suspected something like that and before posting my question here,  googled "status -1073741510". It returned several links all saying about  some run-time error. I did not realised that 1073741510 is the same as 0xC000013A

15
General / Re: libstdc++-6.dll and libgcc_s_seh-1.dll are not found
« on: December 14, 2021, 03:04:16 pm »
Thank you.
If I build it in static mode, will it work on its own?

Pages: [1] 2 3