增加材质和纹理
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
|
||||
#include "dvc_config.h"
|
||||
#include "dvc_pre_declare.h"
|
||||
#include "math/dvc_vector2.h"
|
||||
#include "math/dvc_vector4.h"
|
||||
|
||||
DV_CORE_BEGIN_NAMESPACE
|
||||
|
||||
class DV_CORE_API Image
|
||||
{
|
||||
public:
|
||||
int32_t getID(void) const { return m_id; }
|
||||
int32_t getWidth(void) const { return m_width; }
|
||||
int32_t getHeight(void) const { return m_height; }
|
||||
PixelFormat getPixelFormat(void) const { return m_pixelFormat; }
|
||||
DeviceBufferConstPtr getPixelBuffer(void) const { return m_pixelBuffer; }
|
||||
|
||||
fVector4 getPixel(int32_t u, int32_t v) const;
|
||||
|
||||
void clear();
|
||||
|
||||
bool initWithPixelData(Device& device, int32_t width, int32_t height,
|
||||
PixelFormat pixelFormat, const uint8_t* data, size_t dataSize);
|
||||
|
||||
protected:
|
||||
int32_t m_id;
|
||||
int32_t m_width;
|
||||
int32_t m_height;
|
||||
PixelFormat m_pixelFormat;
|
||||
size_t m_pixelByteSize;
|
||||
DeviceBufferPtr m_pixelBuffer;
|
||||
|
||||
public:
|
||||
Image(int32_t id);
|
||||
~Image();
|
||||
};
|
||||
|
||||
DV_CORE_END_NAMESPACE
|
||||
Reference in New Issue
Block a user