Subversion Repositories gelsvn

Rev

Rev 601 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 601 Rev 630
1
/* ----------------------------------------------------------------------- *
1
/* ----------------------------------------------------------------------- *
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
3
 * Copyright (C) the authors and DTU Informatics
3
 * Copyright (C) the authors and DTU Informatics
4
 * For license and list of authors, see ../../doc/intro.pdf
4
 * For license and list of authors, see ../../doc/intro.pdf
5
 * ----------------------------------------------------------------------- */
5
 * ----------------------------------------------------------------------- */
6
 
6
 
7
/**
7
/**
8
 * @file SinglePassWireframeRenderer.h
8
 * @file SinglePassWireframeRenderer.h
9
 * @brief Render triangles in wire frame using efficient single pass method.
9
 * @brief Render triangles in wire frame using efficient single pass method.
10
 */
10
 */
11
 
11
 
12
#ifndef __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
12
#ifndef __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
13
#define __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
13
#define __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
14
 
14
 
15
#include "../GL/glew.h"
15
#include "../GL/glew.h"
16
#include "../CGLA/Vec3f.h"
16
#include "../CGLA/Vec3f.h"
17
 
17
 
18
namespace GLGraphics
18
namespace GLGraphics
19
{
19
{
20
	/** Class for wireframe rendering. Enable it will case all triangles to be drawn to be drawn as
20
	/** Class for wireframe rendering. Enable it will case all triangles to be drawn to be drawn as
21
		wireframe. Only triangles are supported, but it is fast. */
21
		wireframe. Only triangles are supported, but it is fast. */
22
	class SinglePassWireframeRenderer
22
	class SinglePassWireframeRenderer
23
		{
23
		{
24
			GLhandleARB prog, old_prog;
24
			GLhandleARB prog, old_prog;
25
		public:
25
		public:
26
			/// The constructor creates the wireframe shader program. It is static so the program is shared.
26
			/// The constructor creates the wireframe shader program. It is static so the program is shared.
27
			SinglePassWireframeRenderer();
27
			SinglePassWireframeRenderer();
28
			
28
			
29
			/// Enable the wireframe shader with an optional line color
29
			/// Enable the wireframe shader with an optional line color
30
			bool enable(const CGLA::Vec3f& line_color = CGLA::Vec3f(1,0,0));
30
			bool enable(const CGLA::Vec3f& line_color = CGLA::Vec3f(1,0,0));
31
			
31
			
32
			/// Switch back to the shader program which was enabled at the time of calling enable.
32
			/// Switch back to the shader program which was enabled at the time of calling enable.
33
			void disable();
33
			void disable();
34
		};
34
		};
35
}
35
}
36
#endif
36
#endif
37
 
37
 
38

Generated by GNU Enscript 1.6.6.
38

Generated by GNU Enscript 1.6.6.
39
 
39
 
40
 
40
 
41
 
41