nngn
Loading...
Searching...
No Matches
prog.h
Go to the documentation of this file.
1#ifndef NNGN_GRAPHICS_OPENGL_PROGRAM_H
2#define NNGN_GRAPHICS_OPENGL_PROGRAM_H
3
4#include <span>
5#include <string_view>
6
7#include "utils/def.h"
8
9#include "handle.h"
10#include "opengl.h"
11
12namespace nngn {
13
14struct GLShader final : nngn::OpenGLHandle<GLShader> {
15 bool create(GLenum type, std::string_view name, std::span<const u8> src);
16 bool destroy();
17};
18
19struct GLProgram : OpenGLHandle<GLProgram> {
20 bool create(u32 vert, u32 frag);
21 bool create(
22 std::string_view vs_name, std::string_view fs_name,
23 std::span<const u8> vs, std::span<const u8> fs);
24 bool destroy();
25 bool get_uniform_location(const char *name, int *l) const;
26 bool set_uniform(const char *name, int v) const;
27 bool set_uniform(const char *name, GLsizei n, const int *v) const;
28 bool bind_ubo(const char *name, u32 binding) const;
29};
30
31}
32
33#endif
Definition: handle.h:12
name
Definition: cathedral.lua:11
l
Definition: light.lua:23
n
Definition: dump_lights.lua:5
v[1]
Definition: math.lua:19
Definition: audio.cpp:7
std::uint32_t u32
Definition: def.h:14
Definition: prog.h:19
bool bind_ubo(const char *name, u32 binding) const
bool create(std::string_view vs_name, std::string_view fs_name, std::span< const u8 > vs, std::span< const u8 > fs)
bool create(u32 vert, u32 frag)
bool get_uniform_location(const char *name, int *l) const
bool set_uniform(const char *name, GLsizei n, const int *v) const
bool set_uniform(const char *name, int v) const
bool create(GLenum type, std::string_view name, std::span< const u8 > src)