PageRenderTime 15ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llpatchvertexarray.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 69 lines | 19 code | 7 blank | 43 comment | 0 complexity | 58cd8a76ac36853965268b395c958e04 MD5 | raw file
 1/** 
 2 * @file llpatchvertexarray.h
 3 * @brief description of Surface class
 4 *
 5 * $LicenseInfo:firstyear=2001&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLPATCHVERTEXARRAY_H
28#define LL_LLPATCHVERTEXARRAY_H
29
30// A LLPatchVertexArray is really just a structure of vertex arrays for
31// rendering a "patch" of a certain size.
32//
33// A "patch" is currently a sub-square of a larger square array of data
34// we call a "surface".
35class LLPatchVertexArray 
36{
37public:
38	LLPatchVertexArray();
39	LLPatchVertexArray(U32 surface_width, U32 patch_width, F32 meters_per_grid);   
40	virtual ~LLPatchVertexArray();
41
42	void create(U32 surface_width, U32 patch_width, F32 meters_per_grid); 
43	void destroy();
44	void init();
45
46public:
47	U32 mSurfaceWidth;	// grid points on one side of a LLSurface
48	U32 mPatchWidth;	// grid points on one side of a LLPatch
49	U32 mPatchOrder;	// 2^mPatchOrder >= mPatchWidth
50
51	U32 *mRenderLevelp;	// Look-up table  : render_stride -> render_level
52	U32 *mRenderStridep; // Look-up table : render_level -> render_stride
53
54	// We want to be able to render a patch from multiple resolutions.
55	// The lowest resolution has two triangles, and the highest has 
56	// 2*mPatchWidth*mPatchWidth triangles. 
57	//
58	// mPatchWidth is not hard-coded, so we don't know how much memory 
59	// to allocate to the vertex arrays until it is set.  Once it is
60	// set, we will calculate how much total memory to allocate for the
61	// vertex arrays, and then keep track of their lengths and locations 
62	// in the memory bank.
63	// 
64	// A Patch has three regions that need vertex arrays: middle, north, 
65	// and east.  For each region there are three items that must be 
66	// kept track of: data, offset, and length.
67};
68
69#endif