38 lines
630 B
C++
38 lines
630 B
C++
#pragma once
|
|
|
|
#include "dvc_config.h"
|
|
#include "dvc_pre_declare.h"
|
|
#include "math/dvc_vector2.h"
|
|
#include "math/dvc_vector4.h"
|
|
#include "math/dvc_matrix3.h"
|
|
|
|
DV_CORE_BEGIN_NAMESPACE
|
|
|
|
class DV_CORE_API Texture
|
|
{
|
|
public:
|
|
int32_t getID(void) const { return m_id; }
|
|
ImagePtr getImage(void) const { return m_image; }
|
|
|
|
void setImage(const ImagePtr& image) { m_image = image; }
|
|
|
|
fVector4 sample(const fVector2& uv) const;
|
|
|
|
private:
|
|
int32_t m_id;
|
|
ImagePtr m_image;
|
|
|
|
public:
|
|
Texture(int32_t id);
|
|
~Texture();
|
|
};
|
|
|
|
struct TextureInfo
|
|
{
|
|
TextureConstPtr texture;
|
|
int32_t texCoord = 0;
|
|
fMatrix3 uvTransform;
|
|
};
|
|
|
|
DV_CORE_END_NAMESPACE
|