summaryrefslogtreecommitdiff
path: root/ZAPD/HighLevel/HLTexture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ZAPD/HighLevel/HLTexture.cpp')
-rw-r--r--ZAPD/HighLevel/HLTexture.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/ZAPD/HighLevel/HLTexture.cpp b/ZAPD/HighLevel/HLTexture.cpp
new file mode 100644
index 0000000..fc81c28
--- /dev/null
+++ b/ZAPD/HighLevel/HLTexture.cpp
@@ -0,0 +1,15 @@
+#include "HLTexture.h"
+#include "../StringHelper.h"
+#include "../stb_image.h"
+
+using namespace std;
+
+HLTexture* HLTexture::FromPNG(std::string pngFilePath, HLTextureType texType)
+{
+ int comp;
+ HLTexture* tex = new HLTexture();
+ tex->type = texType;
+ tex->bmpRgba = (uint8_t*)stbi_load((pngFilePath).c_str(), (int*)&tex->width, (int*)&tex->height, &comp, STBI_rgb_alpha);
+
+ return tex;
+}