PageRenderTime 30ms CodeModel.GetById 22ms app.highlight 5ms RepoModel.GetById 1ms 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
 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
32#ifndef LL_TEXTURE_H
33#define LL_TEXTURE_H
34
35#include "llrefcount.h"
36class LLImageGL ;
37class LLTexUnit ;
38class LLFontGL ;
39
40//
41//this is an abstract class as the parent for the class LLViewerTexture
42//through the following virtual functions, the class LLViewerTexture can be reached from /llrender.
43//
44class LLTexture : public LLRefCount
45{
46	friend class LLTexUnit ;
47	friend class LLFontGL ;
48
49protected:
50	virtual ~LLTexture();
51
52public:
53	LLTexture(){}
54
55	//
56	//interfaces to access LLViewerTexture
57	//
58	virtual S8         getType() const = 0 ;
59	virtual void       setKnownDrawSize(S32 width, S32 height) = 0 ;
60	virtual bool       bindDefaultImage(const S32 stage = 0) = 0 ;
61	virtual void       forceImmediateUpdate() = 0 ;
62	virtual void       setActive() = 0 ;
63	virtual S32	       getWidth(S32 discard_level = -1) const = 0 ;
64	virtual S32	       getHeight(S32 discard_level = -1) const = 0 ;
65
66private:
67	//note: do not make this function public.
68	virtual LLImageGL* getGLTexture() const = 0 ;
69
70	virtual void updateBindStatsForTester() = 0 ;
71};
72#endif
73