kinda forgot the point of loadFile()
This commit is contained in:
1 parent
c6e51524e9
commit
9a0ffa8cbe
1 file changed
+4
@@ -1,6 +1,7 @@
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <SDL/SDL.h>
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
@@ -21,6 +22,9 @@ char * loadFile(const char *fname)
|
||||
if (st.st_size <= 0)
|
||||
return NULL;
|
||||
char * buff = new char[st.st_size + 1];
|
||||
int fd = open(fname, O_RDONLY);
|
||||
read(fd, buff, st.st_size);
|
||||
close(fd);
|
||||
buff[st.st_size] = '\0';
|
||||
return buff;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user