14#ifndef OSG_TEXTURERECTANGLE
15#define OSG_TEXTURERECTANGLE 1
19#ifndef GL_TEXTURE_RECTANGLE_NV
20#define GL_TEXTURE_RECTANGLE_NV 0x84F5
23#ifndef GL_TEXTURE_RECTANGLE
24#define GL_TEXTURE_RECTANGLE GL_TEXTURE_RECTANGLE_NV
#define GL_TEXTURE_RECTANGLE
Definition GLDefines:406
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Implements a simple buffered value for values that need to be buffered on a per graphics context basi...
Definition buffered_value:27
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Image class for encapsulating the storage texture image data.
Definition Image:179
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
T * get() const
Definition ref_ptr:117
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Base class for state attributes.
Definition StateAttribute:77
@ TEXTURE
Definition StateAttribute:125
void setFilter(FilterParameter which, FilterMode filter)
Sets the texture filter mode.
@ LINEAR
Definition Texture:500
@ CLAMP
Definition Texture:468
@ WRAP_S
Definition Texture:462
@ WRAP_T
Definition Texture:463
@ MAG_FILTER
Definition Texture:496
@ MIN_FILTER
Definition Texture:495
void setWrap(WrapParameter which, WrapMode wrap)
Sets the texture wrap mode.
const SubloadCallback * getSubloadCallback() const
Definition TextureRectangle:121
GLsizei _textureWidth
Definition TextureRectangle:156
void setImage(Image *image)
Set the texture image.
virtual int compare(const StateAttribute &rhs) const
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
buffered_value< unsigned int > ImageModifiedCount
Definition TextureRectangle:160
void setSubloadCallback(SubloadCallback *cb)
Definition TextureRectangle:119
TextureRectangle(Image *image)
unsigned int & getModifiedCount(unsigned int contextID) const
Definition TextureRectangle:76
void setTextureWidth(int width)
Definition TextureRectangle:105
void setTextureSize(int width, int height) const
Set the texture width and height.
Definition TextureRectangle:99
virtual void setImage(unsigned int, Image *image)
Set the texture image, ignoring face value as there is only one image.
Definition TextureRectangle:84
virtual int getTextureWidth() const
Definition TextureRectangle:108
ref_ptr< Image > _image
Definition TextureRectangle:153
Image * getImage()
Get the texture image.
Definition TextureRectangle:68
void applyTexImage_subload(GLenum target, Image *image, State &state, GLsizei &inwidth, GLsizei &inheight, GLint &inInternalFormat) const
virtual bool isDirty(unsigned int contextID) const
return true if the texture image data has been modified and the associated GL texture object needs to...
Definition TextureRectangle:74
ref_ptr< SubloadCallback > _subloadCallback
Definition TextureRectangle:158
void allocateMipmap(State &state) const
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function.
void setImage(const ref_ptr< T > &image)
Definition TextureRectangle:65
ImageModifiedCount _modifiedCount
Definition TextureRectangle:161
TextureRectangle(const TextureRectangle &text, const CopyOp ©op=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
const Image * getImage() const
Get the const texture image.
Definition TextureRectangle:71
TextureRectangle(const osg::ref_ptr< T > &image)
Definition TextureRectangle:39
void setTextureHeight(int height)
Definition TextureRectangle:106
virtual void apply(State &state) const
On first apply (unless already compiled), create and bind the texture, subsequent apply will simply b...
void applyTexImage_load(GLenum target, Image *image, State &state, GLsizei &inwidth, GLsizei &inheight) const
virtual int getTextureDepth() const
Definition TextureRectangle:110
void copyTexImage2D(State &state, int x, int y, int width, int height)
Copies pixels into a 2D texture image, as per glCopyTexImage2D.
virtual Image * getImage(unsigned int)
Get the texture image, ignoring face value as there is only one image.
Definition TextureRectangle:87
virtual GLenum getTextureTarget() const
Definition TextureRectangle:60
virtual int getTextureHeight() const
Definition TextureRectangle:109
META_StateAttribute(osg, TextureRectangle, TEXTURE)
void copyTexSubImage2D(State &state, int xoffset, int yoffset, int x, int y, int width, int height)
Copies a two-dimensional texture subimage, as per glCopyTexSubImage2D.
SubloadCallback * getSubloadCallback()
Definition TextureRectangle:120
virtual const Image * getImage(unsigned int) const
Get the const texture image, ignoring face value as there is only one image.
Definition TextureRectangle:90
virtual void computeInternalFormat() const
virtual unsigned int getNumImages() const
Get the number of images that can be assigned to the Texture.
Definition TextureRectangle:93
GLsizei _textureHeight
Definition TextureRectangle:156
virtual ~TextureRectangle()
Definition TextureRectangle:113
virtual void load(const TextureRectangle &, State &) const =0
virtual void subload(const TextureRectangle &, State &) const =0
#define OSG_EXPORT
Definition Export:39