25 using std::unique_lock;
31 : _modelPath(modelPath),
32 _texturePath(texturePath),
33 _shaderPath(shaderPath),
37 auto workerFunc = [
this]()
71 _worker = std::thread(workerFunc);
93 _loadTasks.push_back([
this, &buffer, filename, kind]
164 SLbool loadGrayscaleIntoAlpha)
176 loadGrayscaleIntoAlpha]
185 loadGrayscaleIntoAlpha); });
208 SLbool loadGrayscaleIntoAlpha)
218 loadGrayscaleIntoAlpha]
226 loadGrayscaleIntoAlpha); });
254 SLbool deleteTexImgAfterBuild,
258 SLbool forceCookTorranceRM,
265 deleteTexImgAfterBuild,
272 SLAssimpImporter importer;
278 deleteTexImgAfterBuild,
288 const SLstring& hdrImageWithFullPath,
294 hdrImageWithFullPath,
299 hdrImageWithFullPath,
vector< SLstring > SLVstring
function< void()> SLAssetLoadTask
Mobile device location class declaration.
SLIOStreamKind
Enum of file kinds.
SLTextureType
Texture type enumeration & their filename appendix for auto type detection.
void addProgramToLoad(SLGLProgram *&program, const SLstring &vertShaderFile, const SLstring &fragShaderFile)
Add generic GLSL program with shader files to load.
SLVAssetLoadTask _loadTasks
void loadAssetsAsync(function< void()> onDone)
void checkIfAsyncLoadingIsDone()
mutex _messageMutex
mutex protecting state between threads
void addGeoTiffToLoad(SLDeviceLocation &devLoc, const SLstring &imageFileWithPath)
Add GeoTiff file to load for the SLDevLocation.
condition_variable _messageCondVar
mutex for waiting until state has changed
atomic< State > _state
current state (used for communication between threads)
void addSkyboxToLoad(SLSkybox *&skybox, const SLstring &path, SLVec2i resolution, SLstring name)
Add skybox with HDR texture to load.
thread _worker
worker thread for parallel loading
SLstring modelPath() const
void addLoadTask(SLAssetLoadTask task)
Add generic task.
void addTextureToLoad(SLGLTexture *&texture, const SLstring &path, SLint min_filter=GL_LINEAR_MIPMAP_LINEAR, SLint mag_filter=GL_LINEAR, SLTextureType type=TT_unknown, SLint wrapS=GL_REPEAT, SLint wrapT=GL_REPEAT)
Add 2D textures with internal image allocation.
SLAssetLoader(SLstring modelPath, SLstring texturePath, SLstring shaderPath, SLstring fontPath)
function< void()> _onDoneLoading
Callback after threaded loading.
void addNodeToLoad(SLNode *&node, const SLstring &modelPath, SLSkybox *skybox=nullptr, SLbool deleteTexImgAfterBuild=false, SLbool loadMeshesOnly=true, SLMaterial *overrideMat=nullptr, float ambientFactor=0.5f, SLbool forceCookTorranceRM=false, SLuint flags=SLProcess_Triangulate|SLProcess_JoinIdenticalVertices|SLProcess_RemoveRedundantMaterials|SLProcess_FindDegenerates|SLProcess_FindInvalidData|SLProcess_SplitLargeMeshes)
Add mesh from file to load via assimp loader.
void addRawDataToLoad(SLIOBuffer &buffer, SLstring filename, SLIOStreamKind kind)
Encapsulation of a mobile device location set by the device's GPS sensor.
void loadGeoTiff(const SLstring &geoTiffFile)
Loads a GeoTiff DEM (Digital Elevation Model) Image.
Generic Shader Program class inherited from SLGLProgram.
Encapsulation of an OpenGL shader program object.
Texture object for OpenGL texturing.
Defines a standard CG material with textures and a shader program.
SLNode represents a node in a hierarchical scene graph.
SLAssetManager * assetManager()
SLAnimManager & animManager()
Skybox node class with a SLBox mesh.
SLIOBuffer readIntoBuffer(std::string path, SLIOStreamKind kind)
Reads an entire file into memory.
Utility struct that holds a pointer and its length.