| OpenSubdiv

Loading...
Searching...
No Matches
glLegacyGregoryPatchTable.h
Go to the documentation of this file.
1//
2// Copyright 2015 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://opensubdiv.org/license.
6//
7
8#ifndef OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H
9#define OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H
10
11#include "../version.h"
12
13#include "../far/patchTable.h"
14#include "../osd/nonCopyable.h"
15
16 namespace OpenSubdiv {
17 namespace OPENSUBDIV_VERSION {
18
19 namespace Osd {
20
21 class GLLegacyGregoryPatchTable
22 : private NonCopyable<GLLegacyGregoryPatchTable> {
23 public:
24 using ID = unsigned int; // GLuint resource ID
25
26 ~GLLegacyGregoryPatchTable();
27
28 static GLLegacyGregoryPatchTable *Create(Far::PatchTable const *patchTable);
29
30 void UpdateVertexBuffer(ID vbo);
31
32 ID GetVertexTextureBuffer() const {
33 return _vertexTextureBuffer;
34 }
35
36 ID GetVertexValenceTextureBuffer() const {
37 return _vertexValenceTextureBuffer;
38 }
39
40 ID GetQuadOffsetsTextureBuffer() const {
41 return _quadOffsetsTextureBuffer;
42 }
43
44 ID GetQuadOffsetsBase(Far::PatchDescriptor::Type type) {
45 if (type == Far::PatchDescriptor::GREGORY_BOUNDARY) {
46 return _quadOffsetsBase[1];
47 }
48 return _quadOffsetsBase[0];
49 }
50
51 protected:
52 GLLegacyGregoryPatchTable();
53
54 private:
55 ID _vertexTextureBuffer;
56 ID _vertexValenceTextureBuffer;
57 ID _quadOffsetsTextureBuffer;
58 ID _quadOffsetsBase[2]; // gregory, boundaryGregory
59};
60
61
62
63} // end namespace Osd
64
65} // end namespace OPENSUBDIV_VERSION
66 using namespace OPENSUBDIV_VERSION;
67
68} // end namespace OpenSubdiv
69
70#endif // OPENSUBDIV3_OSD_GL_LEGACY_GREGORY_PATCH_TABLE_H
patchTable.h
OpenSubdiv
Definition limits.h:15
OpenSubdiv::OPENSUBDIV_VERSION
Definition limits.h:16
OpenSubdiv::OPENSUBDIV_VERSION::Osd
Definition bufferDescriptor.h:17
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::Type
Type
Definition patchDescriptor.h:31
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchDescriptor::GREGORY_BOUNDARY
@ GREGORY_BOUNDARY
Definition patchDescriptor.h:44
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable
Container for arrays of parametric patches.
Definition patchTable.h:38
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable::UpdateVertexBuffer
void UpdateVertexBuffer(ID vbo)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable::~GLLegacyGregoryPatchTable
~GLLegacyGregoryPatchTable()
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable::GLLegacyGregoryPatchTable
GLLegacyGregoryPatchTable()
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable::GetQuadOffsetsBase
ID GetQuadOffsetsBase(Far::PatchDescriptor::Type type)
Definition glLegacyGregoryPatchTable.h:44
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable::GetQuadOffsetsTextureBuffer
ID GetQuadOffsetsTextureBuffer() const
Definition glLegacyGregoryPatchTable.h:40
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable::ID
unsigned int ID
Definition glLegacyGregoryPatchTable.h:24
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable::GetVertexValenceTextureBuffer
ID GetVertexValenceTextureBuffer() const
Definition glLegacyGregoryPatchTable.h:36
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable::Create
static GLLegacyGregoryPatchTable * Create(Far::PatchTable const *patchTable)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLLegacyGregoryPatchTable::GetVertexTextureBuffer
ID GetVertexTextureBuffer() const
Definition glLegacyGregoryPatchTable.h:32