-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtexture_loader.h
54 lines (43 loc) · 1.17 KB
/
texture_loader.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
Copyright (C) 2016 Meritxell Jordana
Copyright (C) 2016 Marc Sanchez
*/
#ifndef __TEXTURE_LOADER_H
#define __TEXTURE_LOADER_H
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "jpeglib.h"
using namespace std;
enum Texture {
Water = 0,
Grass = 1,
Edge = 2
#ifdef ARDUINO
,WaterPurple = 3,
WaterBlue = 4,
WaterYellow = 5,
WaterOrange = 6,
WaterRed = 7
#endif
};
class TextureLoader {
static const char* const waterTextureFile;
static const char* const grassTextureFile;
static const char* const edgeTextureFile;
static const int textureDimension;
#ifdef ARDUINO
static const char* const waterPurpleTextureFile;
static const char* const waterBlueTextureFile;
static const char* const waterYellowTextureFile;
static const char* const waterOrangeTextureFile;
static const char* const waterRedTextureFile;
#endif
static void ReadJPEG(const char *filename, unsigned char **image, int *width,
int *height);
static void LoadTexture(const char *filename, int dim);
public:
static void LoadTextures();
};
#endif