/SleekThink.depend
77351,7 → 77351,7
"LinearMath/btScalar.h"
"btRigidBody.h"
 
1420905177 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/node/billboard/billboard.h
1422742283 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/node/billboard/billboard.h
"../node.h"
"../math/timer.h"
 
77602,7 → 77602,7
"../sleek/start.h"
"../sleek/driver/mesh.h"
 
1421727789 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/GameEngine.cpp
1421875422 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/app/GameEngine.cpp
"GameCore.h"
"GameEngine.h"
"light.h"
79431,7 → 79431,7
"../engine.h"
"sprite.h"
 
1421727796 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/node/camera/camera.cpp
1422292689 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/node/camera/camera.cpp
"../../device/device.h"
"../../library/glm/detail/func_geometric.hpp"
"../../library/glm/gtc/matrix_transform.hpp"
80887,11 → 80887,7
 
1324743734 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/mesh/post-processing.cpp
 
1419975830 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/loader/texture_loader.h
"texture_bmp.h"
"texture_tiff.h"
"texture_png.h"
"texture_raw.h"
1422750988 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/loader/texture_loader.h
 
1420769735 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/loader/texture_bmp.h
<string>
80918,7 → 80914,7
"cursor.h"
"../driver/fbo.h"
 
1420904859 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/loader/mesh_3ds.cpp
1422748781 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/loader/mesh_3ds.cpp
"../driver/mesh.h"
"../compile.h"
<sys/stat.h>
80935,7 → 80931,7
"../mesh/mesh.h"
"../compile.h"
 
1420904859 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/loader/mesh_txt.cpp
1422748800 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/loader/mesh_txt.cpp
"../library/glm/detail/func_geometric.hpp"
"../driver/mesh.h"
"../compile.h"
81023,7 → 81019,7
"material.h"
"context.h"
 
1421725181 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/device/device.h
1422746684 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/device/device.h
"icone.h"
"device_stub.h"
"../define.h"
81170,7 → 81166,7
<iostream>
"console/spdlog.h"
 
1420902871 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/compile.h
1422743469 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/compile.h
 
1419891890 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/driver/ogl_driver.cpp
"../device/device.h"
81599,3 → 81595,57
1324743730 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/library/opengl/glew.h
<GL/glu.h>
 
1422748702 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/io/filesystem.cpp
"filesystem.h"
 
1422748995 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/io/filesystem.h
"directory.h"
"archive.h"
"filereader.h"
"filewriter.h"
<vector>
 
1422748684 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/io/archive.h
<memory>
<string>
"filereader.h"
"filewriter.h"
"directory.h"
 
1422749737 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/io/directory.h
<string>
<memory>
"../define.h"
 
1422750261 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/io/filereader.h
<string>
<memory>
"../define.h"
 
1422750020 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/io/filewriter.h
<string>
<memory>
"../define.h"
 
1422749111 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/io/std/filesystem.h
"../filesystem.h"
 
1422750539 source:/mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/io/std/filesystem.cpp
"filesystem.h"
"directory.h"
"filereader.h"
"filewriter.h"
<unistd.h>
 
1422750550 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/io/std/filereader.h
"../filereader.h"
<fstream>
 
1422750077 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/io/std/filewriter.h
"../filewriter.h"
<fstream>
 
1422749944 /mnt/windows1/Development/Project/Xtrem-Coder/Sleek Think/src/sleek/io/std/directory.h
<vector>
"../directory.h"
 
/SleekThink.layout
Cannot display: file marked as a binary type.
svn:mime-type = application/xml
/bin/SleekThink
Cannot display: file marked as a binary type.
svn:mime-type = application/x-executable
/bin/gmon.out
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/src/sleek/compile.h
9,6 → 9,8
//#define sdl2_device_support
//#define index_clockwise
 
#define std_filesystem
 
#define texture_loader_bmp
#define texture_loader_png
#define texture_loader_tiff
/src/sleek/device/device.h
57,7 → 57,6
return shared_from_this();
}
 
 
virtual void WarpMouse(const math::vector2di&) noexcept;
virtual void ShowMouse(bool) noexcept;
 
