Mali OpenGL ES SDK  2.0.0
A simple framework to aid development of OpenGL ES applications targeting ARM Mali platforms.
 All Classes Files Functions Variables Enumerations Enumerator
Texture.h
1 /*
2  * This confidential and proprietary software may be used only as
3  * authorised by a licensing agreement from ARM Limited
4  * (C) COPYRIGHT 2012 ARM Limited
5  * ALL RIGHTS RESERVED
6  * The entire notice above must be reproduced on all authorised
7  * copies and copies may only be made to the extent permitted
8  * by a licensing agreement from ARM Limited.
9  */
10 
11 #ifndef TEXTURE_H
12 #define TEXTURE_H
13 
14 #include "ETCHeader.h"
15 
16 #if GLES_VERSION == 2
17 #include <GLES2/gl2.h>
18 #elif GLES_VERSION == 3
19 #include <GLES3/gl3.h>
20 #else
21 #error "GLES_VERSION must be defined as either 2 or 3"
22 #endif
23 
24 namespace MaliSDK
25 {
29  class Texture
30  {
31  private:
39  static void getCompressedTextureFormats(GLint **textureFormats, int* numberOfTextureFormats);
40  public:
48  static bool isETCSupported(bool verbose = false);
49 
57  static void createTexture(unsigned int width, unsigned int height, GLvoid **textureData);
58 
67  static void createTexture(unsigned int width, unsigned int height, unsigned int red, GLvoid **textureData);
68 
74  static void deleteTextureData(GLvoid **textureData);
75 
82  static void loadData(const char *filename, unsigned char **textureData);
83 
91  static void loadPKMData(const char *filename, ETCHeader* etcHeader, unsigned char **textureData);
92 
105  static void loadCompressedMipmaps(const char *filenameBase, const char *filenameSuffix, GLuint *textureID);
106  };
107 }
108 #endif /* TEXTURE_H */