Include and link physfs properly.
[tuxanci.git] / src / client / image.h
blob9f225c6c12a1f1be784659921b245f5e70d13e6c
1 #ifndef IMAGE_H
2 #define IMAGE_H
4 #include "main.h"
5 #include "interface.h"
7 #define IMAGE_NO_ALPHA 0
8 #define IMAGE_ALPHA 1
10 #define IMAGE_GROUP_BASE "base"
11 #define IMAGE_GROUP_EXTENDSIO "extension"
12 #define IMAGE_GROUP_USER "user"
13 #define IMAGE_GROUP_OTHER "other"
15 #ifdef SUPPORT_OPENGL
16 #include <SDL_opengl.h>
17 #endif
20 typedef struct image_struct {
21 char *name;
22 char *group;
23 SDL_Surface *image;
24 } image_data_t;
27 #ifndef SUPPORT_OPENGL
28 typedef struct image_struct {
29 int w;
30 int h;
31 SDL_Surface *image;
32 } image_t;
33 #else /* SUPPORT_OPENGL */
34 typedef struct image_struct {
35 int w; /* width of actual picture */
36 int h; /* height of actual picture */
37 SDL_Surface *image;
38 GLuint tw; /* width of allocated texture */
39 GLuint th; /* height of allocated texture */
40 GLuint tex_id; /* texture id */
41 } image_t;
42 #endif /* SUPPORT_OPENGL */
44 extern bool_t image_is_inicialized();
45 extern void image_init();
46 extern image_t *image_new(SDL_Surface *surface);
47 extern void image_destroy(image_t * p);
48 extern image_t *image_add(char *file, int alpha, char *name, char *group);
49 extern image_t *image_get(char *group, char *name);
50 extern void image_del(char *group, char *name);
51 extern void image_del_all_image_in_group(char *group);
52 extern void image_draw(image_t * p, int x, int y, int px, int py, int w, int h);
53 extern void image_quit();
55 #endif /* IMAGE_H */