aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/graphics/texture.h
blob: f859554227451c4308adbbae8911cdf40517a1a4 (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
27
28
29
30
#ifndef MGL_TEXTURE_H
#define MGL_TEXTURE_H

#include <stdbool.h>

typedef struct mgl_texture mgl_texture;

typedef enum {
   MGL_TEXTURE_GRAY        = 1,
   MGL_TEXTURE_GRAY_ALPHA  = 2,
   MGL_TEXTURE_RGB         = 3,
   MGL_TEXTURE_RGB_ALPHA   = 4
} mgl_texture_format;

struct mgl_texture {
    unsigned int id;
    int width;
    int height;
    mgl_texture_format format;
};

typedef struct {
    bool compressed;
} mgl_texture_load_options;

/* |load_options| can be null, in which case default options are used */
int mgl_texture_load_from_file(mgl_texture *self, const char *filepath, mgl_texture_load_options *load_options);
void mgl_texture_unload(mgl_texture *self);

#endif /* MGL_TEXTURE_H */