62e1beed |
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> |
c357e426 |
19 | #include <D3DHost_View.hxx> |
62e1beed |
20 | |
92efcf78 |
21 | IMPLEMENT_STANDARD_RTTIEXT(D3DHost_GraphicDriver,OpenGl_GraphicDriver) |
22 | |
62e1beed |
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() |
6cde53c4 |
32 | : OpenGl_GraphicDriver (Handle(Aspect_DisplayConnection)(), Standard_True) |
62e1beed |
33 | { |
34 | // |
35 | } |
36 | |
37 | // ======================================================================= |
38 | // function : ~D3DHost_GraphicDriver |
39 | // purpose : |
40 | // ======================================================================= |
41 | D3DHost_GraphicDriver::~D3DHost_GraphicDriver() |
42 | { |
43 | // |
44 | } |
45 | |
46 | // ======================================================================= |
1c728f2d |
47 | // function : CreateView |
62e1beed |
48 | // purpose : |
49 | // ======================================================================= |
c357e426 |
50 | Handle(Graphic3d_CView) D3DHost_GraphicDriver::CreateView (const Handle(Graphic3d_StructureManager)& theMgr) |
62e1beed |
51 | { |
851dacdb |
52 | Handle(D3DHost_View) aView = new D3DHost_View (theMgr, this, myCaps, &myStateCounter); |
62e1beed |
53 | myMapOfView.Add (aView); |
1c728f2d |
54 | for (NCollection_List<Handle(Graphic3d_Layer)>::Iterator aLayerIter (myLayers); aLayerIter.More(); aLayerIter.Next()) |
62e1beed |
55 | { |
1c728f2d |
56 | const Handle(Graphic3d_Layer)& aLayer = aLayerIter.Value(); |
57 | aView->InsertLayerAfter (aLayer->LayerId(), aLayer->LayerSettings(), Graphic3d_ZLayerId_UNKNOWN); |
62e1beed |
58 | } |
c357e426 |
59 | return aView; |
62e1beed |
60 | } |