]> git.tdb.fi Git - libs/gl.git/blob - source/texenv.cpp
Style update: add spaces around assignment operators
[libs/gl.git] / source / texenv.cpp
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2008  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #include "texenv.h"
9 #include "texunit.h"
10
11 namespace Msp {
12 namespace GL {
13
14 TexEnv::TexEnv():
15         mode(MODULATE)
16 { }
17
18 void TexEnv::set_mode(TexEnvMode m)
19 {
20         mode = m;
21 }
22
23 void TexEnv::set_color(const Color &c)
24 {
25         color = c;
26 }
27
28 void TexEnv::bind()
29 {
30         if(TexUnit::current().set_texenv(this))
31         {
32                 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, mode);
33                 glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &color.r);
34         }
35 }
36
37 void TexEnv::unbind()
38 {
39         TexUnit::current().set_texenv(0);
40 }
41
42 } // namespace GL
43 } // namespace Msp