c9d86da88576c4fe1498962856d5911cdd0be4ff
[occt.git] / src / OpenGl / OpenGl_GraphicDriver_713.cxx
1 // Created on: 2011-10-20
2 // Created by: Sergey ZERCHANINOV
3 // Copyright (c) 2011-2014 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 <OpenGl_GraphicDriver.hxx>
17
18 #include <OpenGl_Group.hxx>
19 #include <OpenGl_PrimitiveArray.hxx>
20
21 #include <OpenGl_CView.hxx>
22
23 void OpenGl_GraphicDriver::ReadDepths( const Graphic3d_CView& ACView,
24                                       const Standard_Integer x,
25                                       const Standard_Integer y,
26                                       const Standard_Integer width,
27                                       const Standard_Integer height,
28                                       const Standard_Address buffer ) const
29 {
30   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
31   if (aCView)
32     aCView->WS->ReadDepths(x, y, width, height, (float*) buffer);
33 }
34
35 void OpenGl_GraphicDriver::SetGLLightEnabled( const Graphic3d_CView& ACView, const Standard_Boolean isEnabled ) const
36 {
37   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
38   if (aCView)
39     aCView->WS->UseGLLight() = isEnabled;
40 }
41
42 Standard_Boolean OpenGl_GraphicDriver::IsGLLightEnabled( const Graphic3d_CView& ACView ) const
43 {
44   const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView;
45   if (aCView)
46     return aCView->WS->UseGLLight();
47   return Standard_False;
48 }