yupplemayham/YuppleMayham/util.h
2024-06-21 16:59:06 -04:00

26 lines
No EOL
429 B
C++

#ifndef _H_UTIL_H
#define _H_UTIL_H
#include <SDL_video.h>
#include <random>
namespace UTIL
{
void flip_surface(SDL_Surface* surface);
class RandomGenerator
{
public:
RandomGenerator(float min, float max) :
rd(),
gen(rd()),
dist(min, max) {};
float genFloat() { return dist(gen); }
private:
std::random_device rd;
std::mt19937 gen;
std::uniform_real_distribution<float> dist;
};
}
#endif // _H_UTIL_H