Added support for TextureCubeMap into osgUtil::RenderToTextureStage.

This commit is contained in:
Robert Osfield
2005-07-25 13:05:57 +00:00
parent ee8f7bb756
commit 3c23a42f17
7 changed files with 190 additions and 82 deletions

View File

@@ -17,7 +17,16 @@
#include <osg/Texture>
#ifndef GL_TEXTURE_CUBE_MAP
#define GL_TEXTURE_CUBE_MAP 0x8513
#define GL_TEXTURE_CUBE_MAP 0x8513
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
#endif
namespace osg {
@@ -110,6 +119,16 @@ class OSG_EXPORT TextureCubeMap : public Texture
/** Get the number of mip map levels the the texture has been created with. */
unsigned int getNumMipmapLevels() const { return _numMipmapLevels; }
/** Copies a two-dimensional texture subimage, as per
* glCopyTexSubImage2D. Updates a portion of an existing OpenGL
* texture object from the current OpenGL background framebuffer
* contents at position \a x, \a y with width \a width and height
* \a height. Loads framebuffer data into the texture using offsets
* \a xoffset and \a yoffset. \a width and \a height must be powers
* of two. */
void copyTexSubImageCubeMap(State& state, int face, int xoffset, int yoffset, int x, int y, int width, int height );
/** On first apply (unless already compiled), create the mipmapped
* texture and bind it. Subsequent apply will simple bind to texture.
*/