OpenSceneGraph 3.6.5
Texture2DMultisample
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12 *
13 * Texture2DMultisample codes Copyright (C) 2010 Marcin Hajder
14 * Thanks to to my company http://www.ai.com.pl for allowing me free this work.
15*/
16
17#ifndef OSG_TEXTURE2DMS
18#define OSG_TEXTURE2DMS 1
19
20#include <osg/Texture>
21
22namespace osg {
23
28
30{
31 public :
32
34
35 Texture2DMultisample(GLsizei numSamples, GLboolean fixedsamplelocations);
36
39
41
43 virtual int compare(const StateAttribute& rhs) const;
44
45 virtual GLenum getTextureTarget() const
46 {
48 }
49
51 virtual bool getModeUsage(StateAttribute::ModeUsage&) const { return false; }
52
55 inline void setTextureSize(int width, int height) const
56 {
57 _textureWidth = width;
58 _textureHeight = height;
59 }
60
61 inline void setNumSamples( int samples ) { _numSamples = samples; }
62 GLsizei getNumSamples() const { return _numSamples; }
63
64 inline void setFixedSampleLocations( GLboolean fixedSampleLocations ) { _fixedsamplelocations = fixedSampleLocations; }
65 inline GLboolean getFixedSampleLocations() const { return _fixedsamplelocations; }
66
67 // unnecessary for Texture2DMultisample
68 virtual void setImage(unsigned int /*face*/, Image* /*image*/) {}
69
70 virtual Image* getImage(unsigned int /*face*/) { return NULL; }
71 virtual const Image* getImage(unsigned int /*face*/) const { return NULL; }
72 virtual unsigned int getNumImages() const {return 0; }
73 virtual void allocateMipmap(State& /*state*/) const {}
74
75 void setTextureWidth(int width) { _textureWidth=width; }
76 void setTextureHeight(int height) { _textureHeight=height; }
77
78 virtual int getTextureWidth() const { return _textureWidth; }
79 virtual int getTextureHeight() const { return _textureHeight; }
80 virtual int getTextureDepth() const { return 1; }
81
84 virtual void apply(State& state) const;
85
86 protected :
87
89
90 virtual void computeInternalFormat() const;
91
93 mutable GLsizei _textureWidth, _textureHeight;
94
95 mutable GLsizei _numSamples;
96
97 mutable GLboolean _fixedsamplelocations;
98
99};
100
101}
102
103#endif
#define GL_TEXTURE_2D_MULTISAMPLE
Definition Texture:236
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
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
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
Definition StateAttribute:308
virtual GLenum getTextureTarget() const
Definition Texture2DMultisample:45
virtual int getTextureWidth() const
Definition Texture2DMultisample:78
GLsizei _textureWidth
Subloaded images can have different texture and image sizes.
Definition Texture2DMultisample:93
META_StateAttribute(osg, Texture2DMultisample, TEXTURE)
void setTextureHeight(int height)
Definition Texture2DMultisample:76
virtual unsigned int getNumImages() const
Gets the number of images that can be assigned to this Texture.
Definition Texture2DMultisample:72
void setTextureWidth(int width)
Definition Texture2DMultisample:75
virtual bool getModeUsage(StateAttribute::ModeUsage &) const
Texture2DMultisample is related to non fixed pipeline usage only so isn't appropriate to enable/disab...
Definition Texture2DMultisample:51
virtual void apply(State &state) const
Bind the texture object.
virtual void computeInternalFormat() const
GLboolean _fixedsamplelocations
Definition Texture2DMultisample:97
void setTextureSize(int width, int height) const
Sets the texture width and height.
Definition Texture2DMultisample:55
virtual const Image * getImage(unsigned int) const
Gets the const texture image for specified face.
Definition Texture2DMultisample:71
void setNumSamples(int samples)
Definition Texture2DMultisample:61
GLsizei _numSamples
Definition Texture2DMultisample:95
virtual void setImage(unsigned int, Image *)
Sets the texture image for the specified face.
Definition Texture2DMultisample:68
GLsizei _textureHeight
Definition Texture2DMultisample:93
virtual void allocateMipmap(State &) const
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function.
Definition Texture2DMultisample:73
virtual Image * getImage(unsigned int)
Gets the texture image for the specified face.
Definition Texture2DMultisample:70
virtual int compare(const StateAttribute &rhs) const
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
virtual int getTextureDepth() const
Definition Texture2DMultisample:80
void setFixedSampleLocations(GLboolean fixedSampleLocations)
Definition Texture2DMultisample:64
Texture2DMultisample(const Texture2DMultisample &text, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Texture2DMultisample(GLsizei numSamples, GLboolean fixedsamplelocations)
virtual int getTextureHeight() const
Definition Texture2DMultisample:79
GLboolean getFixedSampleLocations() const
Definition Texture2DMultisample:65
GLsizei getNumSamples() const
Definition Texture2DMultisample:62
#define NULL
Definition Export:55
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.