ldb is a very small single-file framework for game jams. It provides the bare necessities and nothing else.
Think QBASIC and BGI.
This is what a simple project looks like:
#define USE_LDB
Product: BR | |
Units: dBZ | |
Scale: 1.0 | |
Step: 5.0 | |
Color4: 0.0 25 93 118 0 | |
Color4: 5.0 150 156 255 242 | |
Color: 10.0 0 31 75 | |
Color: 15.0 0 0 246 | |
Color: 20.0 209 229 110 | |
Color: 30.0 29 117 22 |
/*************************************************************************** | |
BSpline.h - Utilities for BSpline operations | |
This is a C++ adaptation of Tagussan's JavaScript BSpline library. Typically | |
BSpline basis functions are implemented recursively by De Boor's algorithm, | |
but in this case we're using pre-calculated uniform knot BSpline bases for | |
speed. Unlike Tagussan's library, this only supports 2D coordinate systems. | |
--- |
void DrawString(SDL_Renderer* renderer, const char* txt, int x, int y) { | |
static uint64_t font[] = {0x7cfc3cfcfefe3cc6,0x7e7ec6c0c6c67cfc,0x7cfc7cfcc6c6c6c6,0xccfe187c0000600c,0x0000c6c666c6c0c0, | |
0x66c61818ccc0eee6,0xc6c6c6c6c630c6c6,0xc6c6cc0618c60000,0x30180000c6c6c0c6,0xc0c0c0c61818d8c0,0xfef6c6c6c6c6c030, | |
0xc6c6c66ccc0c1806,0x00001830fc00fefc,0xc0c6f8f8c0fe1818,0xf0c0d6dec6c6c6c6,0x7030c6c6c6387818,0x180c00000c600000, | |
0xc6c6c0c6c0c0cec6,0x1818d8c0c6cec6fc,0xc6fc1c30c6c6d66c,0x3030181800000c60,0x0000c6c6c0c6c0c0,0xc2c61818ccc0c6c6, | |
0xc6c0c6c60630c6c6,0xfec6306018300000,0x1830fc00c6c666c6,0xc0c066c61818c6c0,0xc6c6c6c0ccc6c630,0xc66ceec630c00000, | |
0x180830180000c6fc,0x3cfcfec03cc67e70,0xc6fec6c67cc07ac6,0x7c307c38c6c630fe,0x18301818600c0000,0x0c0000007c187c7c, | |
0xccfe7cfe7c7c7c30,0x467c6c000000d8c0,0xe0e060c030c03060,0x3c3c0c000000c638,0xc6c6ccc0c606c6c6,0xc678e6d66c00c0c0, | |
0xd8c0c060c0606060,0x30604242183000cc,0xc6180606ccc0c006,0 |
/* | |
* This function assumes the existence of an active Dear ImGui window | |
*/ | |
void RenderDropShadow(ImTextureID tex_id, float size, ImU8 opacity) | |
{ | |
ImVec2 p = ImGui::GetWindowPos(); | |
ImVec2 s = ImGui::GetWindowSize(); | |
ImVec2 m = {p.x + s.x, p.y + s.y}; | |
float uv0 = 0.0f; // left/top region | |
float uv1 = 0.333333f; // leftward/upper region |