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 29 #ifndef __GL3PlusTextureManager_H__ 30 #define __GL3PlusTextureManager_H__ 31 32 #include "OgreGL3PlusPrerequisites.h" 33 #include "OgreTextureManager.h" 34 #include "OgreGL3PlusTexture.h" 35 36 #include <vector> 37 38 namespace Ogre { 39 typedef std::vector<GL3PlusTexturePtr> GL3PlusTexturePtrList; 40 typedef std::vector<TexturePtr> TexturePtrList; 41 42 class _OgreGL3PlusExport GL3PlusSampler : public Sampler 43 { 44 public: 45 GL3PlusSampler(GL3PlusRenderSystem* rs); 46 ~GL3PlusSampler(); 47 void bind(uint32 unit); 48 static GLint getCombinedMinMipFilter(FilterOptions min, FilterOptions mip); 49 static GLint getTextureAddressingMode(TextureAddressingMode tam); 50 private: 51 uint32 mSamplerId; 52 }; 53 54 /** GL3Plus-specific implementation of a TextureManager */ 55 class _OgreGL3PlusExport GL3PlusTextureManager : public TextureManager 56 { 57 public: 58 GL3PlusTextureManager(GL3PlusRenderSystem* renderSystem); 59 virtual ~GL3PlusTextureManager(); 60 61 /// @copydoc TextureManager::getNativeFormat 62 PixelFormat getNativeFormat(TextureType ttype, PixelFormat format, int usage); 63 64 // void bindImages(); 65 66 /* TexturePtr createManual(const String & name, const String& group, */ 67 /* TextureType texType, uint width, uint height, uint depth, int numMipmaps, */ 68 /* PixelFormat format, int usage, ManualResourceLoader* loader, bool hwGamma, */ 69 /* uint fsaa, const String& fsaaHint); */ 70 71 protected: 72 /// @copydoc ResourceManager::createImpl 73 Resource* createImpl(const String& name, ResourceHandle handle, 74 const String& group, bool isManual, ManualResourceLoader* loader, 75 const NameValuePairList* createParams); 76 77 GL3PlusRenderSystem* mRenderSystem; 78 79 SamplerPtr _createSamplerImpl(); 80 81 private: 82 /// Register a texture as an image texture used in image load/store. 83 // void registerImage(TexturePtr texture); 84 85 /// Collection of textures associated with image load/store variables. 86 // TexturePtrList mImages; 87 }; 88 } 89 90 #endif 91