Skip to content

gloggers99/gfx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

banner

forthebadge forthebadge

Getting Started

What is GFX

GFX is a simple C++ graphics library that uses GLFW to create a basic multiplatform window, then provide easy to use rendering tools using the GFX:: directive. Automatic shader hot reloading showcase

Features

  • Easy to use VAO, VBO, and EBO classes
  • .OBJ file importer made from scratch built for efficiency
  • Texture System (needs to be redone)
  • Automatic hot reloadable shader compilation
  • Compatibility with ALL custom opengl drawing code (theoretically you could use GFX to load OpenGL then use OpenGL code to do the rest)
  • Full ImGui implementation

Hello World

#include <GFX.h>

int main() {
    GFX::Renderer renderer = GFX::Renderer();
    GFX::Shader shader = GFX::Shader("defaultShader");
    GFX::Camera camera = GFX::Camera();

    // the definition of a vertex is subject to change.
    std::vector<GFX::Vertex> vertices = {
        {{0.5, -0.5, 0.0}},
        {{-0.5, -0.5, 0.0}},
        {{0.0, 0.5, 0.0}}
    };

    GFX::VertexStack stack = GFX::VertexStack(vertices);

    auto draw = [&](float deltaTime) {
        shader.updateUniform("camera", camera.createCameraMatrix(&renderer));
        stack.draw(&shader);
    };

    renderer.loop(draw);

    return 0;
}

About

A 3D C++ graphics library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages