File: gl.h

package info (click to toggle)
qantenna 0.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,092 kB
  • sloc: cpp: 7,877; makefile: 4
file content (51 lines) | stat: -rw-r--r-- 2,271 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/***************************************************************************
 *   Copyright (C) 2006 by Pablo Odorico                                   *
 *   pablo.odorico@gmail.com                                               *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef GL_H
#define GL_H

#include <GL/gl.h>
#include <GL/glu.h>
#include <QString>

#include "vec3.h"

#ifndef CHECK_GL_ERROR
	#define CHECK_GL_ERROR() GL::checkError(__FILE__, __LINE__)
#endif

namespace GL {

	void vertex(const GLfloat &x, const GLfloat &y, const GLfloat &z);
	void vertex(const Vec3 &vec);

	void translate(const GLfloat &x, const GLfloat &y, const GLfloat &z);
	void rotate(const GLfloat &x, const GLfloat &y, const GLfloat &z);
	void scale(const GLfloat &x, const GLfloat &y, const GLfloat &z);

	void color(const GLfloat &r, const GLfloat &g, const GLfloat &b, const GLfloat &a=1);
	void color(const Vec3 &vec, const GLfloat &a=1);

	GLenum checkError(const QString &file, const int &line);

	void useVBO(bool enable);
};

#endif