Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6467 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Jan 11, 2006, 11:46:52 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Texture loading with GL_TEXTURE_* in ResourceManager and Material

Location:
trunk/src/world_entities/environments
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/environments/water.cc

    r6458 r6467  
    2323#include "material.h"
    2424
     25#include "resource_manager.h"
     26#include "shader.h"
     27
     28
    2529using namespace std;
    2630
     
    4347  this->rebuildGrid();
    4448  this->waterMaterial = new Material();
     49  this->waterShader = (Shader*)ResourceManager::getInstance()->load("shaders/water.vert", SHADER, RP_GAME, (void*)"shaders/water.frag");
     50
    4551}
    4652
     
    97103void Water::draw() const
    98104{
    99   this->waterMaterial->select();
     105  this->waterShader->activateShader();
     106//  this->waterMaterial->select();
    100107  WorldEntity::draw();
     108  Shader::deactivateShader();
    101109}
    102110
     
    109117    {
    110118      this->grid->height(i,j) = this->height*sin(((float)i/(float)this->grid->rows() *phase)+
    111           this->height*cos((float)j/(float)this->grid->columns()) * phase);
     119          this->height*cos((float)j/(float)this->grid->columns()) * phase * 2.0);
    112120    }
    113121  }
  • trunk/src/world_entities/environments/water.h

    r6458 r6467  
    1616class Material;
    1717class Grid;
     18class Shader;
    1819
    1920//! A Class to handle a WaterEffects
     
    3738    Grid*           grid;            //!< The water-surface-model to render with
    3839    Material*       waterMaterial;
     40    Shader*         waterShader;
    3941    float           height;          //!< The hight of the Water
    4042
Note: See TracChangeset for help on using the changeset viewer.