1 // Created on: 2015-06-10
2 // Created by: Kirill Gavrilov
3 // Copyright (c) 2015 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
18 #include <D3DHost_GraphicDriver.hxx>
19 #include <D3DHost_View.hxx>
21 IMPLEMENT_STANDARD_RTTIEXT(D3DHost_GraphicDriver,OpenGl_GraphicDriver)
24 #pragma comment (lib, "D3D9.lib")
27 // =======================================================================
28 // function : D3DHost_GraphicDriver
30 // =======================================================================
31 D3DHost_GraphicDriver::D3DHost_GraphicDriver()
32 : OpenGl_GraphicDriver (Handle(Aspect_DisplayConnection)(), Standard_True)
37 // =======================================================================
38 // function : ~D3DHost_GraphicDriver
40 // =======================================================================
41 D3DHost_GraphicDriver::~D3DHost_GraphicDriver()
46 // =======================================================================
49 // =======================================================================
50 Handle(Graphic3d_CView) D3DHost_GraphicDriver::CreateView (const Handle(Graphic3d_StructureManager)& theMgr)
52 Handle(D3DHost_View) aView = new D3DHost_View (theMgr, this, myCaps, &myStateCounter);
54 myMapOfView.Add (aView);
56 for (TColStd_SequenceOfInteger::Iterator aLayerIt (myLayerSeq); aLayerIt.More(); aLayerIt.Next())
58 const Graphic3d_ZLayerId aLayerID = aLayerIt.Value();
59 const Graphic3d_ZLayerSettings& aSettings = myMapOfZLayerSettings.Find (aLayerID);
60 aView->AddZLayer (aLayerID);
61 aView->SetZLayerSettings (aLayerID, aSettings);