2013-07-02 08:06:03 +02:00
|
|
|
#pragma once
|
2013-07-02 08:40:43 +02:00
|
|
|
#ifndef _TEXTURELOADER_HPP_
|
|
|
|
#define _TEXTURELOADER_HPP_
|
2013-07-02 08:06:03 +02:00
|
|
|
|
|
|
|
#define GLEW_STATIC
|
|
|
|
#include <GL/glew.h>
|
|
|
|
|
2013-12-20 15:03:32 +01:00
|
|
|
#include <loaders/rwbinarystream.h>
|
2013-07-02 08:06:03 +02:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <map>
|
|
|
|
|
2013-12-20 17:02:46 +01:00
|
|
|
class GameData;
|
2013-09-11 20:23:31 +02:00
|
|
|
|
2013-07-02 08:06:03 +02:00
|
|
|
class TextureLoader
|
|
|
|
{
|
|
|
|
public:
|
2013-12-20 17:02:46 +01:00
|
|
|
bool loadFromFile(std::string filename, GameData* gameData);
|
|
|
|
bool loadFromMemory(char *data, GameData* gameData);
|
2013-07-02 08:06:03 +02:00
|
|
|
};
|
2013-07-02 08:40:43 +02:00
|
|
|
|
2014-06-06 13:18:32 +02:00
|
|
|
#include <WorkContext.hpp>
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
// TODO: refactor this interface to be more like ModelLoader so they can be rolled into one.
|
|
|
|
class LoadTextureArchiveJob : public WorkJob
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
GameData* _gameData;
|
|
|
|
std::string _file;
|
|
|
|
char* _data;
|
|
|
|
public:
|
|
|
|
|
|
|
|
LoadTextureArchiveJob(WorkContext* context, GameData* gd, const std::string& file);
|
|
|
|
|
|
|
|
void work();
|
|
|
|
|
|
|
|
void complete();
|
|
|
|
};
|
|
|
|
|
2013-09-08 21:14:48 +02:00
|
|
|
#endif
|