Giter VIP home page Giter VIP logo

mingl's Introduction

MinGL

MinGL (Minimal Graphics Library) is a tiny graphics rendering class built on top of OpenGL. Its core function is MinGL::putPixel(), which receives the x/y coordinates and a color to draw a single pixel on the screen.

The idea is to serve as the most basic graphics API to try computer graphics concepts and algorithms such as line drawing, triangle rasterization, perspective projection etc, without the need to deal with complicated API states and calls. Without a graphics API, such concepts are usually tested using still images rendered to disc, but with MinGL you can see the results immediately.

Note: Since ray-tracing is very demanding, you better of writing an image to disc in such cases.

Screenshot

screenshot of a cube rendered with the sample program

The above image was drawn using MinGL within a DrawLine() function based on Bresenham’s Line Algorithm
Bresenham’s Line Algorithm used in the example code was based on https://github.com/ssloy/tinyrenderer/wiki

Usage

MinGL depends on glad and GLFW to work. Following is an example of how files could be organized:

Main.cpp
MinGL.h
MinGL.cpp
glad/khrplatform.h
glad/glad.h
glad/glad.c
GLFW/glfw3.h
GLFW/glfw3native.h

Note: If you are trying to run the example, don't forget to link the glfw2 binaries: https://www.glfw.org/download.

License

MinGL is licensed under MIT License

mingl's People

Contributors

amengol avatar tbeu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.