Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct File
- {
- GLchar* data;
- GLint len;
- };
- File loadFile(char* fname)
- {
- FILE* f = fopen(fname, "r");
- fseek(f, 0, SEEK_END);
- u32 size = ftell(f);
- fseek(f, 0, SEEK_SET);
- File file;
- file.data = new GLchar[size+1];
- fread(file.data, size, 1, f);
- file.len = size;
- file.data[size] = 0;
- printf(file.data);
- return file;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement