summaryrefslogtreecommitdiff
path: root/src/core/texture.h
blob: 49fed4b3533c4f39b598d8eb3c949d2e741ad554 (plain)
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
#ifndef _SOFTSHADEROOM_TEXTURE_H_
#define _SOFTSHADEROOM_TEXTURE_H_

#include "vert.h"

typedef enum FilterMode {
	FILTERMODE_POINT, 
	FILTERMODE_BILINEAR,
	FILTERMODE_TRILINEAR,
} FilterMode;

typedef enum WrapMode{
	WRAPMODE_REPEAT,
	WRAPMODE_CLAMP,
} WrapMode;

typedef struct Texture{
	uint width, height;
	Color* pixels;
}Texture;

Texture* texture_loadfromfile(const char* path);

Color32 texture_sampling(Texture* tex, FilterMode filter_mode, WrapMode wrap_mode, float x, float y);

#endif