aboutsummaryrefslogtreecommitdiff
path: root/src/SfmlFixes.cpp
blob: d6d4b17b1eea6b8b518b654bf412ac004c5d6eeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "../include/SfmlFixes.hpp"
#include <mutex>

static std::mutex mutex;
namespace QuickMedia {
    bool load_image_from_file(sf::Image &image, const std::string &filepath) {
        std::lock_guard<std::mutex> lock(mutex);
        return image.loadFromFile(filepath);
    }

    bool load_image_from_memory(sf::Image &image, const void *data, size_t size) {
        std::lock_guard<std::mutex> lock(mutex);
        return image.loadFromMemory(data, size);
    }
}