Skip to content

BareBones Graphics Library is just a small library im making which gives you the bare minimum to make rendering projects

License

Notifications You must be signed in to change notification settings

ElKaribooSama/bbgl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BBGL

BareBones Graphics Library is just a small library im making which gives you the bare minimum to make rendering projects

installation

  1. download or clone the project
  2. insert it in your project
  3. add bbgl.cpp and graphic_buffers.cpp to your makefile

usage

  1. declare the needed variables

    BBGL *bbgl;
    void update();
  2. fill the update and draw functions

    void update() {
        /** This i where you do logic stuff **/
        return;
    }
  3. create the BBGLOPTIONS object

    BBGLOPTIONS bbglOptions;
    bbglOptions.windowOptions.maxHeight = 1024;
    bbglOptions.windowOptions.maxWidth = 1024;
    bbglOptions.windowOptions.allowResize = true;
  4. create the bbgl object

    int main() {
        bbgl = new BBGL(bbglOptions);
        bbgl->update = update;
        bbgl->start();
        std::cout << "GoodBye World!" << std::endl;
        return 0;
    }
  5. change pixel data of the window

    bbgl->buffs->set_pixel(x, y, RGB(255,255,255));

    you can also use safe_set_pixel to prevent crashes but it is a bit slower

    bbgl->buffs->safe_set_pixel(x, y, RGB(255,255,255)); //RGB is a macro to turn 4 byte to a uint32_t

Note: Everything after bbgl->start() will only be called after the window is closed. If you need to setup things before the first
update you can do it before calling bbgl->start()

limitation

  1. scaling

    For now BBGL does not scale the buffer when resizing the window.

  2. OS

    BBGL is completely dependent on the Windows API.

contribution

You are welcome to post issues or pull requests in this repository.
It would be greatly appreciated to get a Mac and Linux implementation.

About

BareBones Graphics Library is just a small library im making which gives you the bare minimum to make rendering projects

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages