I began my journey with computers and programming during the era of 386 PCs, a time when DOS games ruled and sparked endless curiosity. I remember playing those games and wondering how they were created. It wasn’t long before I discovered Mode 13h - a graphics mode that perfectly fit within a 64kB page in 16-bit code, thanks to its 8 bits per pixel, 256-color palette, and 320×200 resolution.
Many years and APIs have passed since, but every now and then, I feel nostalgic for that simpler time. Back then, all we had was an array of pixels and an idea - and that was all we needed. I recall the breathtaking graphical demos that showcased incredible creativity, often categorized by their size. Some were only a few kilobytes but managed to display complex scenes with textures, geometry, animations, and even synchronized music.
That era had a certain magic. Many of the games of that time are legendary, and are still being ported to modern platforms and APIs today. Revisiting that period feels like embarking on an archaeological adventure - uncovering hidden treasures in the form of old code, design principles, and mathematical tricks. While reliving those times, I often reflect on the stark contrast with today: CPUs are now far more powerful than the high-end GPUs of the early 2000s, offering astounding possibilities. Yet, with all this power, we’ve lost much of the simplicity in the creative process.
To bring back the spirit of Mode 13h, I decided to create a toolkit and its OpenGL bindings. The idea here is simple: setup a textured polygon (two triangles) and make sure it covers the viewport exactly while updating its texture for each frame. Technically we have the power of GPU on our side as well. This is especially useful when we need to scale the image up (or down) to match the screen resolution. The texture data we update is essentially a frame from our framebuffer!
Technical Details & Usage:
Base C# project: Provides examples,IRasterizerinterface and direct pixel access.
Built with
Resolutions: default is 1920×1080 (Full HD), customizable via-w,-hoptions, works with any resolution. Tested with 3840×2160 (4K).
Modes: full screen (-f) and windowed (default).
V-Sync Support: Enable with-vto synchronize rendering with display refresh rate.
Color Depth: 24-bit RGB (True Color), supporting 16.7 million colors.
Each pixel uses 3 bytes (RGB), eliminating the need for palettes.
Framebuffer:
Linear framebuffer for direct pixel manipulation.
Double Buffering: Default method (parameter-l 1is default).
Triple Buffering: Optional (-l 2or more) for higher fps.
Rendering:
Direct pixel manipulation by the CPU in the framebuffer. Frame is rendered onto the screen using OpenGL as a texture.
Command-Line Interface:dotnet mode13hx.dll [command] [options]
Input Handling: Simplified input via↗ Original-Artikel auf dev.to lesenVollständiger Original-BerichtAusführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
SOCIAL SHARE CARD GENERATOR