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
// Gradual-commit arena demonstration | |
// This is free and unencumbered software released into the public domain. | |
#include <stddef.h> | |
#include <string.h> | |
static void *os_reserve(ptrdiff_t); | |
static _Bool os_commit(void *, ptrdiff_t); | |
#define ARENA_PAGESIZE ((ptrdiff_t)1<<26) |
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 WIN32_LEAN_AND_MEAN | |
#include <winsock2.h> | |
#include <windows.h> | |
#define SECURITY_WIN32 | |
#include <security.h> | |
#include <schannel.h> | |
#include <shlwapi.h> | |
#include <assert.h> | |
#include <stdio.h> |
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
// | |
struct TerminalCell | |
{ | |
// cell index into GlyphTexture, should be two 16-bit (x,y) values packed: "x | (y << 16)" | |
uint GlyphIndex; | |
// 0xAABBGGRR encoded colors, nonzero alpha for Foreground indicates to render colored-glyph | |
// which means use RGB values from GlyphTexture directly as output, not as ClearType blending weights | |
uint Foreground; |
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
// 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> |
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
// example how to set up OpenGL core context on Windows | |
// and use basic functionality of OpenGL 4.5 version | |
// important extension functionality used here: | |
// (4.3) KHR_debug: https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt | |
// (4.5) ARB_direct_state_access: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_direct_state_access.txt | |
// (4.1) ARB_separate_shader_objects: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_separate_shader_objects.txt | |
// (4.2) ARB_shading_language_420pack: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shading_language_420pack.txt | |
// (4.3) ARB_explicit_uniform_location: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_explicit_uniform_location.txt |
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 COBJMACROS | |
#define NOMINMAX | |
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <d3d11.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <intrin.h> |
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 <stdarg.h> | |
#include <stdio.h> | |
static void write(FILE* f, const char* fmt, ...) | |
{ | |
va_list ap; | |
va_start(ap, fmt); | |
char ch; | |
while ((ch = *fmt++)) | |
{ |
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
// This file contains each 4coder theme definition and what it does within the editor. | |
// Main editor | |
defcolor_back = 0xFF000000; // Main buffer background | |
defcolor_text_default = 0xFFFFFFFF; // Default character foreground | |
defcolor_at_cursor = 0xFF000000; // Cursor foreground | |
defcolor_cursor = {0xFF000000, 0xFF000000}; // [0] Cursor background, [1] Active macro recording cursor background | |
defcolor_mark = 0xFF000000; // Mark background | |
defcolor_highlight_cursor_line = 0xFF000000; // Current line background | |
defcolor_margin_active = 0xFF000000; // Active buffer outline |
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
// cl.exe xbox_test.c /link setupapi.lib user32.lib | |
#include <windows.h> | |
#include <setupapi.h> | |
#include <dbt.h> | |
#include <stdio.h> | |
/// interface | |
#define XBOX_MAX_CONTROLLERS 16 |
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
// | |
// First download glcorearb.h, wglext.h and platform.h files | |
// Then compile: cl.exe capture_desktop_dxgi_gl.c /I. d3d11.lib dxgi.lib dxguid.lib gdi32.lib opengl32.lib user32.lib dwmapi.lib | |
// | |
#define COBJMACROS | |
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <d3d11.h> |
NewerOlder