mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-27 03:53:24 +00:00
moved texture GPU data loading to Root
reordered node and mesh rendering data generation materials no longer create their own shaders
This commit is contained in:
+4
-2
@@ -1,4 +1,5 @@
|
||||
#include "imageReader.h"
|
||||
#include "root.h"
|
||||
|
||||
#include "stb_image.h"
|
||||
|
||||
@@ -16,8 +17,9 @@ namespace vb01{
|
||||
|
||||
Asset* ImageReader::readAsset(string path){
|
||||
stbi_set_flip_vertically_on_load(flip);
|
||||
int width, height, numChannels;
|
||||
int width, height, numChannels, layerId;
|
||||
u8 *data = stbi_load(path.c_str(), &width, &height, &numChannels, 0);
|
||||
return new ImageAsset(path, data, width, height, numChannels);
|
||||
Root::getSingleton()->initTextureDataOnGpu(Root::getSingleton()->getMeshTextureBuffer(), data, width, height, layerId);
|
||||
return new ImageAsset(path, data, width, height, numChannels, layerId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user