a6eb515f |
1 | // Created on: 2013-09-26 |
2 | // Created by: Dmitry BOBYLEV |
d5f74e42 |
3 | // Copyright (c) 2013-2014 OPEN CASCADE SAS |
a6eb515f |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
a6eb515f |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
a6eb515f |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
a6eb515f |
15 | |
16 | #include <OpenGl_GlCore11.hxx> |
17 | #include <OpenGl_StencilTest.hxx> |
bc73b006 |
18 | #include <Standard_Dump.hxx> |
a6eb515f |
19 | |
20 | OpenGl_StencilTest::OpenGl_StencilTest() |
21 | { |
22 | // |
23 | } |
24 | |
25 | // ======================================================================= |
26 | // function : Render |
27 | // purpose : |
28 | // ======================================================================= |
29 | void OpenGl_StencilTest::Render (const Handle(OpenGl_Workspace)&) const |
30 | { |
31 | if (myIsEnabled) |
32 | { |
33 | glEnable (GL_STENCIL_TEST); |
34 | glStencilFunc (GL_NOTEQUAL, 1, 0xFF); |
35 | } |
36 | else |
37 | { |
38 | glDisable (GL_STENCIL_TEST); |
39 | } |
40 | } |
41 | |
42 | // ======================================================================= |
43 | // function : Release |
44 | // purpose : |
45 | // ======================================================================= |
10b9c7df |
46 | void OpenGl_StencilTest::Release (OpenGl_Context*) |
a6eb515f |
47 | { |
48 | // |
49 | } |
50 | |
51 | // ======================================================================= |
52 | // function : SetStencilTestState |
53 | // purpose : |
54 | // ======================================================================= |
55 | void OpenGl_StencilTest::SetOptions (const Standard_Boolean theIsEnabled) |
56 | { |
57 | myIsEnabled = theIsEnabled; |
58 | } |
59 | |
60 | // ======================================================================= |
61 | // function : ~OpenGl_StencilTest |
62 | // purpose : |
63 | // ======================================================================= |
64 | OpenGl_StencilTest::~OpenGl_StencilTest() |
65 | { |
66 | // |
973c2be1 |
67 | } |
bc73b006 |
68 | |
69 | // ======================================================================= |
70 | // function : DumpJson |
71 | // purpose : |
72 | // ======================================================================= |
73 | void OpenGl_StencilTest::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const |
74 | { |
75 | OCCT_DUMP_CLASS_BEGIN (theOStream, OpenGl_StencilTest) |
76 | |
77 | OCCT_DUMP_BASE_CLASS (theOStream, theDepth, OpenGl_Element) |
78 | OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsEnabled) |
79 | } |