- Timestamp:
- Jan 18, 2006, 2:54:04 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/graphics_engine.cc
r6522 r6523 474 474 void GraphicsEngine::wireframe() 475 475 { 476 glPolygonMode(GL_FRONT _AND_BACK, GL_LINE);476 glPolygonMode(GL_FRONT, GL_LINE); 477 477 } 478 478 -
trunk/src/lib/graphics/importer/texture.cc
r6465 r6523 276 276 0, 277 277 GL_RGBA, 278 surface->w, surface->h, 278 surface->w, 279 surface->h, 279 280 0, 280 281 GL_RGBA, … … 294 295 PRINTF(1)("Error while loading texture (mipmap generation), gluBuild2DMipmaps returned %i\n", errorCode); 295 296 296 glBindTexture(target, 0); 297 if (target == GL_TEXTURE_2D) 298 glBindTexture(target, 0); 297 299 return texture; 298 300 } -
trunk/src/world_entities/environments/water.cc
r6522 r6523 120 120 void Water::draw() const 121 121 { 122 SkyBox::enableCubeMap(); 123 124 // this->waterShader->activateShader(); 122 //SkyBox::enableCubeMap(); 123 124 glBindTexture(GL_TEXTURE_2D, 15); 125 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 126 127 glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); 128 glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); 129 glEnable(GL_TEXTURE_GEN_S); 130 glEnable(GL_TEXTURE_GEN_T); 131 132 glEnable(GL_BLEND); 133 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 134 // this->waterShader->activateShader(); 125 135 // this->waterMaterial->select(); 126 136 WorldEntity::draw(); -
trunk/src/world_entities/skybox.cc
r6519 r6523 102 102 this->setModel(NULL); //< so that WorldEntity does not try to delete it again. 103 103 for (int i = 0; i < 6; i++) 104 { 104 105 delete this->material[i]; 106 delete this->cubeTexture[i]; 107 } 105 108 } 106 109 … … 159 162 this->material[4]->setDiffuseMap(front); 160 163 this->material[5]->setDiffuseMap(back); 161 this->loadCubeMapTextures(top, bottom, left, right, front, back);162 //this->enableCubeMap();164 if (GLEW_EXT_texture_cube_map) 165 this->loadCubeMapTextures(top, bottom, left, right, front, back); 163 166 } 164 167 … … 166 169 const char* right, const char* front, const char* back) 167 170 { 168 this->cubeTexture[0] = new Texture (top, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ ARB);169 this->cubeTexture[1] = new Texture (bottom, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ ARB);170 this->cubeTexture[2] = new Texture (left, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ ARB);171 this->cubeTexture[3] = new Texture (right, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ ARB);172 this->cubeTexture[4] = new Texture (front, GL_TEXTURE_CUBE_MAP_POSITIVE_X_ ARB);173 this->cubeTexture[5] = new Texture (back, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ ARB);171 this->cubeTexture[0] = new Texture (top, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT); 172 this->cubeTexture[1] = new Texture (bottom, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT); 173 this->cubeTexture[2] = new Texture (left, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT); 174 this->cubeTexture[3] = new Texture (right, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT); 175 this->cubeTexture[4] = new Texture (front, GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT); 176 this->cubeTexture[5] = new Texture (back, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT); 174 177 } 175 178 176 179 void SkyBox::enableCubeMap() 177 180 { 178 glEnable(GL_TEXTURE_CUBE_MAP_ARB);179 181 glEnable(GL_TEXTURE_2D); 180 glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB); 181 glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB); 182 glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_ARB); 182 glEnable(GL_TEXTURE_CUBE_MAP_EXT); 183 glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT); 184 glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT); 185 glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_EXT); 183 186 glEnable(GL_TEXTURE_GEN_S); 184 187 glEnable(GL_TEXTURE_GEN_T); 185 188 glEnable(GL_TEXTURE_GEN_R); 189 186 190 } 187 191 188 192 void SkyBox::disableCubeMap() 189 193 { 190 glDisable(GL_TEXTURE_CUBE_MAP_ ARB);194 glDisable(GL_TEXTURE_CUBE_MAP_EXT); 191 195 glDisable(GL_TEXTURE_2D); 196 glDisable(GL_TEXTURE_GEN_S); 197 glDisable(GL_TEXTURE_GEN_T); 198 glDisable(GL_TEXTURE_GEN_R); 199 192 200 glDisable(GL_TEXTURE_GEN_S); 193 201 glDisable(GL_TEXTURE_GEN_T);
Note: See TracChangeset
for help on using the changeset viewer.