Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 31, 2006, 2:31:12 PM (19 years ago)
Author:
stefalie
Message:

water: renderToTexture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/water/src/lib/graphics/importer/material.cc

    r7982 r8027  
    386386}
    387387
     388/**
     389 * @brief renders viewport buffer (?? or another buffer ;-)) to a texture
     390 * @param textureNumber select the texture unit that will be overwritten
     391*/
     392void Material::renderToTexture(unsigned int textureNumber, GLenum target, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
     393{
     394  glActiveTexture(Material::glTextureArbs[textureNumber]);
     395  glEnable(GL_TEXTURE_2D);
     396  glBindTexture(GL_TEXTURE_2D, this->textures[textureNumber].getTexture());
     397  glCopyTexSubImage2D(target, 0, xoffset, yoffset, 0, 0, width, height);
     398}
    388399
    389400/**
    390401 * @brief Sets the Materials Ambient Map
    391  * @param aMap the Name of the Image to Use
    392    @todo implement this
     402 * @todo implement this
    393403*/
    394404void Material::setAmbientMap(const std::string& aMap, GLenum target)
Note: See TracChangeset for help on using the changeset viewer.