PageRenderTime 29ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llrender/lltexture.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 73 lines | 26 code | 9 blank | 38 comment | 0 complexity | 247e8f03408e9856448985836bdbe564 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lltexture.h
  3. * @brief LLTexture definition
  4. *
  5. * This class acts as a wrapper for OpenGL calls.
  6. * The goal of this class is to minimize the number of api calls due to legacy rendering
  7. * code, to define an interface for a multiple rendering API abstraction of the UI
  8. * rendering, and to abstract out direct rendering calls in a way that is cleaner and easier to maintain.
  9. *
  10. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  11. * Second Life Viewer Source Code
  12. * Copyright (C) 2010, Linden Research, Inc.
  13. *
  14. * This library is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU Lesser General Public
  16. * License as published by the Free Software Foundation;
  17. * version 2.1 of the License only.
  18. *
  19. * This library is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  22. * Lesser General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU Lesser General Public
  25. * License along with this library; if not, write to the Free Software
  26. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  27. *
  28. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  29. * $/LicenseInfo$
  30. */
  31. #ifndef LL_TEXTURE_H
  32. #define LL_TEXTURE_H
  33. #include "llrefcount.h"
  34. class LLImageGL ;
  35. class LLTexUnit ;
  36. class LLFontGL ;
  37. //
  38. //this is an abstract class as the parent for the class LLViewerTexture
  39. //through the following virtual functions, the class LLViewerTexture can be reached from /llrender.
  40. //
  41. class LLTexture : public LLRefCount
  42. {
  43. friend class LLTexUnit ;
  44. friend class LLFontGL ;
  45. protected:
  46. virtual ~LLTexture();
  47. public:
  48. LLTexture(){}
  49. //
  50. //interfaces to access LLViewerTexture
  51. //
  52. virtual S8 getType() const = 0 ;
  53. virtual void setKnownDrawSize(S32 width, S32 height) = 0 ;
  54. virtual bool bindDefaultImage(const S32 stage = 0) = 0 ;
  55. virtual void forceImmediateUpdate() = 0 ;
  56. virtual void setActive() = 0 ;
  57. virtual S32 getWidth(S32 discard_level = -1) const = 0 ;
  58. virtual S32 getHeight(S32 discard_level = -1) const = 0 ;
  59. private:
  60. //note: do not make this function public.
  61. virtual LLImageGL* getGLTexture() const = 0 ;
  62. virtual void updateBindStatsForTester() = 0 ;
  63. };
  64. #endif