Subversion Repositories gelsvn

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
 *  wireframe.h
 *  GEL
 *
 *  Created by J. Andreas Bærentzen on 05/08/08.
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
 *
 */
#ifndef __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
#define __GLGRAPHICS_SINGLE_PASS_WIREFRAME__

#include <GL/glew.h>
#include <CGLA/Vec3f.h>

namespace GLGraphics
{
        /** Class for wireframe rendering. Enable it will case all triangles to be drawn to be drawn as
                wireframe. Only triangles are supported, but it is fast. */
        class SinglePassWireframeRenderer
                {
                        GLhandleARB prog, old_prog;
                public:
                        /// The constructor creates the wireframe shader program. It is static so the program is shared.
                        SinglePassWireframeRenderer();
                        
                        /// Enable the wireframe shader with an optional line color
                        bool enable(const CGLA::Vec3f& line_color = CGLA::Vec3f(1,0,0));
                        
                        /// Switch back to the shader program which was enabled at the time of calling enable.
                        void disable();
                };
}
#endif

Generated by GNU Enscript 1.6.6.