-
-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathTexture.h
76 lines (60 loc) · 1.51 KB
/
Texture.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* Copyright (c) scott.cgi All Rights Reserved.
*
* This source code belongs to project Mojoc, which is a pure C Game Engine hosted on GitHub.
* The Mojoc Game Engine is licensed under the MIT License, and will continue to be iterated with coding passion.
*
* License : https://github.com/scottcgi/Mojoc/blob/master/LICENSE
* GitHub : https://github.com/scottcgi/Mojoc
* CodeStyle: https://github.com/scottcgi/Mojoc/blob/master/Docs/CodeStyle.md
*
* Since : 2012-12-29
* Update : 2019-1-19
* Author : scott.cgi
*/
#ifndef TEXTURE_H
#define TEXTURE_H
#include "Engine/Graphics/OpenGL/Platform/gl3.h"
#include "Engine/Toolkit/HeaderUtils/Define.h"
typedef struct
{
/**
* The openGL generated texture id.
*/
GLuint id;
/**
* The texture width.
*/
float width;
/**
* The texture height.
*/
float height;
/**
* All texture cache in ArrayStrMap by filePath.
*/
const char* filePath;
}
Texture;
/**
* Manage and control Texture.
*/
struct ATexture
{
/**
* Get Texture by resourceFilePath, not found will create one.
*
* resourceFilePath:
* Android: assets
* IOS : NSBundle
*/
Texture* (*Get) (const char* resourceFilePath);
/**
* Destroy texture memory both in GPU and CPU, and removed from cache.
*
* important: after Destroy the texture will be invalidated.
*/
void (*Destroy)(Texture* texture);
};
extern struct ATexture ATexture[1];
#endif