Commit | Line | Data |
---|---|---|
161c4476 K |
1 | // File: OpenGl_ResourceVBO.cxx |
2 | // Created: 18.03.11 9:50:00 | |
3 | // Author: Anton POLETAEV | |
4 | ||
5 | #include <OpenGl_ResourceVBO.hxx> | |
2166f0fa | 6 | #include <OpenGl_Context.hxx> |
161c4476 K |
7 | |
8 | //======================================================================= | |
9 | //function : OpenGl_ResourceVBO | |
10 | //purpose : Constructor | |
11 | //======================================================================= | |
2166f0fa SK |
12 | OpenGl_ResourceVBO::OpenGl_ResourceVBO (GLuint theId) |
13 | : OpenGl_Resource (theId) | |
161c4476 | 14 | { |
2166f0fa | 15 | // |
161c4476 K |
16 | } |
17 | ||
18 | //======================================================================= | |
19 | //function : OpenGl_ResourceVBO | |
20 | //purpose : Copy constructor | |
21 | //======================================================================= | |
2166f0fa SK |
22 | OpenGl_ResourceVBO::OpenGl_ResourceVBO (const OpenGl_ResourceVBO& theResource) |
23 | : OpenGl_Resource (theResource) | |
161c4476 | 24 | { |
2166f0fa | 25 | // |
161c4476 K |
26 | } |
27 | ||
28 | //======================================================================= | |
29 | //function : Clean | |
30 | //purpose : free OpenGl memory allocated for vbo resource | |
31 | //======================================================================= | |
2166f0fa | 32 | void OpenGl_ResourceVBO::Clean (const Handle(OpenGl_Context)& theGlContext) |
161c4476 | 33 | { |
2166f0fa SK |
34 | if (theGlContext->arbVBO == NULL) |
35 | { | |
36 | std::cerr << "OpenGl_ResourceVBO::Clean(), active GL context doesn't support VBO!\n"; | |
37 | return; | |
38 | } | |
39 | theGlContext->arbVBO->glDeleteBuffersARB (1 , &myId); | |
161c4476 | 40 | } |