Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8027 in orxonox.OLD


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

water: renderToTexture

Location:
branches/water/src/lib/graphics/importer
Files:
2 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)
  • branches/water/src/lib/graphics/importer/material.h

    r8025 r8027  
    5858    void setDiffuseMap(const std::string& dMap, GLenum target = GL_TEXTURE_2D, unsigned int textureNumber = 0);
    5959    void setSDLDiffuseMap(SDL_Surface *surface, GLenum target = GL_TEXTURE_2D, unsigned int textureNumber = 0);
     60    void renderToTexture(unsigned int textureNumber, GLenum target, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
    6061
    6162    void setAmbientMap(const std::string& aMap, GLenum target = GL_TEXTURE_2D);
Note: See TracChangeset for help on using the changeset viewer.