| 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 | { |
no test coverage detected