Loading...
Searching...
No Matches
uniformBlock.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_GLF_UNIFORM_BLOCK_H
8#define PXR_IMAGING_GLF_UNIFORM_BLOCK_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/imaging/glf/api.h"
14#include "pxr/imaging/garch/glApi.h"
16#include "pxr/base/tf/refBase.h"
18#include <string>
19
20PXR_NAMESPACE_OPEN_SCOPE
21
22
24TF_DECLARE_WEAK_PTRS(GlfBindingMap);
25
30class GlfUniformBlock : public TfRefBase, public TfWeakBase {
31public:
32
34 GLF_API
35 static GlfUniformBlockRefPtr New(char const *label = nullptr);
36
37 GLF_API
38 virtual ~GlfUniformBlock();
39
41 GLF_API
42 void Bind(GlfBindingMapPtr const & bindingMap,
43 std::string const & identifier);
44
47 GLF_API
48 void Update(const void *data, int size);
49
50protected:
51 GLF_API
52 GlfUniformBlock(char const *label);
53
54private:
55 GLuint _buffer;
56 int _size;
57 std::string _debugLabel;
58};
59
60
61PXR_NAMESPACE_CLOSE_SCOPE
62
63#endif
Manages a GL uniform buffer object.
Definition: uniformBlock.h:30
GLF_API void Update(const void *data, int size)
Updates the content of the uniform buffer.
static GLF_API GlfUniformBlockRefPtr New(char const *label=nullptr)
Returns a new instance.
GLF_API void Bind(GlfBindingMapPtr const &bindingMap, std::string const &identifier)
Binds the uniform buffer using a bindingMap and identifier.
Enable a concrete base class for use with TfRefPtr.
Definition: refBase.h:56
Enable a concrete base class for use with TfWeakPtr.
Definition: weakBase.h:124
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Definition: declarePtrs.h:45
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:72