PageRenderTime 113ms CodeModel.GetById 19ms 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
Possible License(s): LGPL-2.1
  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. #ifndef LL_LLPATCHVERTEXARRAY_H
  27. #define LL_LLPATCHVERTEXARRAY_H
  28. // A LLPatchVertexArray is really just a structure of vertex arrays for
  29. // rendering a "patch" of a certain size.
  30. //
  31. // A "patch" is currently a sub-square of a larger square array of data
  32. // we call a "surface".
  33. class LLPatchVertexArray
  34. {
  35. public:
  36. LLPatchVertexArray();
  37. LLPatchVertexArray(U32 surface_width, U32 patch_width, F32 meters_per_grid);
  38. virtual ~LLPatchVertexArray();
  39. void create(U32 surface_width, U32 patch_width, F32 meters_per_grid);
  40. void destroy();
  41. void init();
  42. public:
  43. U32 mSurfaceWidth; // grid points on one side of a LLSurface
  44. U32 mPatchWidth; // grid points on one side of a LLPatch
  45. U32 mPatchOrder; // 2^mPatchOrder >= mPatchWidth
  46. U32 *mRenderLevelp; // Look-up table : render_stride -> render_level
  47. U32 *mRenderStridep; // Look-up table : render_level -> render_stride
  48. // We want to be able to render a patch from multiple resolutions.
  49. // The lowest resolution has two triangles, and the highest has
  50. // 2*mPatchWidth*mPatchWidth triangles.
  51. //
  52. // mPatchWidth is not hard-coded, so we don't know how much memory
  53. // to allocate to the vertex arrays until it is set. Once it is
  54. // set, we will calculate how much total memory to allocate for the
  55. // vertex arrays, and then keep track of their lengths and locations
  56. // in the memory bank.
  57. //
  58. // A Patch has three regions that need vertex arrays: middle, north,
  59. // and east. For each region there are three items that must be
  60. // kept track of: data, offset, and length.
  61. };
  62. #endif