0024001: Stereographic rendering support
[occt.git] / src / OpenGl / OpenGl_GraphicDriver_2.cxx
CommitLineData
b311480e 1// Created on: 2011-10-20
2// Created by: Sergey ZERCHANINOV
973c2be1 3// Copyright (c) 2011-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
973c2be1 7// This library is free software; you can redistribute it and / or modify it
8// under the terms of the GNU Lesser General Public 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
5f8b738e 16#include <OpenGl_GlCore11.hxx>
17
2166f0fa 18#include <OpenGl_GraphicDriver.hxx>
7fd59977 19
2166f0fa
SK
20#include <OpenGl_Display.hxx>
21#include <OpenGl_CView.hxx>
7fd59977 22
2166f0fa
SK
23Standard_Integer OpenGl_GraphicDriver::InquireLightLimit ()
24{
fd4a6963 25 return (myGlDisplay.IsNull() ? 0 : myGlDisplay->Facilities().MaxLights);
7fd59977 26}
27
2166f0fa
SK
28Standard_Integer OpenGl_GraphicDriver::InquireViewLimit ()
29{
fd4a6963 30 return (myGlDisplay.IsNull() ? 0 : myGlDisplay->Facilities().MaxViews);
7fd59977 31}
32
2166f0fa
SK
33Standard_Integer OpenGl_GraphicDriver::InquirePlaneLimit ()
34{
5f8b738e 35 GLint aMaxPlanes = 0;
36 if (GET_GL_CONTEXT())
37 {
38 glGetIntegerv (GL_MAX_CLIP_PLANES, &aMaxPlanes);
39 aMaxPlanes -= 2; // NOTE the 2 first planes are reserved for ZClipping
40 if (aMaxPlanes < 0)
41 aMaxPlanes = 0;
42 }
43 return aMaxPlanes;
7fd59977 44}
2166f0fa 45