initial commit
This commit is contained in:
33
include/opengl/handles/shader_program_handle.hpp
Normal file
33
include/opengl/handles/shader_program_handle.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include "GL/glew.h"
|
||||
#include "opengl/shader_program_variable.hpp"
|
||||
|
||||
#include "opengl/shader_program_variable.hpp"
|
||||
#include "util/uix.hpp"
|
||||
#include <span>
|
||||
|
||||
namespace zgl
|
||||
{
|
||||
struct shader_program_handle
|
||||
{
|
||||
using attribute_support_type = ztu::u32;
|
||||
using uniform_support_type = ztu::u32;
|
||||
|
||||
inline void bind() const;
|
||||
static void unbind();
|
||||
|
||||
template<shader_program_variable::info_type VariableInfo, typename T>
|
||||
void set_uniform(const T& value) const;
|
||||
|
||||
[[nodiscard]] attribute_support_type check_attribute_support(std::span<const shader_program_variable> attributes) const;
|
||||
|
||||
[[nodiscard]] uniform_support_type check_uniform_support(std::span<const shader_program_variable> uniforms) const;
|
||||
|
||||
GLuint program_id{ 0 };
|
||||
};
|
||||
}
|
||||
|
||||
#define INCLUDE_GL_SHADER_PROGRAM_INSTANCE_IMPLEMENTATION
|
||||
#include "opengl/handles/shader_program_handle.ipp"
|
||||
#undef INCLUDE_GL_SHADER_PROGRAM_INSTANCE_IMPLEMENTATION
|
||||
Reference in New Issue
Block a user