Skip to content

Instantly share code, notes, and snippets.

@d7samurai
d7samurai / .readme.md
Last active April 17, 2026 01:54
Minimal D3D11 elaborations I

Minimal D3D11 elaborations I

A spin-off from the mainline Minimal D3D11 series, adding two-lane 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 itself 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, simplifying the main code (and not needing math.h).

In this case, each instance is mere

@mmozeiko
mmozeiko / win32_d3d11.c
Last active April 22, 2026 13:21
setting up and using D3D11 in C
// example how to set up D3D11 rendering on Windows in C
#define COBJMACROS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <d3d11.h>
#include <dxgi1_3.h>
#include <d3dcompiler.h>
#include <dxgidebug.h>
@mmozeiko
mmozeiko / d3d11_pixels.c
Last active February 27, 2026 12:37
drawing pixels in software & showing them to window by uploading via D3D11
#define COBJMACROS
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <d3d11.h>
#include <stdint.h>
#include <string.h>
#include <intrin.h>
@rhulha
rhulha / diabotical_rbe_map_files.bt
Created December 13, 2020 23:12
010 Editor Binary Template for the blocks of a Diabotical rbe map file.
LittleEndian();
char signature[4];
uint32 version;
uint64 u1a;
uint64 u1b;
char material_count;
uint32 u2;
uint32 block_count;
@Jelvan1
Jelvan1 / CGaz_StrafeHud.c
Last active May 1, 2024 20:49
Quake 3 DeFRaG 1.91.26 - CampingGaz-Hud (speedometer, accel bar, compass, cgaz)
#define M_PI 3.14159274101f
typedef struct
{
vec3_t prev_vel; // 0x0
float prev_width; // 0xc
int prev_commandTime; // 0x10
} accelBarState_t;
accelBarState_t accelBarState; // 0x2b0bb0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
//#include "matrix.cpp"
#include <windows.h>
#include <d3d11.h>
#include <dxgi.h>
#include <stdint.h>
#include <d3dcompiler.h>
#define assert(expr) if(!(expr)) { *((int *)0) = 0; }
#define invalidCodePath assert(false);

Core Coding Standard

Coding practices are a source of a lot of arguments among programmers. Coding standards, to some degree, help us to put certain questions to bed and resolve stylistic debates. No coding standard makes everyone happy. (And even their existence is sure to make some unhappy.) What follows are the standards we put together on the Core team, which have become the general coding standard for all programming teams on new code development. We’ve tried to balance the need for creating a common, recognizable and readable code base with not unduly burdening the programmer with minor code formatting concerns.

Table Of Contents

The Mosh and Quake 3 Networking Models and State Synchronization Algebra
========================================================================
Mosh is a new remote shell program and protocol: https://mosh.org/
You may read technical details about its internals here:
https://www.usenix.org/system/files/login/articles/winstein.pdf
https://mosh.org/mosh-paper.pdf