00001 //////////////////////////////////////////////////////////////////////////////// 00002 // Scorched3D (c) 2000-2009 00003 // 00004 // This file is part of Scorched3D. 00005 // 00006 // Scorched3D is free software; you can redistribute it and/or modify 00007 // it under the terms of the GNU General Public License as published by 00008 // the Free Software Foundation; either version 2 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // Scorched3D is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with Scorched3D; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 //////////////////////////////////////////////////////////////////////////////// 00020 00021 #include <graph/GLSetup.h> 00022 #include <GLEXT/GLStateExtension.h> 00023 #include <console/Console.h> 00024 00025 void GLSetup::setup() 00026 { 00027 glPolygonMode(GL_FRONT, GL_FILL); 00028 00029 glDisable(GL_TEXTURE_2D); 00030 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 00031 00032 glDisable(GL_BLEND); 00033 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 00034 00035 glDisable(GL_DEPTH_TEST); 00036 glEnable(GL_CULL_FACE); 00037 glCullFace(GL_BACK); 00038 00039 GLfloat fogColor[4]= {0.8f, 0.8f, 0.8f, 1.0f}; 00040 00041 glFogi(GL_FOG_MODE, GL_EXP2); 00042 glFogfv(GL_FOG_COLOR, fogColor); 00043 glFogf(GL_FOG_DENSITY, 0.001f); 00044 //glHint(GL_FOG_HINT, GL_DONT_CARE); 00045 //glFogf(GL_FOG_START, 1.0f); 00046 //glFogf(GL_FOG_END, 2.0f); 00047 //glFogf(GL_FOG_DISTANCE_MODE_NV, GL_EYE_RADIAL_NV); 00048 00049 glAlphaFunc(GL_GREATER, 0.00f); 00050 00051 Console::instance(); // Make sure console is inited 00052 GLState::setBaseState(GLState::TEXTURE_ON | GLState::BLEND_OFF | GLState::DEPTH_ON); 00053 GLStateExtension::setup(); 00054 }
1.5.3