Create the vertex buffer object
| 41 | |
| 42 | // Create the vertex buffer object |
| 43 | bool VertexBufferObject::create() { |
| 44 | |
| 45 | // Destroy the current VBO |
| 46 | destroy(); |
| 47 | |
| 48 | // Check that the needed OpenGL extensions are available |
| 49 | bool isExtensionOK = checkOpenGLExtensions(); |
| 50 | if (!isExtensionOK) { |
| 51 | std::cerr << "Error : Impossible to use Vertex Buffer Object on this platform" << std::endl; |
| 52 | assert(false); |
| 53 | return false; |
| 54 | } |
| 55 | |
| 56 | // Generate a new VBO |
| 57 | glGenBuffers(1, &mVertexBufferID); |
| 58 | assert(mVertexBufferID != 0); |
| 59 | |
| 60 | return true; |
| 61 | } |
| 62 | |
| 63 | // Copy data into the VBO |
| 64 | void VertexBufferObject::copyDataIntoVBO(GLsizei size, const void* data, GLenum usage) { |
nothing calls this directly
no outgoing calls
no test coverage detected