Last change
on this file since 5722 was
3465,
checked in by ldelgass, 12 years ago
|
Rename R2 library to nv::graphics and nv::util.
|
-
Property svn:eol-style set to
native
|
File size:
1.4 KB
|
Line | |
---|
1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | /* |
---|
3 | * Copyright (c) 2004-2013 HUBzero Foundation, LLC |
---|
4 | */ |
---|
5 | #ifndef NV_GRAPHICS_RENDER_CONTEXT_H |
---|
6 | #define NV_GRAPHICS_RENDER_CONTEXT_H |
---|
7 | |
---|
8 | #include <GL/gl.h> |
---|
9 | |
---|
10 | namespace nv { |
---|
11 | namespace graphics { |
---|
12 | |
---|
13 | class RenderContext |
---|
14 | { |
---|
15 | public: |
---|
16 | enum ShadingModel { |
---|
17 | FLAT = GL_FLAT , //!< Flat Shading |
---|
18 | SMOOTH = GL_SMOOTH //!< Smooth shading (Gouraud shading model) |
---|
19 | }; |
---|
20 | |
---|
21 | enum PolygonMode { |
---|
22 | LINE = GL_LINE, |
---|
23 | FILL = GL_FILL |
---|
24 | }; |
---|
25 | |
---|
26 | enum CullMode { |
---|
27 | NO_CULL, //!< No culling |
---|
28 | BACK= GL_BACK, //!< Back face culling |
---|
29 | FRONT= GL_FRONT //!< Front face culling |
---|
30 | }; |
---|
31 | |
---|
32 | RenderContext(); |
---|
33 | |
---|
34 | ~RenderContext(); |
---|
35 | |
---|
36 | /** |
---|
37 | *@brief Set the shading model such as flat, smooth |
---|
38 | */ |
---|
39 | void setShadingModel(const ShadingModel shadeModel) |
---|
40 | { |
---|
41 | _shadingModel = shadeModel; |
---|
42 | } |
---|
43 | |
---|
44 | ShadingModel getShadingModel() const |
---|
45 | { |
---|
46 | return _shadingModel; |
---|
47 | } |
---|
48 | |
---|
49 | void setCullMode(const CullMode cullMode) |
---|
50 | { |
---|
51 | _cullMode = cullMode; |
---|
52 | } |
---|
53 | |
---|
54 | CullMode getCullMode() const |
---|
55 | { |
---|
56 | return _cullMode; |
---|
57 | } |
---|
58 | |
---|
59 | void setPolygonMode(const PolygonMode fillMode) |
---|
60 | { |
---|
61 | _fillMode = fillMode; |
---|
62 | } |
---|
63 | |
---|
64 | PolygonMode getPolygonMode() const |
---|
65 | { |
---|
66 | return _fillMode; |
---|
67 | } |
---|
68 | |
---|
69 | private : |
---|
70 | CullMode _cullMode; |
---|
71 | PolygonMode _fillMode; |
---|
72 | ShadingModel _shadingModel; |
---|
73 | }; |
---|
74 | |
---|
75 | } |
---|
76 | } |
---|
77 | |
---|
78 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.