MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / compile

Method compile

src/platform/linux/graphics.cpp:102–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100 }
101
102 util::Either<shader_t, std::string> shader_t::compile(const std::string_view &source, GLenum type) {
103 shader_t shader;
104
105 auto data = source.data();
106 GLint length = source.length();
107
108 shader._shader.el = ctx.CreateShader(type);
109 ctx.ShaderSource(shader.handle(), 1, &data, &length);
110 ctx.CompileShader(shader.handle());
111
112 int status = 0;
113 ctx.GetShaderiv(shader.handle(), GL_COMPILE_STATUS, &status);
114
115 if (!status) {
116 return shader.err_str();
117 }
118
119 return shader;
120 }
121
122 GLuint shader_t::handle() const {
123 return _shader.el;

Callers

nothing calls this directly

Calls 3

handleMethod · 0.80
err_strMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected