diff --git a/src/nostalgia/glutils/glutils.cpp b/src/nostalgia/glutils/glutils.cpp index 66dc2970..2aee3891 100644 --- a/src/nostalgia/glutils/glutils.cpp +++ b/src/nostalgia/glutils/glutils.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved. + * Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved. */ #include @@ -46,6 +46,13 @@ template struct GLObject; template struct GLObject; template struct GLObject; + +void bind(const FrameBuffer &fb) noexcept { + glBindFramebuffer(GL_FRAMEBUFFER, fb); + glViewport(0, 0, fb.width, fb.height); +} + + static ox::Result buildShader(GLuint shaderType, const GLchar *src, ox::CRStringView shaderName) noexcept { GLShader shader(glCreateShader(shaderType)); glShaderSource(shader, 1, &src, nullptr); diff --git a/src/nostalgia/glutils/glutils.hpp b/src/nostalgia/glutils/glutils.hpp index be57a4b4..54115e82 100644 --- a/src/nostalgia/glutils/glutils.hpp +++ b/src/nostalgia/glutils/glutils.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved. + * Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved. */ #pragma once @@ -134,6 +134,8 @@ struct FrameBuffer { } }; +void bind(const FrameBuffer &fb) noexcept; + ox::Result buildShaderProgram(const GLchar *vert, const GLchar *frag, const GLchar *geo = nullptr) noexcept;