Textures are working now
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user