WinD (Windows Display) is a minimalistic, high-performance Windows DLL written entirely in x64 assembly for real-time console rendering and asynchronous .wav audio playback.
WinD enables efficient full-frame updates of the Windows console by calling WriteConsoleOutputW once per frame, significantly reducing flicker and eliminating the overhead of character-by-character output. Each character cell supports independent foreground and background color attributes along with full Unicode support, allowing for vibrant, smooth console-based UIs, visualizations, or games. For more advanced text styling beyond the basic CHAR_INFO structure, WinD also supports UTF-16 string output with Virtual Terminal (ANSI escape sequences) enabled.
Additionally, WinD provides simple audio playback functions leveraging the PlaySoundW API to play .wav files asynchronously or stop playback on demand — ideal for adding sound effects or music alongside rendering.
- Atomic frame rendering via
WriteConsoleOutputW - Color and Unicode support with per-cell
CHAR_INFO - Low flicker, low latency — ideal for dynamic visuals
- Simple
.wavplayback usingPlaySoundW(async) - UTF-16 text output with Virtual Terminal processing (ANSI colors and styles)
- Compact assembly codebase, no runtime dependencies
WinD doesn't "wind" it for you? Suggest new features or report bugs here.
- examples - Sample codes demonstrating WinD usage
- images - Sample images and screenshots demonstrating WinD output and usage.
- src - Assembly source code and build files.
- LICENSE - License terms for WinD.
- README.md - This documentation.
To build winD.dll you need:
- NASM (Netwide Assembler)
- Visual Studio (x64 tools)
- Windows SDK (
kernel32.lib,winmm.lib)
cd src
nasm -f win64 winD.asm -o winD.obj
link /DLL /NOENTRY /OPT:REF /OPT:ICF /DEF:winD.def winD.obj kernel32.lib winmm.lib /OUT:winD.dll Output files:
winD.dll— Runtime DLLwinD.lib— Import librarywinD.exp— Export map
void render_frame(const CHAR_INFO* buffer, DWORD length, SHORT rows, SHORT cols, SHORT offset_x, SHORT offset_y); buffer: Pointer to a flat array ofCHAR_INFOstructs (row-major order)length: Total number ofCHAR_INFOelements in the bufferrows,cols: Dimensions of the rectangular region to renderoffset_x,offset_y: Position in the console screen buffer where the region will be drawn
0on success-1on failure (useGetLastErrorfor detailed Windows error code)
Performs atomic rendering of a rectangular console region by writing a full frame in a single call to WriteConsoleOutputW. This eliminates flicker caused by per-character output and supports full Unicode and color attributes per character cell. The function caches the console output handle internally for performance.
int write_text(const wchar_t* buffer, DWORD length, CHAR cursor_persist); buffer: Pointer to a UTF-16 encoded stringlength: Length of the string in characterscursor_persist: If non-zero, the console cursor returns to its original position after writing; if zero, the cursor stays at the end of the written text.
0on success-1on failure (useGetLastErrorfor detailed Windows error code)
Enables Virtual Terminal (ANSI escape) processing on the console output, allowing the use of advanced text styling such as 24-bit RGB colors and cursor movement via escape sequences. Writes the UTF-16 string to the console using WriteConsoleW. Optionally preserves or resets the cursor position after output. This function caches the console output handle and console mode for efficient repeated calls.
int play_audio(const wchar_t* soundFilePath); soundFilePath: Wide string path to a.wavfile
0on success-1on failure (useGetLastErrorfor detailed Windows error code)
Plays the specified .wav sound file asynchronously using PlaySoundW with flags SND_FILENAME | SND_ASYNC. Ideal for background music or sound effects in console applications.
int stop_audio(void); 0on success-1on failure (useGetLastErrorfor detailed Windows error code)
Stops any currently playing sound by calling PlaySoundW with NULL parameters.
Below are example outputs from the sample code in the examples folder:
This one works as expected — trust me! :)
MIT License — see LICENSE for details.


