source: trunk/packages/vizservers/nanovis/RenderContext.h @ 2812

Last change on this file since 2812 was 2798, checked in by ldelgass, 12 years ago

Add emacs mode magic line in preparation for indentation cleanup

  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2#ifndef __RENDER_CONTEXT_H__
3#define __RENDER_CONTEXT_H__
4
5#include <GL/gl.h>
6
7namespace graphics {
8
9class RenderContext {
10public :
11    enum ShadingModel {
12        FLAT = GL_FLAT ,        //!< Flat Shading
13        SMOOTH = GL_SMOOTH      //!< Smooth shading (Goraud shading model)
14    };
15
16    enum PolygonMode {
17        LINE = GL_LINE,
18        FILL = GL_FILL
19    };
20
21    enum CullMode {
22        NO_CULL,                //!< No culling
23        BACK= GL_BACK,          //!< Back face culling
24        FRONT= GL_FRONT         //!< Front face culling
25    };
26
27private :
28    CullMode _cullMode;
29    PolygonMode _fillMode;
30    ShadingModel _shadingModel;
31   
32public :
33    /**
34     *@brief constructor
35     */
36    RenderContext();
37
38    /**
39     *@brief Destructor
40     */
41    ~RenderContext();
42
43public :
44    /**
45     *@brief Set the shading model such as flat, smooth
46     */
47    void setShadingModel(const ShadingModel shadeModel);
48    ShadingModel getShadingModel() const;
49
50    void setCullMode(const CullMode cullMode);
51    CullMode getCullMode() const;
52
53    void setPolygonMode(const PolygonMode fillMode);
54    PolygonMode getPolygonMode() const;
55
56};
57
58inline void RenderContext::setShadingModel(const RenderContext::ShadingModel shadeModel)
59{
60    _shadingModel = shadeModel;
61}
62
63inline RenderContext::ShadingModel RenderContext::getShadingModel() const
64{
65    return _shadingModel;
66}
67
68inline void RenderContext::setCullMode(const RenderContext::CullMode cullMode)
69{
70    _cullMode = cullMode;
71}
72
73inline RenderContext::CullMode RenderContext::getCullMode() const
74{
75    return _cullMode;
76}
77
78inline void RenderContext::setPolygonMode(const RenderContext::PolygonMode fillMode)
79{
80    _fillMode = fillMode;
81}
82
83inline RenderContext::PolygonMode RenderContext::getPolygonMode() const
84{
85    return _fillMode;
86}
87
88}
89
90#endif //
Note: See TracBrowser for help on using the repository browser.