Coverage Report

Created: 2025-08-25 06:48

/src/ogre/OgreMain/include/OgreExternalTextureSourceManager.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
-----------------------------------------------------------------------------
3
This source file is part of OGRE
4
    (Object-oriented Graphics Rendering Engine)
5
For the latest info, see http://www.ogre3d.org/
6
7
Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9
Permission is hereby granted, free of charge, to any person obtaining a copy
10
of this software and associated documentation files (the "Software"), to deal
11
in the Software without restriction, including without limitation the rights
12
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
copies of the Software, and to permit persons to whom the Software is
14
furnished to do so, subject to the following conditions:
15
16
The above copyright notice and this permission notice shall be included in
17
all copies or substantial portions of the Software.
18
19
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
THE SOFTWARE.
26
-----------------------------------------------------------------------------
27
*/
28
#ifndef _OgreExternalTextureSourceManager_H
29
#define _OgreExternalTextureSourceManager_H
30
31
/***************************************************************************
32
OgreExternalTextureSourceManager.h  -  
33
    Handles the registering / unregistering of texture modifier plugins
34
35
-------------------
36
date                 : Jan 1 2004
37
email                : pjcast@yahoo.com
38
***************************************************************************/
39
#include "OgreSingleton.h"
40
#include "OgreResourceGroupManager.h"
41
#include "OgreExternalTextureSource.h"
42
#include "OgreHeaderPrefix.h"
43
44
namespace Ogre
45
{
46
    /** \addtogroup Core
47
    *  @{
48
    */
49
    /** \addtogroup Materials
50
    *  @{
51
    */
52
    /** 
53
    Singleton Class which handles the registering and control of texture plugins. The plugins
54
    will be mostly controlled via a string interface. */
55
    class _OgreExport ExternalTextureSourceManager : public Singleton<ExternalTextureSourceManager>, public ResourceAlloc
56
    {
57
    public:
58
        /** Constructor */
59
        ExternalTextureSourceManager();
60
        /** Destructor */
61
        ~ExternalTextureSourceManager();
62
63
        /** Sets active plugin (ie. "video", "effect", "generic", etc..) */
64
        void setCurrentPlugIn( const String& sTexturePlugInType );
65
66
        /** Returns currently selected plugin, may be null if none selected */
67
0
        ExternalTextureSource* getCurrentPlugIn( void ) const { return mCurrExternalTextureSource; }
68
    
69
        /** Calls the destroy method of all registered plugins... 
70
        Only the owner plugin should perform the destroy action. */
71
        void destroyAdvancedTexture( const String& sTextureName,
72
            const String& groupName = ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
73
74
        /** Returns the plugin which registered itself with a specific name 
75
        (eg. "video"), or null if specified plugin not found */
76
        ExternalTextureSource* getExternalTextureSource( const String& sTexturePlugInType );
77
78
        /** Called from plugin to register itself */
79
        void setExternalTextureSource( const String& sTexturePlugInType, ExternalTextureSource* pTextureSystem );
80
81
        /// @copydoc Singleton::getSingleton()
82
        static ExternalTextureSourceManager& getSingleton(void);
83
        /// @copydoc Singleton::getSingleton()
84
        static ExternalTextureSourceManager* getSingletonPtr(void);
85
    private:
86
        /// The current texture controller selected
87
        ExternalTextureSource* mCurrExternalTextureSource;
88
        
89
        // Collection of loaded texture System PlugIns, keyed by registered type
90
        typedef std::map< String, ExternalTextureSource*> TextureSystemList;
91
        TextureSystemList mTextureSystems;
92
    };
93
    /** @} */
94
    /** @} */
95
} 
96
97
#include "OgreHeaderSuffix.h"
98
99
#endif