SuperTuxKart
Loading...
Searching...
No Matches
shaders.hpp
1// SuperTuxKart - a fun racing game with go-kart
2// Copyright (C) 2014-2015 SuperTuxKart-Team
3//
4// This program is free software; you can redistribute it and/or
5// modify it under the terms of the GNU General Public License
6// as published by the Free Software Foundation; either version 3
7// of the License, or (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program; if not, write to the Free Software
16// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18#ifndef SERVER_ONLY
19
20#ifndef HEADER_SHADERS_HPP
21#define HEADER_SHADERS_HPP
22
23#include "graphics/shader.hpp"
24
25#include <SColor.h>
26
27namespace Shaders
28{
29// ========================================================================
32class ColoredLine : public Shader<ColoredLine, irr::video::SColor>
33{
34private:
35 GLuint m_vao, m_vbo;
36public:
38 // --------------------------------------------------------------------
40 // --------------------------------------------------------------------
43 {
44 glBindVertexArray(m_vao);
45 glVertexAttrib4f(8, 0.0f, 0.0f, 0.0f, 0.0f);
46 glVertexAttrib4f(9, 0.0f, 0.0f, 0.0f, 0.0f);
47 glVertexAttrib4f(10, 1.0f, 1.0f, 1.0f, 1.0f);
48 } // bindVertexArray
49 // --------------------------------------------------------------------
52 {
53 glBindBuffer(GL_ARRAY_BUFFER, m_vbo);
54 } // bindBuffer
55}; // class ColoredLine
56
57}; // class Shaders
58
59#endif
60
61#endif // SHADER_ONLY
The main templated base class for all shaders that do not use textures.
Definition: shader.hpp:119
Shader to draw a colored line.
Definition: shaders.hpp:33
void bindVertexArray()
Bind the vertex array of this shader.
Definition: shaders.hpp:42
void bindBuffer()
Binds the vbo of this shader.
Definition: shaders.hpp:51