-
Notifications
You must be signed in to change notification settings - Fork 0
NodGL Index
NtinosTheGamer2324 edited this page Mar 7, 2026
·
1 revision
NodGL is ModuOS's powerful graphics library for creating games and graphical applications!
Start here if you're new to graphics programming:
- Getting Started - Your first NodGL program
- Drawing Shapes - Rectangles, circles, lines, and more
- Using Textures - Images, sprites, and backbuffers
- Handling Input - Mouse and keyboard controls
- Simple Examples - Complete programs to learn from
Want to make games? Check out Blit Engine - a complete game framework built on NodGL!
Blit Engine is located in EXTERNAL/Blit/ and includes:
- Complete 2D game framework
- Entity/sprite management
- BlitStudio visual editor
- Example games
For experienced developers:
- NodGL API Reference - Complete function documentation
- Performance Tips - Make your programs faster
- 3D Graphics - Basic 3D rendering techniques
- Games - Platformers, shooters, puzzle games
- Graphics demos - Fractals, animations, visualizations
- GUI applications - Calculators, paint programs, file browsers
- Educational programs - Interactive tutorials, simulations
#include "NodGL.h"
#include "libc.h"
int md_main(long argc, char **argv) {
// Create graphics device
NodGL_Device device;
NodGL_Context ctx;
NodGL_CreateDevice(NodGL_FEATURE_LEVEL_1_0, &device, &ctx, NULL);
// Clear screen to blue
NodGL_ClearContext(ctx, NodGL_CLEAR_COLOR, 0xFF0000FF, 1.0f, 0);
// Draw a red square
NodGL_FillRectContext(ctx, 100, 100, 200, 200, 0xFFFF0000);
// Show it
NodGL_PresentContext(ctx, 1);
// Wait
for (volatile int i = 0; i < 5000000; i++);
// Cleanup
NodGL_ReleaseDevice(device);
return 0;
}- Device - Represents your graphics hardware
- Context - Where you issue drawing commands
Colors use ARGB format: 0xAARRGGBB
-
0xFFFF0000= Red -
0xFF00FF00= Green -
0xFF0000FF= Blue
Most programs follow this pattern:
while (running) {
// 1. Handle input
// 2. Update game logic
// 3. Clear screen
// 4. Draw everything
// 5. Present frame
}Absolute Beginner (no graphics experience):
- Read Getting Started
- Type out Example 1 from Simple Examples
- Modify the colors and positions
- Try Drawing Shapes
Some C Experience:
- Skim Getting Started
- Read Handling Input
- Build the Pong game from Simple Examples
- Start with the Game Engine
Experienced Programmer:
- Check NodGL API Reference
- Look at Game Engine source code
- Read Performance Tips
- Build something awesome!
-
Source Code - All examples are in
/userland/directory -
Header File -
NodGL.hhas all function signatures -
Library -
lib_NodGL.ccontains the implementation
Share your NodGL creations! Check out what others have made:
- Snake game (
snakegfx.c) - Minesweeper (
minesgfx.c) - Calculator (
calcgfx.c) - Paint program (
paintgfx.c)
- Hardware Acceleration - Uses GPU when available
- Simple API - Easy to learn, hard to mess up
- Fast - Optimized for performance
- Flexible - From simple shapes to complex 3D
- Well Documented - Lots of examples and guides
Start your journey: Getting Started →