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

Recent Posts

Pages: [1] 2 3 ... 10
1
If you're dynamically linking SFML, you'll likely need to provide the DLLs along with your executable (unless the running system has their location added to its global path). If you're statically linking SFML, you won't need to provide DLLs as these are only for dynamically linking.

EXCEPT...

...for openal32.dll

If you statically link and use the audio library, you'll need this DLL along with the executable as its required by its (OpenAL's) license to have it separate.
2
General / Re: How to enable a console to see output
« Last post by Mahorin on September 20, 2023, 05:20:10 pm »
thank you for the explanations. On the other hand, as for openal32 I have taken it from sfml so that's not it.
3
Audio / Re: Making sf::Music or sf::Sound object not working (finishes process)
« Last post by BjornVB on September 20, 2023, 03:42:05 pm »
So having the DLLs in the library folder itself is not enough? Do I just make a copy of any missing DLLs from the SFML library?
4
General discussions / Re: Mutual following on the Fediverse!
« Last post by rubenwardy on September 20, 2023, 03:40:52 pm »
My profile is https://fosstodon.org/@rubenwardy

(maybe I don't belong here given that I don't have any active SFML projects. But I was working on https://rubenwardy.com/rvwp/ and have written guides for SFML)
5
Audio / Re: Making sf::Music or sf::Sound object not working (finishes process)
« Last post by eXpl0it3r on September 20, 2023, 03:40:09 pm »
0xC0000135 means it failed to find a required DLL.

Unfortunately CLion hides the "normal" MsgBox. If you run it from explorer, you'll get a MsgBox telling you which DLL is missing.
Since it's related to audio, you're most likely missing openal32.dll next to your executable.
6
Audio / Making sf::Music or sf::Sound object not working (finishes process)
« Last post by BjornVB on September 20, 2023, 02:07:21 pm »
I'm getting into building an application using the C++ SFML library. (I'm on Windows using CLion and CMake)

Currently, my code is looking like this:

#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>

int main() {
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML Audio Test");

    sf::Music music{};
    if (!music.openFromFile("res/test.mp3")) {
        std::cout << "Failed to load music" << std::endl;
        return 1;
    }

    if (music.getStatus() != sf::Music::Status::Playing) {
        std::cout << "Music is not playing" << std::endl;
        return 1;
    }

    music.play();

    while (window.isOpen()) {
        sf::Event event;
        while (window.pollEvent(event)) {
            if (event.type == sf::Event::Closed) {
                window.close();
            }
        }
    }

    return 0;
}

However, when I try to run this program, the window never opens, sound/music never plays, and I get this in my console.

D:\PATH\NAME.exe
Process finished with exit code -1073741515 (0xC0000135)

When I remove the code related to music (sf::Music music{}; --> music.play();), the window does open and the program runs correctly.

Here is my CMakeLists.txt:

cmake_minimum_required(VERSION 3.26)
project(adaptive_audio)

set(CMAKE_CXX_STANDARD 17)

add_executable(adaptive_audio main.cpp)

set(SFML_STATIC_LIBRARIES TRUE)
set(SFML_DIR "./libraries/SFML/lib/cmake/SFML")

find_package(SFML COMPONENTS system audio network graphics window REQUIRED)

include_directories("./libraries/SFML/include/SFML")
target_link_libraries(adaptive_audio sfml-system sfml-audio sfml-network sfml-graphics sfml-window)

What am I doing wrong?
7
General / Re: Issue when running 2.6.0 AMR64 on M1
« Last post by eXpl0it3r on September 20, 2023, 12:50:57 pm »
The simplest solution is to build SFML yourself, that way the system should accept it even when unsigned.
With the SFML CMake Template, you get the downloading and building of SFML for free.

Other than that, you could try to use dylibs, which I think cause less issues than the frameworks.

I guess in the future, we'll have to try and get them signed somehow...
8
Window / Re: Issue with setting Mouse Position on Arch Linux
« Last post by ilovemac on September 20, 2023, 10:56:03 am »
No, nothing changes :/

(pic related)
Like said before, the Mouse Cursor "moves" to the given Location,
but appears in it's original spot.

I can also move the Mouse freely, even if the Cursor is set constantly per Code.

In the picture, you can see, that the VSCode element, where the Mouse Cursor is
moved, it beeing activated.

But if I press the Mouse button it should tecnically Invoke the VSCode element.
But it doesn't. So It's not a display issue
9
Window / Re: Issue with setting Mouse Position on Arch Linux
« Last post by eXpl0it3r on September 20, 2023, 10:07:32 am »
I can't recommend using multiple threads. There are a lot of things to consider.
It's okay if you off load some CPU workload, but you should always use SFML in your main thread.

What if you don't change the mouse position inside the event handle?
10
Window / Re: Issue with setting Mouse Position on Arch Linux
« Last post by ilovemac on September 20, 2023, 08:03:59 am »
Yes, I'm using multiple threads.
But I only use one, aside from the Thread, where my Window runs,
to reset my FPS Counter and to do some other non-related SFML stuff.

I've also made a "blank" project.
Just creating the window and the game loop:
public class Program{
    public static void Main(string[] args){
        new Main();
    }
}

public class Main : RenderWindow{
    public Main() : base (new VideoMode(800, 600), "Test"){
        this.SetFramerateLimit(60);
        this.SetVerticalSyncEnabled(false);

        this.MouseButtonReleased += (sender, e) => {
            Mouse.SetPosition(new Vector2i(100, 100));
        };

        while (this.IsOpen){
            this.DispatchEvents();
            this.Clear();

            // Draw Window

            this.Display();
        }
    }
}
 

Same Issue :/
Pages: [1] 2 3 ... 10