Added some basic font rendering and texas holdem

This commit is contained in:
2021-05-03 21:32:40 -07:00
parent 96db74a546
commit 469750b0a0
31 changed files with 826 additions and 67 deletions

View File

@ -5,6 +5,7 @@
#pragma once
#define mathMod(a,b) (a%b+b)%b
#define mathMax(a,b) (a<b?b:a)
#define mathMin(a,b) (a>b?b:a)
#define mathMod(a,b) (a%b+b)%b
#define mathMax(a,b) (a<b?b:a)
#define mathMin(a,b) (a>b?b:a)
#define mathAbs(n) (n<0?-n:n)

28
src/util/rand.h Normal file
View File

@ -0,0 +1,28 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#include <dawn/dawn.h>
/**
* Generate a number between 0 and max. (max exclusive)
*
* @param max Max number to generate
* @return Number between 0 and max.
*/
#define u32rand(max) (rand()%max)
#define u8rand(max) (uint8_t)u23rand(max)
/**
* Generate a number between min and max. (max exclusive, min inclusive)
*
* @param min Min number to generate.
* @param max Max number to generate.
* @return Number between min and max.
*/
#define u32randRange(min, max) (u32rand(max-min)+min)
#define u8randRange(min, max) (uint8_t)u32randRange(min,max)