MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / createShader

Function createShader

test/browser/test_gl_float_tex.c:110–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110GLuint createShader(const char source[], int type) {
111 GLint status;
112 char msg[512];
113 GLuint shader = glCreateShader(type);
114 glShaderSource(shader, 1, (const GLchar**)(&source), NULL);
115 glCompileShader(shader);
116 glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
117 if (status == GL_FALSE) {
118 glGetShaderInfoLog(shader, sizeof msg, NULL, msg);
119 printf("Shader info: \"%s\"\n", msg);
120 }
121 assert(status == GL_TRUE);
122 return shader;
123}
124
125static void gl_init(void) {
126 GLuint program = glCreateProgram();

Callers 1

gl_initFunction · 0.70

Calls 2

printfFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected