Subversion Repositories gelsvn

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
396 jab 1
/*
2
 *  wireframe.h
3
 *  GEL
4
 *
5
 *  Created by J. Andreas Bærentzen on 05/08/08.
6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
7
 *
8
 */
9
#ifndef __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
10
#define __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
11
 
12
#include <GL/glew.h>
13
#include <CGLA/Vec3f.h>
14
 
15
namespace GLGraphics
16
{
17
	/** Class for wireframe rendering. Enable it will case all triangles to be drawn to be drawn as
18
		wireframe. Only triangles are supported, but it is fast. */
19
	class SinglePassWireframeRenderer
20
		{
21
			GLhandleARB prog, old_prog;
22
		public:
23
			/// The constructor creates the wireframe shader program. It is static so the program is shared.
24
			SinglePassWireframeRenderer();
25
 
26
			/// Enable the wireframe shader with an optional line color
27
			bool enable(const CGLA::Vec3f& line_color = CGLA::Vec3f(1,0,0));
28
 
29
			/// Switch back to the shader program which was enabled at the time of calling enable.
30
			void disable();
31
		};
32
}
33
#endif