Game Dev Engine #10. Dynamic Pixel Zoom.

Опубликовано: 10 Август 2026
на канале: Jason Doucette
1,315
14

2023-09-02. Xona System 8 is a game development engine written using the MonoGame framework. This showcases the engine's response to Windows WM_SIZING events to dynamically change the backbuffer, and update the pixel scaling factor (in 3 different scaling methods), to showcase our low resolution screen, which continues to update, to the final canvas. This includes maximizing and minimizing the window.

The screen resolution is 1920 x 1080.
The game resolution is 312 x 160.

You may notice at the beginning that the resizing of the corner also impacts the other corner. But after this event finishes, subsequent events do not have this feature. It is actually a bug in the MonoGame framework, but could very well be a desire -- it reminds me of the MacOS file-box interface. After all, why would you only want to change one half of a window that you wish to zoom in on? I have debugged the MonoGame framework and submitted feedback here:

forum: https://community.monogame.net/t/real...
bug report: https://github.com/MonoGame/MonoGame/...

The 3 rendering methods are as follows:
1. integer (pixel-perfect) pixel zoom
2. aspect-ratio correct pixel zoom (isotropic = X and Y are the same)
3. stretch-to-fit pixel zoom (anisotropic = X and Y need not be the same)

This also showcases a little asteroid shooting game, which is actually the first proto-game that I've ever made with this engine. It is showcasing that the mouse control and aiming are correct regardless of the game resolution, pixel zoom / stretch factor, and window positioning. Also, the mouse doesn't impact the game while in middle of resizing.

Video was recorded with the free & open source: OBS Studio 29.1.3.

Playlists:
--------------
Xona System 8:    • Game Dev Engine #1. A New Beginning.  
Voxel:    • Voxel Engine #8 - Correct Peripheral Disto...  
Ray Cast:    • 3D Ray Casting Engine: #4 (Global Game Jam...  
Graph-All:    • #1 Graph-All Equation Renderer - Multiple ...  
Scroll Shmup:    • The First Pixel: Devlog #9 - Enemies, Anim...  
Road:    • Pseudo 3D Road #8 - infinite vegetation, t...  
Arena Shmup:    • Arena Shmup Demo #3 - Object Pool Optimiza...  
Wave Function:    • A.I. Texture Generation, High Res (Wave Fu...  
3D Polygon:    • 3D Polygon Engine #9 - Multiple Materials,...  
GW-BASIC:    • GW-BASIC - Escape From Monster Caverns - C...  

Websites:
---------------
GitHub: https://github.com/JDoucette
Blog: http://thefirstpixel.com
Studio: http://xona.com