My Project
 
Loading...
Searching...
No Matches
gl-wrappers.h
Go to the documentation of this file.
1// Copyright (c) 2025 Milton McDonald
2// This source code is licensed under the MIT License. See LICENSE file in the
3// project root for details.
4
5#ifndef ENGINE_LIB_GL_WRAPPERS_H_
6#define ENGINE_LIB_GL_WRAPPERS_H_
7
8#include <bitset>
9#include <memory>
10
11#include "dll-export.h"
12#include "gl-types.h"
13#include "i-gl-clear-flags.h"
14#include "types.h"
15
17
18DLLEXPORT [[nodiscard]] auto AttachShader(unsigned int program,
19 unsigned int shader)
21
23 unsigned int buffer)
25
26DLLEXPORT [[nodiscard]] auto BindVertexArray(unsigned int array)
28
30 long long int size, const void* data,
33
34DLLEXPORT [[nodiscard]] auto Clear(const gl_clear_flags::IGLClearFlags& flags)
36
37DLLEXPORT [[nodiscard]] auto CompileShader(unsigned int shader)
39
41
42DLLEXPORT [[nodiscard]] auto CreateShader(gl_types::GLShaderType shader_type)
44
45DLLEXPORT [[nodiscard]] auto DrawArrays(gl_types::GLDrawMode mode, int first,
46 int count) -> types::Expected<void>;
47
48DLLEXPORT [[nodiscard]] auto EnableVertexAttribArray(unsigned int index)
50
51DLLEXPORT [[nodiscard]] auto GenBuffers(int n, unsigned int* buffers)
53
54DLLEXPORT [[nodiscard]] auto GenVertexArrays(int n, unsigned int* arrays)
56
57DLLEXPORT [[nodiscard]] auto GetShaderInfoLog(unsigned int shader,
58 int max_length, int* length,
59 char* info_log)
61
62DLLEXPORT [[nodiscard]] auto GetShaderiv(
63 unsigned int shader, gl_types::GLShaderObjectParameter pname, int* params)
65
66DLLEXPORT [[nodiscard]] auto LinkProgram(unsigned int program)
68
69DLLEXPORT [[nodiscard]] auto ShaderSource(unsigned int shader, int count,
70 const char** string,
71 const int* length)
73
74DLLEXPORT [[nodiscard]] auto UseProgram(unsigned int program)
76
77DLLEXPORT [[nodiscard]] auto VertexAttribPointer(unsigned int index, int size,
79 unsigned char normalized,
80 int stride,
81 const void* pointer)
83
84} // namespace graphics_engine::gl_wrappers
85
86#endif // ENGINE_LIB_GL_WRAPPERS_H_
Definition i-gl-clear-flags.h:15
#define DLLEXPORT
Definition dll-export.h:19
GLDataType
Definition gl-types.h:26
GLDrawMode
Definition gl-types.h:52
GLBufferTarget
Definition gl-types.h:12
GLDataUsagePattern
Definition gl-types.h:40
GLShaderObjectParameter
Definition gl-types.h:66
GLShaderType
Definition gl-types.h:74
Definition gl-wrappers.h:16
DLLEXPORT auto CreateShader(gl_types::GLShaderType shader_type) -> types::Expected< unsigned int >
DLLEXPORT auto GenVertexArrays(int n, unsigned int *arrays) -> types::Expected< void >
DLLEXPORT auto LinkProgram(unsigned int program) -> types::Expected< void >
DLLEXPORT auto AttachShader(unsigned int program, unsigned int shader) -> types::Expected< void >
DLLEXPORT auto GenBuffers(int n, unsigned int *buffers) -> types::Expected< void >
DLLEXPORT auto VertexAttribPointer(unsigned int index, int size, gl_types::GLDataType type, unsigned char normalized, int stride, const void *pointer) -> types::Expected< void >
DLLEXPORT auto Clear(const gl_clear_flags::IGLClearFlags &flags) -> types::Expected< void >
DLLEXPORT auto BindBuffer(gl_types::GLBufferTarget target, unsigned int buffer) -> types::Expected< void >
DLLEXPORT auto GetShaderiv(unsigned int shader, gl_types::GLShaderObjectParameter pname, int *params) -> types::Expected< void >
DLLEXPORT auto BindVertexArray(unsigned int array) -> types::Expected< void >
DLLEXPORT auto BufferData(gl_types::GLBufferTarget target, long long int size, const void *data, gl_types::GLDataUsagePattern usage) -> types::Expected< void >
DLLEXPORT auto EnableVertexAttribArray(unsigned int index) -> types::Expected< void >
DLLEXPORT auto ShaderSource(unsigned int shader, int count, const char **string, const int *length) -> types::Expected< void >
DLLEXPORT auto CompileShader(unsigned int shader) -> types::Expected< void >
DLLEXPORT auto UseProgram(unsigned int program) -> types::Expected< void >
DLLEXPORT auto GetShaderInfoLog(unsigned int shader, int max_length, int *length, char *info_log) -> types::Expected< void >
DLLEXPORT auto DrawArrays(gl_types::GLDrawMode mode, int first, int count) -> types::Expected< void >
DLLEXPORT auto CreateProgram() -> types::Expected< unsigned int >
std::expected< T, std::error_code > Expected
Definition types.h:34