This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderer | |
- sprite as pod type | |
- Online atlas compiler | |
- SDF shapes | |
- Local aa | |
- Local rounding | |
- Alpha discard cutouts and shrink wrap OBB quads | |
- Polylines with SDF compatible triangulation | |
- On demand glyph rasterization | |
- No need to declare utf8 codes up-front, extremely efficient storage for blur/bold/italic, multiple languages, multiple fonts, etc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define PICO_ECS_IMPLEMENTATION | |
#include <thirdparty/pico_ecs.h> | |
ecs_t* g_ecs; | |
//-------------------------------------------------------------------------------------------------- | |
// Components. | |
// Adds a component to the ECS. | |
// ...You must define T_ctor and T_dtor for your component. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-------------------------------------------------------------------------------------------------- | |
// Basic input polling. | |
// Original implementation by Noel Berry, taken from his Blah code on GitHub. | |
#define joy_press cf_joypad_button_just_pressed | |
#define joy_release cf_joypad_button_just_released | |
#define joy_axis cf_joypad_axis | |
#define joy_axis_prev cf_joypad_axis_prev | |
#define joy_down cf_joypad_button_down | |
#define joy_up !cf_joypad_button_down |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
//-------------------------------------------------------------------------------------------------- | |
// Dynamic array public API. | |
#define array_count(a) ((a) ? ARRAY_HEADER(a)->len : 0) | |
#define array_cap(a) ((a) ? ARRAY_HEADER(a)->cap : 0) | |
#define array_free(a) ((a) ? (free(ARRAY_HEADER(a)), (a)=NULL, 0) : 0) | |
#define array_add(a, val) (array__maybegrow(a, 1), (a)[ARRAY_HEADER(a)->len++] = (val)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Player:climb() | |
self.climbing = true | |
self:set_facing(self.climbable_wall_facing) | |
-- Initially zero out all y-vel to "latch" onto the wall. | |
if not self.climb_sliding then | |
self.vy = 0 | |
end | |
self.vx = 0 | |
self.climbing_needs_reset = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#ifndef VMATH_INLINE | |
# define VMATH_INLINE inline | |
#endif | |
VMATH_INLINE float clamp(float x, float minv, float maxv) { return fmaxf(minv, fminf(maxv, x)); } | |
VMATH_INLINE float lerp(float a, float b, float t) { return a * (1.0f - t) + b * t; } | |
struct V3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A portable "coroutine"-like thing for implementing FSM and behavior-cycles. | |
// | |
// Original implementation by Noel Berry. | |
// See: https://gist.github.com/NoelFB/7a5fa66fc29dd7ed1c11042c30f1b00e | |
// | |
// Routine is a set of macros useful to implement Finite State Machine type of | |
// behaviors. It works really well for simpler behaviors with loops or cycles, | |
// and works especially well for anything resembling a cutscene. | |
// | |
// The macros here are wrappers around a switch statement. All of the `rt_***` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 2D spatial hash implementation. | |
* | |
* The spatial hash is really good at representing grids in games. It only stores elements | |
* of the grid where items are inserted into the spacial hash, making it a memory-efficient | |
* option for grid games with lots of empty space between tiles/entities. | |
* | |
* Spatial hash queries are extremely fast for small queries covering low surface areas. | |
* | |
* Spatial hashes breakdown when queries cover large surface areas. This is because each |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Piorirty queue, used for implementing other algorithms such as | |
-- prioritized message queues, or the A* algorithm. | |
-- | |
-- Create a new priority q like so: | |
-- | |
-- q = prio_q() | |
-- | |
-- Add elements to the queue, each has a cost associated. THe cost is | |
-- used to sort the elements, where the lowest cost is considered the | |
-- highest priority (first out when pop() is called). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WHAT IS THIS? | |
I get asked a lot about recommendations for self-taught or self-learning to become professional developer, so I | |
am slowly working on a curriculum someone could follow. If finished in earnest, you'd be at roughly bachelor degree | |
level of competence without any holes in your education. If anyone is interested, please do take a look and provide | |
feedback! The format is to collate really high quality links to references organized by major topic and sub-categories. | |
By design this is C/C++ centric. This encourages the learning of low level details and fundamental knowledge that | |
transcends technological fads, ensuring the knowledge won't ever go out of date, easily translatable to other higher | |
level languages, frameworks, granting sustainable flexibility in career potential. |
NewerOlder