10 #ifndef SLASSETLOADER_H
11 #define SLASSETLOADER_H
15 #include <condition_variable>
34 using std::condition_variable;
80 SLint min_filter = GL_LINEAR_MIPMAP_LINEAR,
81 SLint mag_filter = GL_LINEAR,
83 SLint wrapS = GL_REPEAT,
84 SLint wrapT = GL_REPEAT);
94 SLint min_filter = GL_LINEAR,
95 SLint mag_filter = GL_LINEAR,
102 SLint min_filter = GL_LINEAR,
103 SLint mag_filter = GL_LINEAR,
104 SLint wrapS = GL_REPEAT,
105 SLint wrapT = GL_REPEAT,
106 const SLstring& name =
"3D-Texture",
107 SLbool loadGrayscaleIntoAlpha =
false);
117 SLbool loadGrayscaleIntoAlpha);
127 SLbool deleteTexImgAfterBuild =
false,
128 SLbool loadMeshesOnly =
true,
130 float ambientFactor = 0.5f,
131 SLbool forceCookTorranceRM =
false,
vector< SLstring > SLVstring
function< void()> SLAssetLoadTask
vector< SLAssetLoadTask > SLVAssetLoadTask
SLIOStreamKind
Enum of file kinds.
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.
SLTextureType
Texture type enumeration & their filename appendix for auto type detection.
@ SLProcess_SplitLargeMeshes
@ SLProcess_FindDegenerates
@ SLProcess_FindInvalidData
@ SLProcess_RemoveRedundantMaterials
@ SLProcess_JoinIdenticalVertices
void addProgramToLoad(SLGLProgram *&program, const SLstring &vertShaderFile, const SLstring &fragShaderFile)
Add generic GLSL program with shader files to load.
SLstring shaderPath() const
SLVAssetLoadTask _loadTasks
void scene(SLScene *scene)
SLstring texturePath() const
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)
Toplevel holder of the assets meshes, materials, textures and shaders.
Encapsulation of a mobile device location set by the device's GPS sensor.
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.
The SLScene class represents the top level instance holding the scene structure.
Skybox node class with a SLBox mesh.
Utility struct that holds a pointer and its length.