Changeset 5271 in orxonox.OLD for trunk/src/lib/graphics
- Timestamp:
- Sep 28, 2005, 6:04:59 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/shader.cc
r5269 r5271 80 80 81 81 const char* program = fileRead(fileName); 82 if (program == NULL) 83 return false; 82 84 GLenum shader = 0; 83 85 if (type == SHADER_VERTEX && GLEW_ARB_vertex_shader) … … 116 118 int count = 0; 117 119 118 if (fileName != NULL) { 119 fileHandle = fopen(fileName, "rt"); 120 121 if (fileHandle != NULL) { 122 123 fseek(fileHandle, 0, SEEK_END); 124 count = ftell(fileHandle); 125 rewind(fileHandle); 126 127 if (count > 0) { 128 content = new char[count+1]; 129 count = fread(content, sizeof(char), count, fileHandle); 130 content[count] = '\0'; 131 } 132 fclose(fileHandle); 133 } 134 } 135 return content; 120 if (fileName == NULL) 121 return NULL; 122 123 fileHandle = fopen(fileName, "rt"); 124 125 if (fileHandle == NULL) 126 return NULL; 127 fseek(fileHandle, 0, SEEK_END); 128 count = ftell(fileHandle); 129 rewind(fileHandle); 130 if (count > 0) { 131 content = new char[count+1]; 132 count = fread(content, sizeof(char), count, fileHandle); 133 content[count] = '\0'; 134 } 135 fclose(fileHandle); 136 return content; 136 137 } 137 138
Note: See TracChangeset
for help on using the changeset viewer.