Commit | Line | Data |
---|---|---|
2166f0fa SK |
1 | // File: OpenGl_GraphicDriver_2.cxx |
2 | // Created: 20 October 2011 | |
3 | // Author: Sergey ZERCHANINOV | |
4 | // Copyright: OPEN CASCADE 2011 | |
7fd59977 | 5 | |
5f8b738e | 6 | #include <OpenGl_GlCore11.hxx> |
7 | ||
2166f0fa | 8 | #include <OpenGl_GraphicDriver.hxx> |
7fd59977 | 9 | |
2166f0fa SK |
10 | #include <OpenGl_Display.hxx> |
11 | #include <OpenGl_CView.hxx> | |
7fd59977 | 12 | |
2166f0fa SK |
13 | Standard_Integer OpenGl_GraphicDriver::InquireLightLimit () |
14 | { | |
15 | return (openglDisplay.IsNull()? 0 : openglDisplay->Facilities().MaxLights); | |
7fd59977 | 16 | } |
17 | ||
2166f0fa SK |
18 | void OpenGl_GraphicDriver::InquireMat (const Graphic3d_CView& ACView, TColStd_Array2OfReal& AMatO, TColStd_Array2OfReal& AMatM) |
19 | { | |
20 | const OpenGl_CView *aCView = (const OpenGl_CView *)ACView.ptrView; | |
21 | if (aCView) | |
22 | aCView->View->GetMatrices(AMatO,AMatM,ACView.Orientation.IsCustomMatrix); | |
7fd59977 | 23 | } |
24 | ||
2166f0fa SK |
25 | Standard_Integer OpenGl_GraphicDriver::InquireViewLimit () |
26 | { | |
27 | return (openglDisplay.IsNull()? 0 : openglDisplay->Facilities().MaxViews); | |
7fd59977 | 28 | } |
29 | ||
2166f0fa SK |
30 | Standard_Boolean OpenGl_GraphicDriver::InquireTextureAvailable () |
31 | { | |
32 | return Standard_True; | |
7fd59977 | 33 | } |
34 | ||
2166f0fa SK |
35 | Standard_Integer OpenGl_GraphicDriver::InquirePlaneLimit () |
36 | { | |
5f8b738e | 37 | GLint aMaxPlanes = 0; |
38 | if (GET_GL_CONTEXT()) | |
39 | { | |
40 | glGetIntegerv (GL_MAX_CLIP_PLANES, &aMaxPlanes); | |
41 | aMaxPlanes -= 2; // NOTE the 2 first planes are reserved for ZClipping | |
42 | if (aMaxPlanes < 0) | |
43 | aMaxPlanes = 0; | |
44 | } | |
45 | return aMaxPlanes; | |
7fd59977 | 46 | } |
2166f0fa | 47 |