-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTexture.h
More file actions
33 lines (27 loc) · 694 Bytes
/
Texture.h
File metadata and controls
33 lines (27 loc) · 694 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include "Utility.h"
enum TextureType
{
DIFFUSEMAP,
NORMALMAP
};
class Texture
{
public:
std::string name;
TextureType type;
unsigned char* buffer;
UINT width;
UINT height;
public:
Texture();
Texture(std::string name, UINT width, UINT height, TextureType type);
Texture(std::string name, UINT width, UINT height, unsigned char* data, TextureType type);
void SetDim(UINT width, UINT height);
void SetPixel(int x, int y, Color color);
float2 GetDim() { return float2((float)width, (float)height); }
Color GetPixel(int x, int y);
Color GetPixel(UINT i);
void Fill(unsigned char grayScaleColor);
void SetBuffer(UINT width, UINT height, unsigned char* buffer);
};