0023226: Extend OpenGl_Context to store map of shared GPU resources
authorkgv <kgv@opencascade.com>
Fri, 13 Jul 2012 11:51:16 +0000 (15:51 +0400)
committerkgv <kgv@opencascade.com>
Fri, 13 Jul 2012 11:51:16 +0000 (15:51 +0400)
commit5e27df788d564fdcae7d51d0a98e32779c5da2d6
tree29f3babeb6eec4a85df7036f50e6a459766ebe99
parent400933675fbca9cd5e5913f6b073b570940ddb58
0023226: Extend OpenGl_Context to store map of shared GPU resources

OpenGl_Resource was slightly corrected and OpenGl_Element was extended
with Release method to manage GPU resources.

OpenGl_PrimitiveArray now uses new OpenGl_VertexBuffer class (requires OpenGL 1.5+).
Strange workarounds for feedback mode were removed.

OpenGl_Context now provides access to shared GPU resources
and manages resources queue for delayed release
(replaces functionality of removed OpenGl_ResourceCleaner).
Loaded GL_ARB_texture_buffer_object and GL_ARB_draw_instanced extensions.

Global maps of views, workspaces and structures
were moved to OpenGl_GraphicDriver members.
UserDrawCallback() function moved to OpenGl_GraphicDriver methods.

Aspect_GraphicCallbackStruct now holds handle of OpenGl_Context
instead of system-dependent pointers to GL context definition.

New classes NCollection_Vec2, NCollection_Vec3 and NCollection_Vec4
implements interface to low-level data (points, vertices, colors) in GLSL-style.
Removed EnableVBO argument from vdrawparray Draw Harness command
Corrected compilation errors
Fixed wrong argument in Index VBO initialization
Fixed several cases of incorrect memory management in TKV3d

Visual3d_ViewManager::Remove()
Destroy structures before last view removed for correct GPU resources management.

Graphic3d_Structure::GraphicClear()
Remove groups to avoid usage of dead OpenGl_Group pointers.

V3d_View::Remove()
Fixed mistake in #0000280 patch.
Small correction
Fixed OCC280 test command

Replace removed view within created one in ViewerTest EventManager.
ViewerTest, do not create unused 3D view

In current design NIS_View always created and used for both - NIS objects and AIS objects.
77 files changed:
src/Aspect/Aspect_GraphicCallbackProc.hxx
src/Graphic3d/Graphic3d_ArrayOfPrimitives.cxx
src/Graphic3d/Graphic3d_Structure.cxx
src/InterfaceGraphic/InterfaceGraphic_PrimitiveArray.hxx
src/NCollection/FILES
src/NCollection/NCollection_Vec2.hxx [new file with mode: 0644]
src/NCollection/NCollection_Vec3.hxx [new file with mode: 0644]
src/NCollection/NCollection_Vec4.hxx [new file with mode: 0644]
src/OpenGl/FILES
src/OpenGl/OpenGl_ArbIns.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_ArbTBO.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_AspectFace.cxx
src/OpenGl/OpenGl_AspectFace.hxx
src/OpenGl/OpenGl_AspectLine.cxx
src/OpenGl/OpenGl_AspectLine.hxx
src/OpenGl/OpenGl_AspectMarker.cxx
src/OpenGl/OpenGl_AspectMarker.hxx
src/OpenGl/OpenGl_AspectText.cxx
src/OpenGl/OpenGl_AspectText.hxx
src/OpenGl/OpenGl_Callback.hxx [deleted file]
src/OpenGl/OpenGl_Context.cxx
src/OpenGl/OpenGl_Context.hxx
src/OpenGl/OpenGl_Element.hxx
src/OpenGl/OpenGl_GraphicDriver.cxx
src/OpenGl/OpenGl_GraphicDriver.hxx
src/OpenGl/OpenGl_GraphicDriver_3.cxx
src/OpenGl/OpenGl_GraphicDriver_4.cxx
src/OpenGl/OpenGl_GraphicDriver_7.cxx
src/OpenGl/OpenGl_GraphicDriver_713.cxx
src/OpenGl/OpenGl_GraphicDriver_9.cxx
src/OpenGl/OpenGl_Group.cxx
src/OpenGl/OpenGl_Group.hxx
src/OpenGl/OpenGl_IndexBuffer.cxx [new file with mode: 0644]
src/OpenGl/OpenGl_IndexBuffer.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_Marker.cxx
src/OpenGl/OpenGl_Marker.hxx
src/OpenGl/OpenGl_MarkerSet.cxx
src/OpenGl/OpenGl_MarkerSet.hxx
src/OpenGl/OpenGl_Polygon.cxx
src/OpenGl/OpenGl_Polygon.hxx
src/OpenGl/OpenGl_Polyline.cxx
src/OpenGl/OpenGl_Polyline.hxx
src/OpenGl/OpenGl_PrimitiveArray.cxx
src/OpenGl/OpenGl_PrimitiveArray.hxx
src/OpenGl/OpenGl_Resource.cxx
src/OpenGl/OpenGl_Resource.hxx
src/OpenGl/OpenGl_ResourceCleaner.cxx [deleted file]
src/OpenGl/OpenGl_ResourceCleaner.hxx [deleted file]
src/OpenGl/OpenGl_ResourceTexture.cxx
src/OpenGl/OpenGl_ResourceTexture.hxx
src/OpenGl/OpenGl_ResourceVBO.cxx [deleted file]
src/OpenGl/OpenGl_ResourceVBO.hxx [deleted file]
src/OpenGl/OpenGl_Structure.cxx
src/OpenGl/OpenGl_Structure.hxx
src/OpenGl/OpenGl_Text.cxx
src/OpenGl/OpenGl_Text.hxx
src/OpenGl/OpenGl_TextureBox.cxx
src/OpenGl/OpenGl_TextureBox.hxx
src/OpenGl/OpenGl_TextureBufferArb.cxx [new file with mode: 0644]
src/OpenGl/OpenGl_TextureBufferArb.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_VertexBuffer.cxx [new file with mode: 0644]
src/OpenGl/OpenGl_VertexBuffer.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_VertexBufferEditor.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_Window.cxx
src/OpenGl/OpenGl_Window.hxx
src/OpenGl/OpenGl_Workspace.cxx
src/OpenGl/OpenGl_Workspace.hxx
src/OpenGl/OpenGl_Workspace_2.cxx
src/OpenGl/OpenGl_Workspace_4.cxx
src/QABugs/QABugs_17.cxx
src/V3d/V3d_View.cxx
src/ViewerTest/ViewerTest_ObjectCommands.cxx
src/ViewerTest/ViewerTest_OpenGlCommands.cxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx
src/Visual3d/Visual3d_ViewManager.cxx
src/VoxelClient/VoxelClient_VisDrawer.cxx
src/VoxelClient/VoxelClient_VisDrawer.h