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 | |
21 | #ifdef _MSC_VER |
22 | #pragma comment (lib, "D3D9.lib") |
23 | #endif |
24 | |
25 | // ======================================================================= |
26 | // function : D3DHost_GraphicDriver |
27 | // purpose : |
28 | // ======================================================================= |
29 | D3DHost_GraphicDriver::D3DHost_GraphicDriver() |
30 | : OpenGl_GraphicDriver (Handle(Aspect_DisplayConnection)(), Standard_False) |
31 | { |
32 | // |
33 | } |
34 | |
35 | // ======================================================================= |
36 | // function : ~D3DHost_GraphicDriver |
37 | // purpose : |
38 | // ======================================================================= |
39 | D3DHost_GraphicDriver::~D3DHost_GraphicDriver() |
40 | { |
41 | // |
42 | } |
43 | |
44 | // ======================================================================= |
45 | // function : View |
46 | // purpose : |
47 | // ======================================================================= |
c357e426 |
48 | Handle(Graphic3d_CView) D3DHost_GraphicDriver::CreateView (const Handle(Graphic3d_StructureManager)& theMgr) |
62e1beed |
49 | { |
c357e426 |
50 | Handle(D3DHost_View) aView = new D3DHost_View (theMgr, this, myCaps, myDeviceLostFlag, &myStateCounter); |
62e1beed |
51 | |
62e1beed |
52 | myMapOfView.Add (aView); |
53 | |
c357e426 |
54 | for (TColStd_SequenceOfInteger::Iterator aLayerIt (myLayerSeq); aLayerIt.More(); aLayerIt.Next()) |
62e1beed |
55 | { |
c357e426 |
56 | const Graphic3d_ZLayerId aLayerID = aLayerIt.Value(); |
57 | const Graphic3d_ZLayerSettings& aSettings = myMapOfZLayerSettings.Find (aLayerID); |
58 | aView->AddZLayer (aLayerID); |
59 | aView->SetZLayerSettings (aLayerID, aSettings); |
62e1beed |
60 | } |
61 | |
c357e426 |
62 | return aView; |
62e1beed |
63 | } |