MCPcopy Index your code
hub / github.com/ad-si/LuaCAD / getARBProgram

Function getARBProgram

OpenCSG/src/context.cpp:94–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 }
93
94 static GLuint getARBProgram(GLenum target, const char* prog, int len)
95 {
96 int context = getContext();
97 ContextData& contextData = gContextDataMap[context];
98
99 std::map<const char*, GLuint>::iterator it = contextData.idFP.find(prog);
100 if (it == contextData.idFP.end())
101 {
102 GLuint id;
103 glGenProgramsARB(1, &id);
104 glBindProgramARB(target, id);
105 glProgramStringARB(target, GL_PROGRAM_FORMAT_ASCII_ARB, len, prog);
106
107 // GLint errorPos;
108 // glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos);
109 // const char * error = (const char*)glGetString(GL_PROGRAM_ERROR_STRING_ARB);
110 // printf("%s", error);
111
112 it = contextData.idFP.insert(std::pair<const char*, GLuint>(prog, id)).first;
113 }
114
115 return it->second;
116 }
117
118 GLuint getARBVertexProgram(const char* prog, int len)
119 {

Callers 2

getARBVertexProgramFunction · 0.85
getARBFragmentProgramFunction · 0.85

Calls 3

getContextFunction · 0.85
findMethod · 0.80
endMethod · 0.80

Tested by

no test coverage detected