Overte C++ Documentation
GLTexelFormat.h
1 //
2 // Created by Bradley Austin Davis on 2016/05/15
3 // Copyright 2013-2016 High Fidelity, Inc.
4 //
5 // Distributed under the Apache License, Version 2.0.
6 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
7 //
8 #ifndef hifi_gpu_gl_GLTexelFormat_h
9 #define hifi_gpu_gl_GLTexelFormat_h
10 
11 #include "GLShared.h"
12 
13 namespace gpu { namespace gl {
14 
15 class GLTexelFormat {
16 public:
17  GLenum internalFormat{ GL_RGBA8 };
18  GLenum format{ GL_RGBA };
19  GLenum type{ GL_UNSIGNED_BYTE };
20 
21  GLTexelFormat(GLenum glinternalFormat, GLenum glformat, GLenum gltype) : internalFormat(glinternalFormat), format(glformat), type(gltype) {}
22  GLTexelFormat(GLenum glinternalFormat) : internalFormat(glinternalFormat) {}
23 
24  static bool isCompressed(GLenum glinternalFormat);
25 
26  bool isCompressed() const;
27 
28  static GLTexelFormat evalGLTexelFormat(const Element& dstFormat) {
29  return evalGLTexelFormat(dstFormat, dstFormat);
30  }
31  static GLenum evalGLTexelFormatInternal(const Element& dstFormat);
32 
33  static GLTexelFormat evalGLTexelFormat(const Element& dstFormat, const Element& srcFormat);
34 };
35 
36 } }
37 
38 
39 #endif