TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
grmultitexstate.cpp
Go to the documentation of this file.
1/***************************************************************************
2
3 file : grmultitexstate.cpp
4 created : Fri Mar 22 23:16:44 CET 2002
5 copyright : (C) 2001 by Christophe Guionneau
6 version : $Id$
7
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19#include <plib/ssg.h>
20#include "grmultitexstate.h"
21
22#ifdef DMALLOC
23#include "dmalloc.h"
24#endif
25#include "grmain.h"
26
28{
29 if (unit==0) {
30 glActiveTextureARB ( GL_TEXTURE0_ARB ) ;
31 glEnable ( GL_TEXTURE_2D ) ; /* Enables the second texture map. */
32 glBindTexture ( GL_TEXTURE_2D, ssgSimpleState::getTextureHandle() ) ;
33 } else if (unit==1) {
34 glActiveTextureARB ( GL_TEXTURE1_ARB ) ;
35 glEnable ( GL_TEXTURE_2D ) ; /* Enables the second texture map. */
36 /* glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);*/
37 /*glBlendFunc(GL_ZERO, GL_SRC_COLOR);*/
38 glBindTexture ( GL_TEXTURE_2D, ssgSimpleState::getTextureHandle() ) ;
39 } else if (unit==2) {
40 glActiveTextureARB ( GL_TEXTURE2_ARB ) ;
41 glEnable ( GL_TEXTURE_2D ) ; /* Enables the second texture map. */
42 glBindTexture ( GL_TEXTURE_2D, ssgSimpleState::getTextureHandle() ) ;
43 } else if (unit==3) {
44 glActiveTextureARB ( GL_TEXTURE3_ARB ) ;
45 glEnable ( GL_TEXTURE_2D ) ; /* Enables the second texture map. */
46 glBindTexture ( GL_TEXTURE_2D, ssgSimpleState::getTextureHandle() ) ;
47 } else {
48 /*glActiveTextureARB ( GL_TEXTURE0_ARB ) ;*/
49 glBindTexture ( GL_TEXTURE_2D, getTextureHandle() ) ;
50 _ssgCurrentContext->getState()->setTexture ( getTexture () ) ;
51 }
52}
virtual void apply(int unit)