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
name
Definition cathedral.lua:11
Definition handle.h:12
local n
Definition dump_lights.lua:5
local l
Definition light.lua:23
Definition audio.cpp:7
std::uint32_t u32
Definition def.h:14
v[1]
Definition math.lua:22
Definition prog.h:19
bool bind_ubo(const char *name, u32 binding) const
Definition prog.cpp:122
bool create(u32 vert, u32 frag)
Definition prog.cpp:49
bool get_uniform_location(const char *name, int *l) const
Definition prog.cpp:96
bool set_uniform(const char *name, int v) const
Definition prog.cpp:104
bool destroy()
Definition prog.cpp:90
Definition prog.h:14
bool create(GLenum type, std::string_view name, std::span< const u8 > src)
Definition prog.cpp:16
bool destroy()
Definition prog.cpp:42