summaryrefslogtreecommitdiff
path: root/gfx/gl/glSource.h
blob: c6b1f4173fc994bbc3215642a9fec003868dfa08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once

#include <GL/glew.h>
#include <glRef.hpp>
#include <string_view>

struct GLsource {
	using ShaderRef = glRef<GLuint, &__glewCreateShader, &__glewDeleteShader>;

	const GLchar * text;
	GLint len;
	GLuint type;

	[[nodiscard]] ShaderRef compile() const;
	static void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string_view errorMessage);
};