This repository has been archived on 2025-02-04. You can view files and clone it, but cannot push or open issues or pull requests.
helpless/oogabooga/random.c
Charlie b15c7c6e41 - Fixed D3D11 eating 40000000 cycles for no reason (Thank you Bill Gates)
- Refactor drawing to keep blocks persistent in memory
- Make string usage easier & more consisten (macros for string vs const char*)
- rdtsc intrinsic (get cycle count)
- Profiling macros (generates a google trace json)
- Write D3D11 debug messages to stdout
- String_Builder & thorough tests for it
2024-07-02 15:27:33 +02:00

17 lines
No EOL
412 B
C

// This is a naive implementation for now (LCG)
// Distribution will probably suck.
#define RAND_MAX_64 0xFFFFFFFFFFFFFFFFull
#define MULTIPLIER 6364136223846793005ull
#define INCREMENT 1ull
u64 seed_for_random = 1;
u64 get_random() {
seed_for_random = seed_for_random * MULTIPLIER + INCREMENT;
return seed_for_random;
}
f32 get_random_float32() {
return (float32)get_random()/(float32)UINT64_MAX;
}