DI-Guy SDK Documentation  13.8
diguyOsgGraphicsTexture.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2024 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 #pragma once
7 
8 #include <diguyGraphicsTexture.h>
9 
10 #include <osg/Texture2D>
11 #include <osg/Image>
12 #include <osg/StateSet>
13 
14 
30 {
31 
32 public:
33 
34  diguyOsgGraphicsTexture(void* internal_data);
35 
36  virtual ~diguyOsgGraphicsTexture();
37 
38  virtual void asynchronous_post_load() override;
39 
40  virtual void build() override;
41  virtual void unbuild() override;
42 
43  // needed for particle rendering
44  virtual void bind_now(diguyTextureMapType texture_type ) override;
45 
46  osg::Texture2D* get_texture() {return m_texture.get();}
47 
48  static osg::ref_ptr<osg::State> sm_state;
49 
50  void releaseGLObjects();
51 
52 protected:
53 
54  osg::ref_ptr<osg::Texture2D> m_texture;
55  osg::ref_ptr<osg::Image> m_image;
56 };
57 
65 
osg::ref_ptr< osg::Texture2D > m_texture
Definition: diguyOsgGraphicsTexture.h:53
virtual void unbuild() override
This function will be called by DI-Guy when it is time for a renderer-specific texture object to be d...
osg::ref_ptr< osg::Image > m_image
Definition: diguyOsgGraphicsTexture.h:54
virtual void asynchronous_post_load() override
This function will be called by DI-Guy after the texture is loaded but before build.
Definition: diguyOsgGraphicsTexture.h:28
diguyOsgGraphicsTexture(void *internal_data)
virtual ~diguyOsgGraphicsTexture()
virtual void build() override
This function will be called by DI-Guy when it is time for a renderer-specific texture object to be c...
A class that represents a shared texture.
Definition: diguyGraphicsTexture.h:124
diguyTextureMapType
This enumeration lists the type of texture map a given image file is being used as.
Definition: diguyGraphicsTexture.h:55
virtual void bind_now(diguyTextureMapType texture_type) override
This function will be called by DI-Guy when the texture should be made active, or bound...
static osg::ref_ptr< osg::State > sm_state
Definition: diguyOsgGraphicsTexture.h:47
diguyGraphicsTexture * diguyOsgGraphicsTexture_create_func(void *internal_data)
Create function declaration.
osg::Texture2D * get_texture()
Definition: diguyOsgGraphicsTexture.h:45