-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextureAsset.h
More file actions
34 lines (27 loc) · 927 Bytes
/
Copy pathTextureAsset.h
File metadata and controls
34 lines (27 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef ANDROIDGLINVESTIGATIONS_TEXTUREASSET_H
#define ANDROIDGLINVESTIGATIONS_TEXTUREASSET_H
#include <memory>
#include <android/asset_manager.h>
#include <GLES3/gl3.h>
#include <string>
#include <vector>
class TextureAsset {
public:
/*!
* Loads a texture asset from the assets/ directory
* @param assetManager Asset manager to use
* @param assetPath The path to the asset
* @return a shared pointer to a texture asset, resources will be reclaimed when it's cleaned up
*/
static std::shared_ptr<TextureAsset>
loadAsset(AAssetManager *assetManager, const std::string &assetPath);
~TextureAsset();
/*!
* @return the texture id for use with OpenGL
*/
constexpr GLuint getTextureID() const { return textureID_; }
private:
inline TextureAsset(GLuint textureId) : textureID_(textureId) {}
GLuint textureID_;
};
#endif //ANDROIDGLINVESTIGATIONS_TEXTUREASSET_H