VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgTextureApplyAttribute.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <map>
13 #include <osg/StateAttribute>
14 
15 namespace osg
16 {
17  class State;
18 }
19 
20 namespace makVrv
21 {
22  class DtGlSimpleTexture;
23 
24  class TextureApplyAttribute : public osg::StateAttribute
25  {
26  public:
29 
31  virtual ~TextureApplyAttribute();
32 
34  TextureApplyAttribute(const TextureApplyAttribute& copy, const osg::CopyOp& copyOp =
35  osg::CopyOp::SHALLOW_COPY);
36  private:
40  public:
41 
43  virtual void addTexture(size_t index, DtGlSimpleTexture* texture);
44 
46  virtual DtGlSimpleTexture* texture(size_t index);
47 
49  virtual void removeTexture(size_t index, DtGlSimpleTexture* texture);
50 
52  virtual void apply(osg::State& state) const;
53 
55  virtual int compare(const StateAttribute& sa) const;
56 
58  virtual void releaseGLObjects(osg::State* state/* =0 */) const;
59 
60  META_StateAttribute(osg, TextureApplyAttribute, osg::StateAttribute::Type(TRANSFORMFEEDBACKBUFFERBINDING+1))
61  protected:
62  typedef std::map<size_t, DtGlSimpleTexture*> MapTexUnitToTextures;
64  };
65 }
virtual DtGlSimpleTexture * texture(size_t index)
get the managed texture at the index
Wrapper for OpenGL Texture.
Definition: DtGlSimpleTexture.h:35
virtual int compare(const StateAttribute &sa) const
comparison
std::map< size_t, DtGlSimpleTexture * > MapTexUnitToTextures
Definition: DtOsgTextureApplyAttribute.h:62
MapTexUnitToTextures myMapTexUnitToTextures
Definition: DtOsgTextureApplyAttribute.h:63
virtual void releaseGLObjects(osg::State *state) const
clean up GL resources
virtual void removeTexture(size_t index, DtGlSimpleTexture *texture)
remove the managed texture at the index
TextureApplyAttribute & operator=(const TextureApplyAttribute &)
Private assignment operator.
virtual ~TextureApplyAttribute()
destructor
virtual void addTexture(size_t index, DtGlSimpleTexture *texture)
add a texture to manage
TextureApplyAttribute()
constructor
virtual void apply(osg::State &state) const
apply this attribute
Definition: DtOsgTextureApplyAttribute.h:24

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)