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 c61f216d37 - Simple rectangle drawing
- We just add to a frame of quads which the renderer deals with in gfx_update
	- draw_quad, draw_rect, draw_rect_rotated
	- Currently just implemented with legacy opengl, so we can't do custom shading
- Added third party code from lodepng so we can load pngs without any other dependencies (no C includes)
- ALLOCATOR_REALLOCATE
- Basic Vector2, Vector3, Vector4 stuff, and some math utilities
- Added <math.h> dependency for now.
- Graphics renderer frontend layer
- Naive get_random() implementation
2024-06-29 13:27:37 +02:00

13 lines
332 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;
}