Skip to content

Instantly share code, notes, and snippets.

View RedactedProfile's full-sized avatar
🍁
Web & Game Developer

Kyle Harrison RedactedProfile

🍁
Web & Game Developer
View GitHub Profile
@d7samurai
d7samurai / .readme.md
Last active October 26, 2025 05:56
Minimal D3D11 sprite renderer

Minimal D3D11 sprite renderer

Minimal D3D11 sprite renderer: basic back-to-front sprite rendering reference code with example sprite sheet animation logic. As usual: Complete, runnable single-function app. No modern C++ / OOP / obscuring cruft.

adventurer

Swap out the sprite sheet with a font atlas for a lightweight GUI / text renderer. Clip individual sprites and glyphs by offsetting screenPos and atlasPos to top left corner of visible area and adjusting size accordingly (all values in pixels):

sprite.screenPos.x += 17;
sprite.screenPos.y += 10;
@d7samurai
d7samurai / .readme.md
Last active December 14, 2025 21:45
Minimal D3D11 bonus material: extra minimal triangle

Minimal D3D11 bonus material: extra minimal triangle

A quick side exercise to see how little code one can get away with to put that RGB triangle on screen using D3D11 (without bending over backwards with trickery). This is a complete app in < 40 LOC (including the HLSL).

pretty minimal d3d11 triangle

For more.. elaborate.. D3D11 reference code, see the original Minimal D3D11, Minimal D3D11 pt2 and Minimal D3D11 pt3

@d7samurai
d7samurai / .readme.md
Last active December 19, 2025 03:40
Minimal D3D11 pt3
@d7samurai
d7samurai / .readme.md
Last active December 18, 2025 01:13
Minimal D3D11 pt2

Minimal D3D11 part 2

Follow-up to Minimal D3D11, adding instanced rendering. As before: An uncluttered Direct3D 11 setup & basic rendering primer / API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion. No modern C++ / OOP / obscuring cruft.

The main difference here is that the hollow cube is rendered using instancing (which saves a lot of vertices compared to the original, so geometry data is now small enough to be included in the source without being too much in the way), but also all trigonometry and matrix math is moved to the vertex shader, further simplifying the main code.

In this case, each instance is merely this piece of geometry, consisting of 4 triangles:

[![instance

@jesusdesantos
jesusdesantos / main.cpp
Created January 8, 2019 14:10
NoesisGUI minimal sample using GLUT
#include <GLUT/glut.h>
#include <Noesis_pch.h>
static Noesis::IView* _view;
static void NoesisInit()
{
auto logHandler = [](const char*, uint32_t, uint32_t level, const char*, const char* message)
{
// [TRACE] [DEBUG] [INFO] [WARNING] [ERROR]
@d7samurai
d7samurai / .readme.md
Last active December 19, 2025 17:15
Minimal D3D11

Minimal D3D11

Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++, OOP or (other) obscuring cruft. View on YouTube

hollowcube

Other gists in this series:

@zeljic
zeljic / build_sqlite3_lib.md
Last active September 24, 2025 06:56
Build SQLite3 .lib file on windows

How to build SQLite3 .lib file on Windows 10

  1. Download source from source

    For example: source https://www.sqlite.org/2023/sqlite-amalgamation-3430100.zip

  2. Download binary from binary

    For example: binary https://www.sqlite.org/2023/sqlite-dll-win64-x64-3430100.zip

  3. Extract both archives to the same directory

@gamepopper
gamepopper / OpenGL.cpp
Created May 20, 2018 22:30
SFML 2.5.0's OpenGL Example, written using the modern OpenGL programmable pipeline instead of the legacy OpenGL fixed pipeline.
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
/// GLEW is needed to provide OpenGL extensions.
#include <GL/glew.h>
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>

Angular Universal (Webpack bundle + Docker deploy)

Tested with angular@5.

Install deps

npm i @angular/platform-server @nguniversal/express-engine @nguniversal/module-map-ngfactory-loader express @types/express ts-loader@3 rimraf --save-dev

Update src/app/app.module.ts

@maxivak
maxivak / 00. tutorial.md
Last active September 11, 2024 19:58
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler