Subversion Repositories gelsvn

Rev

Rev 396 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 396 Rev 594
-
 
1
/* ----------------------------------------------------------------------- *
-
 
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
-
 
3
 * Copyright (C) the authors and DTU Informatics
-
 
4
 * For license and list of authors, see ../../doc/intro.pdf
-
 
5
 * ----------------------------------------------------------------------- */
1
/*
6
 
2
 *  wireframe.h
-
 
3
 *  GEL
-
 
4
 *
7
/**
5
 *  Created by J. Andreas Bærentzen on 05/08/08.
8
 * @file SinglePassWireframeRenderer.h
6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
9
 * @brief Render triangles in wire frame using efficient single pass method.
7
 *
-
 
8
 */
10
 */
-
 
11
 
9
#ifndef __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
12
#ifndef __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
10
#define __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
13
#define __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
11
 
14
 
12
#include <GL/glew.h>
15
#include <GL/glew.h>
13
#include <CGLA/Vec3f.h>
16
#include <CGLA/Vec3f.h>
14
 
17
 
15
namespace GLGraphics
18
namespace GLGraphics
16
{
19
{
17
	/** 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
18
		wireframe. Only triangles are supported, but it is fast. */
21
		wireframe. Only triangles are supported, but it is fast. */
19
	class SinglePassWireframeRenderer
22
	class SinglePassWireframeRenderer
20
		{
23
		{
21
			GLhandleARB prog, old_prog;
24
			GLhandleARB prog, old_prog;
22
		public:
25
		public:
23
			/// 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.
24
			SinglePassWireframeRenderer();
27
			SinglePassWireframeRenderer();
25
			
28
			
26
			/// Enable the wireframe shader with an optional line color
29
			/// Enable the wireframe shader with an optional line color
27
			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));
28
			
31
			
29
			/// 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.
30
			void disable();
33
			void disable();
31
		};
34
		};
32
}
35
}
33
#endif
36
#endif
34
 
37
 
35

Generated by GNU Enscript 1.6.6.
38

Generated by GNU Enscript 1.6.6.
36
 
39
 
37
 
40
 
38
 
41