Skip to content

cGrafix! It's a lightweight graphics engine built in pure C that can render images, text, and 2D shapes. Perfect for game development and computer graphics enthusiasts.

License

Notifications You must be signed in to change notification settings

ManojTGN/Cgrafix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cGrafix

logo (2)

Cgrafix is a lightweight C graphics library that works only on Windows. It uses the native Windows API to render shapes, text, and visuals directly on the screen. No extra dependencies needed.

Features

  • Simple and minimal graphics setup in C
  • Uses Win32 GDI for drawing
  • Fast and native — no external libraries

Platform

Windows only

Example Code

#include "../src/grafix.h"

int main(){
    grafixInit();

    grafixWindow window;
    createGrafixWindow(&window,800,800,"GrafixWindow");
    showGrafixWindow(window);

    int eventSize;
    grafixEvent* event;

    while(!isGrafixWindowEnded(window)){
        fillGrafixWindow(window,(grafixColor){0,0,0});
        manageGrafixEvent(window,&event,&eventSize);
        for(int i = 0; i < eventSize; i++){
            if(event[i].type == WM_DESTROY){
                endGrafixWindow(window);
                return 0;
            }
        }
        updateGrafixWindow(window);
        updateGrafixTime(window);
        tickGrafix(window,20);
    }
    return 0;
}

Example Renders


License

MIT License

About

cGrafix! It's a lightweight graphics engine built in pure C that can render images, text, and 2D shapes. Perfect for game development and computer graphics enthusiasts.

Topics

Resources

License

Stars

Watchers

Forks