tried to implement rendering with bgfx, dnf

This commit is contained in:
Aaro Koivukangas
2025-05-19 08:34:42 +03:00
parent c4a8ab7cb8
commit d6bf49d19e
21 changed files with 641 additions and 92 deletions
+34
View File
@@ -0,0 +1,34 @@
#pragma once
#include <vector>
#include "gwindow.h"
#include "logger.h"
#include "vertex.h"
class GRenderer {
public:
GRenderer(GWindow *w, Logger *l);
~GRenderer();
void init();
void update();
private:
Logger *logger;
GWindow *window;
bgfx::ShaderHandle vsh;
bgfx::ShaderHandle fsh;
bgfx::ProgramHandle program;
bgfx::VertexBufferHandle vbh;
bgfx::IndexBufferHandle ibh;
std::vector<PosColVertex> *vertexes;
std::vector<int> *tri_list;
bgfx::VertexLayout layout;
void bgfx_init();
void shader_init();
bgfx::ShaderHandle load_shader(const char *name);
};