Textures are working now

This commit is contained in:
2023-11-19 11:39:48 -06:00
parent 830694ee0a
commit c2fb75df97
9 changed files with 93 additions and 69 deletions

View File

@ -71,14 +71,16 @@ void RenderHost::init(const std::shared_ptr<Game> game) {
backBufferRenderTarget->scale = (float_t)fbWidth / (float_t)windowWidth;
// Framebuffer callback
// glfwSetFramebufferSizeCallback(window, [&](
// GLFWwindow *window,
// int32_t width,
// int32_t height
// ) {
// if(this->window == nullptr || window != this->window) return;
// std::cout << "Resize" << std::endl;
// });
glfwSetFramebufferSizeCallback(window, [](
GLFWwindow *window,
int32_t width,
int32_t height
) {
// if(this->window == nullptr || window != this->window) return;
Game* game = (Game*)glfwGetWindowUserPointer(window);
assertNotNull(game, "Game cannot be null!");
game->renderHost.backBufferRenderTarget->setSize(width, height);
});
}
void RenderHost::update(const std::shared_ptr<Game> game) {
@ -96,6 +98,8 @@ void RenderHost::update(const std::shared_ptr<Game> game) {
assertNoGLError();
glDepthFunc(GL_LESS);
assertNoGLError();
glEnable(GL_DEPTH_TEST);
assertNoGLError();
// Pipeline
renderPipeline.render(game);