594 |
jab |
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 |
* ----------------------------------------------------------------------- */
|
|
|
6 |
|
|
|
7 |
/**
|
|
|
8 |
* @file SinglePassWireframeRenderer.h
|
|
|
9 |
* @brief Render triangles in wire frame using efficient single pass method.
|
396 |
jab |
10 |
*/
|
594 |
jab |
11 |
|
396 |
jab |
12 |
#ifndef __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
|
|
|
13 |
#define __GLGRAPHICS_SINGLE_PASS_WIREFRAME__
|
|
|
14 |
|
|
|
15 |
#include <GL/glew.h>
|
|
|
16 |
#include <CGLA/Vec3f.h>
|
|
|
17 |
|
|
|
18 |
namespace GLGraphics
|
|
|
19 |
{
|
|
|
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. */
|
|
|
22 |
class SinglePassWireframeRenderer
|
|
|
23 |
{
|
|
|
24 |
GLhandleARB prog, old_prog;
|
|
|
25 |
public:
|
|
|
26 |
/// The constructor creates the wireframe shader program. It is static so the program is shared.
|
|
|
27 |
SinglePassWireframeRenderer();
|
|
|
28 |
|
|
|
29 |
/// Enable the wireframe shader with an optional line color
|
|
|
30 |
bool enable(const CGLA::Vec3f& line_color = CGLA::Vec3f(1,0,0));
|
|
|
31 |
|
|
|
32 |
/// Switch back to the shader program which was enabled at the time of calling enable.
|
|
|
33 |
void disable();
|
|
|
34 |
};
|
|
|
35 |
}
|
|
|
36 |
#endif
|