/src/sleek/io/archive.h
0,0 → 1,50
#ifndef __ARCHIVE__
#define __ARCHIVE__
 
#include <memory>
#include <string>
 
#include "filereader.h"
#include "filewriter.h"
#include "directory.h"
 
namespace sleek
{
namespace io
{
class archive : public std::enable_shared_from_this<archive>
{
public:
inline std::shared_ptr<archive> getptr() noexcept
{
return shared_from_this();
}
 
virtual const std::string& filename() = 0;
 
virtual std::shared_ptr<filereader> read(const std::string&) = 0;
virtual std::shared_ptr<filewriter> write(const std::string&) = 0;
 
virtual std::shared_ptr<archive> load(const std::string&) = 0;
virtual std::shared_ptr<directory> list(const std::string&) = 0;
};
class archiveloader : public std::enable_shared_from_this<archiveloader>
{
public:
 
inline std::shared_ptr<archiveloader> getptr() noexcept
{
return shared_from_this();
}
 
/**
* test if the given filename can be loader
*/
virtual bool match(const std::string&) const noexcept = 0;
 
virtual std::shared_ptr<archive> load(const std::string&) const noexcept = 0;
};
}
}
 
#endif // __ARCHIVE_LOADER__
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/io/directory.h
===================================================================
--- src/sleek/io/directory.h (nonexistent)
+++ src/sleek/io/directory.h (revision 4)
@@ -0,0 +1,38 @@
+#ifndef __DIRECTORY__
+#define __DIRECTORY__
+
+#include <string>
+#include <memory>
+#include "../define.h"
+
+namespace sleek
+{
+ namespace io
+ {
+ class directory : public std::enable_shared_from_this<directory>
+ {
+ public:
+ struct entry
+ {
+ std::string filename;
+ std::string offset;
+ std::string size;
+ u32 lenght;
+ };
+ public:
+ inline std::shared_ptr<directory> getptr() noexcept
+ {
+ return shared_from_this();
+ }
+
+ virtual const std::string& filename() const noexcept = 0;
+
+ virtual s32 find(std::function<bool(const entry&)> f) const noexcept = 0;
+ virtual entry operator[] (u32 i) const noexcept = 0;
+
+ virtual void refresh() noexcept = 0;
+ };
+ }
+}
+
+#endif // __DIRECTORY__
/src/sleek/io/directory.h
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/io/filereader.h
===================================================================
--- src/sleek/io/filereader.h (nonexistent)
+++ src/sleek/io/filereader.h (revision 4)
@@ -0,0 +1,31 @@
+#ifndef __FILE_READER__
+#define __FILE_READER__
+
+#include <string>
+#include <memory>
+#include "../define.h"
+
+namespace sleek
+{
+ namespace io
+ {
+ class filereader : public std::enable_shared_from_this<filereader>
+ {
+ public:
+ inline std::shared_ptr<filereader> getptr() noexcept
+ {
+ return shared_from_this();
+ }
+
+ virtual const std::string& filename() const noexcept = 0;
+
+ virtual void read(void *, u32) noexcept = 0;
+ virtual void seek(u32, bool relative = false) noexcept = 0;
+
+ virtual u32 pos() noexcept = 0;
+ virtual u32 size() const noexcept = 0;
+ };
+ }
+}
+
+#endif // __FILE_WRITER__
/src/sleek/io/filereader.h
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/io/filesystem.cpp
===================================================================
--- src/sleek/io/filesystem.cpp (nonexistent)
+++ src/sleek/io/filesystem.cpp (revision 4)
@@ -0,0 +1,26 @@
+#include "filesystem.h"
+
+namespace sleek
+{
+ namespace io
+ {
+ std::shared_ptr<archive> filesystem::load(const std::string &filename) const noexcept
+ {
+ for(auto e : loader)
+ if(e->match(filename))
+ return e->load(filename);
+ return nullptr;
+ }
+ std::shared_ptr<filesystem> createFilesystem(FILE_SYSTEM_TYPE e)
+ {
+ switch(e)
+ {
+ #ifdef std_filesystem
+ case FST_STD:
+ return std::make_shared<std_filesystem>();
+ #endif // std_filesystem
+ }
+ return nullptr;
+ }
+ }
+}
/src/sleek/io/filesystem.cpp
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/io/filesystem.h
===================================================================
--- src/sleek/io/filesystem.h (nonexistent)
+++ src/sleek/io/filesystem.h (revision 4)
@@ -0,0 +1,47 @@
+#ifndef __FILE_SYSTEM__
+#define __FILE_SYSTEM__
+
+#include "directory.h"
+#include "archive.h"
+#include "filereader.h"
+#include "filewriter.h"
+#include <vector>
+
+namespace sleek
+{
+ namespace io
+ {
+ enum class FILE_SYSTEM_TYPE
+ {
+ FST_STD,
+ FST_COUNT
+ };
+
+ class filesystem : public std::enable_shared_from_this<filesystem>
+ {
+ public:
+ inline std::shared_ptr<filesystem> getptr() noexcept
+ {
+ return shared_from_this();
+ }
+
+ virtual void cd(const std::string&) noexcept = 0;
+ virtual const std::string& pwd() const noexcept = 0;
+
+ virtual std::shared_ptr<filereader> read(const std::string&) const noexcept = 0;
+ virtual std::shared_ptr<filereader> read(const std::string&, void *ptr) const noexcept = 0;
+
+ virtual std::shared_ptr<filewriter> write(const std::string&) const noexcept = 0;
+ virtual std::shared_ptr<filewriter> write(const std::string&, void *ptr) const noexcept = 0;
+
+ virtual std::shared_ptr<archive> load(const std::string&) const noexcept;
+ virtual std::shared_ptr<directory> list(const std::string&) const noexcept = 0;
+
+ std::vector<archiveloader*> loader;
+ };
+
+ std::shared_ptr<filesystem> createFilesystem(FILE_SYSTEM_TYPE);
+ }
+}
+
+#endif // __FILE_SYSTEM__
/src/sleek/io/filesystem.h
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/io/filewriter.h
===================================================================
--- src/sleek/io/filewriter.h (nonexistent)
+++ src/sleek/io/filewriter.h (revision 4)
@@ -0,0 +1,30 @@
+#ifndef __FILE_WRITER__
+#define __FILE_WRITER__
+
+#include <string>
+#include <memory>
+#include "../define.h"
+
+namespace sleek
+{
+ namespace io
+ {
+ class filewriter : public std::enable_shared_from_this<filewriter>
+ {
+ public:
+ inline std::shared_ptr<filewriter> getptr() noexcept
+ {
+ return shared_from_this();
+ }
+
+ virtual const std::string& filename() const noexcept = 0;
+
+ virtual void write(const void *, u32) noexcept = 0;
+ virtual void seek(u32, bool relative = false) noexcept = 0;
+
+ virtual u32 pos() noexcept = 0;
+ };
+ }
+}
+
+#endif // __FILE_WRITER__
/src/sleek/io/filewriter.h
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/io/std/directory.h
===================================================================
--- src/sleek/io/std/directory.h (nonexistent)
+++ src/sleek/io/std/directory.h (revision 4)
@@ -0,0 +1,70 @@
+#ifndef __STD_DIRECTORY__
+#define __STD_DIRECTORY__
+
+#include <vector>
+#include "../directory.h"
+
+namespace sleek
+{
+ namespace io
+ {
+ class std_directory : public directory
+ {
+ public:
+ std_directory(const std::string &filename) : dir(filename)
+ {
+ refresh();
+ }
+
+ ~std_directory()
+ {
+ }
+
+ virtual bool is_open() const noexcept
+ {
+ return open;
+ }
+
+ virtual const std::string& filename() const noexcept
+ {
+ return dir;
+ }
+
+ virtual s32 find(std::function<bool(const directory::entry&)> f) const noexcept
+ {
+ int i = 0;
+
+ for(auto e : file)
+ {
+ if(f(e))
+ return i;
+ ++i;
+ }
+
+ return -1;
+ }
+
+ virtual directory::entry operator[] (u32 i) const noexcept
+ {
+ return file[i];
+ }
+
+ virtual void refresh() noexcept
+ {
+ file.clear();
+ /**
+ * TODO:
+ * read folder
+ * fill @file
+ * set @open
+ */
+ }
+ private:
+ std::vector<directory::entry> file;
+ std::string dir;
+ bool open;
+ };
+ }
+}
+
+#endif // __DIRECTORY__
/src/sleek/io/std/directory.h
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/io/std/filereader.h
===================================================================
--- src/sleek/io/std/filereader.h (nonexistent)
+++ src/sleek/io/std/filereader.h (revision 4)
@@ -0,0 +1,64 @@
+#ifndef __STD_FILE_READER__
+#define __STD_FILE_READER__
+
+#include "../filereader.h"
+#include <fstream>
+
+namespace sleek
+{
+ namespace io
+ {
+ class std_filereader : public filereader
+ {
+ public:
+ std_filereader(const std::string &filename) : fn(filename)
+ {
+ stream.open(filename);
+ stream.seekg(0, stream.end);
+ length = pos();
+ seek(0);
+ }
+
+ ~std_filereader()
+ {
+ stream.close();
+ }
+
+ virtual bool is_open() const noexcept
+ {
+ return stream.is_open();
+ }
+
+ virtual const std::string& filename() const noexcept
+ {
+ return fn;
+ }
+
+ virtual void read(void *data, u32 size) noexcept
+ {
+ stream.read(static_cast<char*>(data), size);
+ }
+
+ virtual void seek(u32 pos, bool relative = false) noexcept
+ {
+ stream.seekg(pos, relative ? stream.cur : stream.beg);
+ }
+
+ virtual u32 pos() noexcept
+ {
+ return stream.tellg();
+ }
+
+ virtual u32 size() const noexcept
+ {
+ return length;
+ }
+ protected:
+ std::ifstream stream;
+ std::string fn;
+ int length;
+ };
+ }
+}
+
+#endif // __FILE_READER__
/src/sleek/io/std/filereader.h
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/io/std/filesystem.cpp
===================================================================
--- src/sleek/io/std/filesystem.cpp (nonexistent)
+++ src/sleek/io/std/filesystem.cpp (revision 4)
@@ -0,0 +1,87 @@
+#include "filesystem.h"
+
+#include "directory.h"
+#include "filereader.h"
+#include "filewriter.h"
+#include <unistd.h>
+
+namespace sleek
+{
+ namespace io
+ {
+ std_filesystem::std_filesystem() noexcept
+ {
+ char cCurrentPath[FILENAME_MAX];
+ getcwd(cCurrentPath, sizeof(cCurrentPath));
+ cwd = cCurrentPath;
+ }
+
+ std_filesystem::~std_filesystem() noexcept
+ {
+ }
+
+ void std_filesystem::cd(const std::string &path) noexcept
+ {
+ /*
+ * at this time only
+ * can be better in futur to build filename path
+ * of @read and @write function from the system pwd and internal class pwd
+ * and allow programm to have multiple instance of filesystem
+ */
+ /**
+ * TODO
+ */
+ cwd = path;
+ }
+
+ const std::string& std_filesystem::pwd() const noexcept
+ {
+ return cwd;
+ }
+
+ std::shared_ptr<filereader> std_filesystem::read(const std::string &filename) const noexcept
+ {
+ auto e = std::make_shared<std_filereader>(filename);
+
+ if(e->is_open())
+ return e;
+
+ return nullptr;
+ }
+
+ std::shared_ptr<filereader> std_filesystem::read(const std::string &filename, void *ptr) const noexcept
+ {
+ /**
+ * TODO: memory read file
+ */
+ return nullptr;
+ }
+
+ std::shared_ptr<filewriter> std_filesystem::write(const std::string &filename) const noexcept
+ {
+ auto e = std::make_shared<std_filewriter>(filename);
+
+ if(e->is_open())
+ return e;
+
+ return nullptr;
+ }
+ std::shared_ptr<filewriter> std_filesystem::write(const std::string &filename, void *ptr) const noexcept
+ {
+ /**
+ * TODO: memory write file
+ */
+ return nullptr;
+ }
+
+ std::shared_ptr<directory> std_filesystem::list(const std::string &filename) const noexcept
+ {
+ auto e = std::make_shared<std_directory>(filename);
+
+ if(e->is_open())
+ return e;
+
+ return nullptr;
+ }
+ }
+}
/src/sleek/io/std/filesystem.cpp
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/io/std/filesystem.h
===================================================================
--- src/sleek/io/std/filesystem.h (nonexistent)
+++ src/sleek/io/std/filesystem.h (revision 4)
@@ -0,0 +1,32 @@
+#ifndef __STD_FILE_SYSTEM__
+#define __STD_FILE_SYSTEM__
+
+#include "../filesystem.h"
+
+namespace sleek
+{
+ namespace io
+ {
+ class std_filesystem : public filesystem
+ {
+ public:
+ std_filesystem() noexcept;
+ virtual ~std_filesystem() noexcept;
+
+ virtual void cd(const std::string&) noexcept;
+ virtual const std::string& pwd() const noexcept;
+
+ virtual std::shared_ptr<filereader> read(const std::string&) const noexcept;
+ virtual std::shared_ptr<filereader> read(const std::string&, void *ptr) const noexcept;
+
+ virtual std::shared_ptr<filewriter> write(const std::string&) const noexcept;
+ virtual std::shared_ptr<filewriter> write(const std::string&, void *ptr) const noexcept;
+
+ virtual std::shared_ptr<directory> list(const std::string&) const noexcept;
+ private:
+ std::string cwd;
+ };
+ }
+}
+
+#endif // __FILE_SYSTEM__
/src/sleek/io/std/filesystem.h
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/io/std/filewriter.h
===================================================================
--- src/sleek/io/std/filewriter.h (nonexistent)
+++ src/sleek/io/std/filewriter.h (revision 4)
@@ -0,0 +1,55 @@
+#ifndef __STD_FILE_WRITER__
+#define __STD_FILE_WRITER__
+
+#include "../filewriter.h"
+#include <fstream>
+
+namespace sleek
+{
+ namespace io
+ {
+ class std_filewriter : public filewriter
+ {
+ public:
+ std_filewriter(const std::string &filename) : fn(filename)
+ {
+ stream.open(filename);
+ }
+
+ ~std_filewriter()
+ {
+ stream.close();
+ }
+
+ virtual bool is_open() const noexcept
+ {
+ return stream.is_open();
+ }
+
+ virtual const std::string& filename() const noexcept
+ {
+ return fn;
+ }
+
+ virtual void write(const void *data, u32 size) noexcept
+ {
+ stream.write(static_cast<const char*>(data), size);
+ }
+
+ virtual void seek(u32 pos, bool relative = false) noexcept
+ {
+ stream.seekp(pos, relative ? stream.cur : stream.beg);
+ }
+
+ virtual u32 pos() noexcept
+ {
+ return stream.tellp();
+ }
+ protected:
+ std::ofstream stream;
+ std::string fn;
+ };
+ }
+}
+
+#endif // __FILE_WRITER__
/src/sleek/io/std/filewriter.h
Property changes:
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: src/sleek/loader/mesh_3ds.cpp
===================================================================
--- src/sleek/loader/mesh_3ds.cpp (revision 3)
+++ src/sleek/loader/mesh_3ds.cpp (revision 4)
@@ -4,7 +4,7 @@
namespace sleek
{
- namespace driver
+ namespace loader
{
long filelenght(int f) noexcept
{
@@ -12,7 +12,7 @@
fstat(f, &buf);
return buf.st_size;
}
- std::shared_ptr<MeshBuffer> LoadMeshFrom3ds(std::string &file) noexcept
+ std::shared_ptr<driver::MeshBuffer> meshloader_3ds::read(std::string &file) noexcept
{
#ifdef mesh_loader_3ds
unsigned char lchar = 0;
@@ -23,7 +23,7 @@
if(!in){ printf("error: couldn't open \"%s\"!\n", file.c_str()); return 0; }
printf("Load mesh: \"%s\"\n", file.c_str());
- auto tmp = std::make_shared<MeshBuffer>();
+ auto tmp = std::make_shared<driver::MeshBuffer>();
while(ftell(in) < 200)
{
fread(&lchunk_id, 2, 1, in);
@@ -77,12 +77,12 @@
#endif
}
- bool WriteMeshTo3ds(MeshBuffer*,const std::string&) noexcept
+ bool meshloader_3ds::write(driver::MeshBuffer*,const std::string&) noexcept
{
return false;
}
- bool IsMeshFormat3ds(const std::string&) noexcept
+ bool meshloader_3ds::match(const std::string&) noexcept
{
return false;
}
/src/sleek/loader/mesh_3ds.h
1,13 → 1,20
#include <string>
#include <string>
#include "mesh_loader.h"
 
namespace sleek
{
namespace mesh
namespace loader
{
class MeshBuffer;
std::shared_ptr<MeshBuffer> LoadMeshFrom3ds(const std::string&) noexcept;
bool WriteMeshTo3ds(MeshBuffer*, const std::string&) noexcept;
bool IsMeshFormat3ds(const std::string&) noexcept;
class MeshBuffer;
class meshloader_3ds : public meshloader
{
public:
std::shared_ptr<MeshBuffer> read(const std::string&) const noexcept;
 
bool write(MeshBuffer*, const std::string&) const noexcept;
 
bool match(const std::string&) const noexcept;
};
}
}
 
/src/sleek/loader/mesh_txt.cpp
4,9 → 4,9
 
namespace sleek
{
namespace driver
namespace loader
{
std::shared_ptr<MeshBuffer> LoadMeshFromTxt(const std::string &file) noexcept
std::shared_ptr<driver::MeshBuffer> meshloader_txt::read(const std::string &file) const noexcept
{
#ifdef mesh_loader_txt
int nvert;
17,7 → 17,7
filein = fopen(file.c_str(), "rt");
if(!filein){ printf("error: couldn't open \"%s\"!\n", file.c_str()); return 0; }
 
auto tmp = std::make_shared<MeshBuffer>();
auto tmp = std::make_shared<driver::MeshBuffer>();
do { fgets(oneline, 255, filein); } while ((oneline[0] == '/') || (oneline[0] == '\n'));
if(std::string("Vertices:") != std::string(oneline).substr(0,9)) return 0;
printf("Load mesh: \"%s\"\n", file.c_str());
31,7 → 31,7
tmp->vertices[i].Pos = math::vector3df(rx,ry,rz);
tmp->vertices[i].Normal = glm::normalize(tmp->vertices[i].Pos);
 
index<3> in;
driver::index<3> in;
in.vertex[0] = i+0;
in.vertex[1] = i+1;
in.vertex[2] = i+2;
45,7 → 45,7
#endif
}
 
bool WriteMeshToTxt(MeshBuffer *m, const std::string &file) noexcept
bool meshloader_txt::write(driver::MeshBuffer *m, const std::string &file) const noexcept
{
#ifdef mesh_loader_txt
FILE *out = fopen(file.c_str(), "wb+");
60,7 → 60,7
#endif
}
 
bool IsMeshFormatTxt(const std::string &file) noexcept
bool meshloader_txt::match(const std::string &file) const noexcept
{
#ifdef mesh_loader_txt
FILE *filein;
/src/sleek/loader/mesh_txt.h
1,13 → 1,20
#include <string>
#include <string>
#include "mesh_loader.h"
 
namespace sleek
{
namespace mesh
namespace loader
{
class MeshBuffer;
std::shared_ptr<MeshBuffer> LoadMeshFromTxt(const std::string&) noexcept;
bool WriteMeshToTxt(MeshBuffer*,const std::string&) noexcept;
bool IsMeshFormatTxt(const std::string&) noexcept;
class MeshBuffer;
class meshloader_txt : public meshloader
{
public:
std::shared_ptr<MeshBuffer> read(const std::string&) const noexcept;
 
bool write(MeshBuffer*, const std::string&) const noexcept;
 
bool match(const std::string&) const noexcept;
};
}
}
 
/src/sleek/node/billboard/billboard.h
19,7 → 19,6
virtual void render() noexcept;
protected:
};
std::vector<driver::texture*> cut_texture_to_array(driver::texture*, const u32 width, const u32 height, const u32 lenght) noexcept;
}
}
}