Jump to content
Posted 09 April 2008 - 09:58 PM
Posted 10 April 2008 - 03:55 AM
Posted 10 April 2008 - 06:34 PM
Posted 11 April 2008 - 02:08 AM
Posted 21 January 2013 - 04:32 AM
When uploading data from cooked binary data into your VBO's, you should just be able to blast through the data with a couple memcpy's.
I'm having trouble loading the data from my binary file after constructing it - shows up with a blank screen.
int length; char* data; ifstream is; is.open("model.bin", ios::binary); is.seekg(0, ios::end); length = is.tellg(); is.seekg(0, ios::beg); data = new char[length]; is.read(data, length); is.close(); glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, sizeof(data), data, GL_STATIC_DRAW);
How would I use memcpy to get this data into the buffer?