Create the vertex buffer object
| 40 | |
| 41 | // Create the vertex buffer object |
| 42 | bool VertexArrayObject::create() { |
| 43 | |
| 44 | // Destroy the current VAO |
| 45 | destroy(); |
| 46 | |
| 47 | // Check that the needed OpenGL extensions are available |
| 48 | bool isExtensionOK = checkOpenGLExtensions(); |
| 49 | if (!isExtensionOK) { |
| 50 | std::cerr << "Error : Impossible to use Vertex Array Object on this platform" << std::endl; |
| 51 | assert(false); |
| 52 | return false; |
| 53 | } |
| 54 | |
| 55 | // Generate a new VAO |
| 56 | glGenVertexArrays(1, &mVertexArrayID); |
| 57 | assert(mVertexArrayID != 0); |
| 58 | |
| 59 | return true; |
| 60 | } |
| 61 | |
| 62 | // Destroy the VAO |
| 63 | void VertexArrayObject::destroy() { |
nothing calls this directly
no outgoing calls
no test coverage detected