HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
utils.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_UTILS_H
8 #define PXR_IMAGING_GLF_UTILS_H
9 
10 /// \file glf/utils.h
11 
12 #include "pxr/pxr.h"
13 #include "pxr/imaging/glf/api.h"
15 #include "pxr/imaging/hio/types.h"
16 
17 #include <string>
18 
20 
21 /// Number of elements.
22 ///
23 /// Returns the number of elements (channels) in a given GL enum format.
24 ///
25 /// Supported formats are : GL_DEPTH_COMPONENT, GL_COLOR_INDEX, GL_ALPHA,
26 /// GL_RED, GL_LUMINANCE, GL_RG, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA
27 GLF_API
29 
30 /// Byte size of a GL type.
31 ///
32 /// Returns the size in bytes of a given GL type.
33 ///
34 /// Supported types are : GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT,
35 /// GL_SHORT, GL_FLOAT, GL_DOUBLE
36 GLF_API
38 
39 /// HioFormat
40 ///
41 /// Returns the HioFormat for the given GL format and GL type
42 ///
43 /// Supported formats are : GL_DEPTH_COMPONENT, GL_COLOR_INDEX, GL_ALPHA,
44 /// GL_RED, GL_LUMINANCE, GL_RG, GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA
45 ///
46 /// Supported types are : GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT,
47 /// GL_SHORT, GL_FLOAT, GL_DOUBLE
48 GLF_API
49 HioFormat GlfGetHioFormat(GLenum glFormat, GLenum glType, bool isSRGB);
50 
51 
52 /// Checks the valitidy of a GL framebuffer
53 ///
54 /// True if the currently bound GL framebuffer is valid and can be bound
55 /// or returns the cause of the problem
56 GLF_API
57 bool GlfCheckGLFrameBufferStatus(GLuint target, std::string * reason);
58 
60 
61 #endif
#define GLF_API
Definition: api.h:23
GLF_API bool GlfCheckGLFrameBufferStatus(GLuint target, std::string *reason)
GLF_API HioFormat GlfGetHioFormat(GLenum glFormat, GLenum glType, bool isSRGB)
unsigned int GLuint
Definition: cl.hpp:167
unsigned int GLenum
Definition: cl.hpp:166
PXR_NAMESPACE_OPEN_SCOPE GLF_API int GlfGetNumElements(GLenum format)
GLF_API int GlfGetElementSize(GLenum type)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
GLenum target
Definition: glcorearb.h:1667
HioFormat
Definition: types.h:25
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74