0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- automatic
[occt.git] / src / D3DHost / D3DHost_GraphicDriver.cxx
1 // Created on: 2015-06-10
2 // Created by: Kirill Gavrilov
3 // Copyright (c) 2015 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #include <d3d9.h>
17
18 #include <D3DHost_GraphicDriver.hxx>
19 #include <D3DHost_View.hxx>
20
21 IMPLEMENT_STANDARD_RTTIEXT(D3DHost_GraphicDriver,OpenGl_GraphicDriver)
22
23 #ifdef _MSC_VER
24   #pragma comment (lib, "D3D9.lib")
25 #endif
26
27 // =======================================================================
28 // function : D3DHost_GraphicDriver
29 // purpose  :
30 // =======================================================================
31 D3DHost_GraphicDriver::D3DHost_GraphicDriver()
32 : OpenGl_GraphicDriver (Handle(Aspect_DisplayConnection)(), Standard_False)
33 {
34   //
35 }
36
37 // =======================================================================
38 // function : ~D3DHost_GraphicDriver
39 // purpose  :
40 // =======================================================================
41 D3DHost_GraphicDriver::~D3DHost_GraphicDriver()
42 {
43   //
44 }
45
46 // =======================================================================
47 // function : View
48 // purpose  :
49 // =======================================================================
50 Handle(Graphic3d_CView) D3DHost_GraphicDriver::CreateView (const Handle(Graphic3d_StructureManager)& theMgr)
51 {
52   Handle(D3DHost_View) aView = new D3DHost_View (theMgr, this, myCaps, myDeviceLostFlag, &myStateCounter);
53
54   myMapOfView.Add (aView);
55
56   for (TColStd_SequenceOfInteger::Iterator aLayerIt (myLayerSeq); aLayerIt.More(); aLayerIt.Next())
57   {
58     const Graphic3d_ZLayerId        aLayerID  = aLayerIt.Value();
59     const Graphic3d_ZLayerSettings& aSettings = myMapOfZLayerSettings.Find (aLayerID);
60     aView->AddZLayer         (aLayerID);
61     aView->SetZLayerSettings (aLayerID, aSettings);
62   }
63
64   return aView;
65 }