From 6698c81d0628e917beb75f71383e3b3108b0804c Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 12 Dec 2021 16:07:41 +0000 Subject: Move program handle to its own files --- gfx/gl/programHandle.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 gfx/gl/programHandle.cpp (limited to 'gfx/gl/programHandle.cpp') diff --git a/gfx/gl/programHandle.cpp b/gfx/gl/programHandle.cpp new file mode 100644 index 0000000..bfe06f2 --- /dev/null +++ b/gfx/gl/programHandle.cpp @@ -0,0 +1,14 @@ +#include "programHandle.h" +#include "glSource.h" + +ProgramHandleBase::ProgramHandleBase(GLuint vs, GLuint fs) : viewProjection_uniform {}, model_uniform {} +{ + glAttachShader(m_program, vs); + glAttachShader(m_program, fs); + + glLinkProgram(m_program); + GLsource::CheckShaderError(m_program, GL_LINK_STATUS, true, "Error linking shader program"); + + glValidateProgram(m_program); + GLsource::CheckShaderError(m_program, GL_VALIDATE_STATUS, true, "Invalid shader program"); +} -- cgit v1.2.3