Improved buttons. You can create new level-subsets via the leveleditor now. Better...
[supertux.git] / src / texture.h
1 //
2 // C Interface: texture
3 //
4 // Description: 
5 //
6 //
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2004
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12
13 #ifndef SUPERTUX_TEXTURE_H
14 #define SUPERTUX_TEXTURE_H
15
16 #include "SDL.h"
17 #ifndef NOOPENGL
18 #include "SDL_opengl.h"
19 #endif
20
21 /* Texture type */
22 typedef struct texture_type
23   {
24    SDL_Surface* sdl_surface;
25    GLuint gl_texture;
26    int w;
27    int h;
28   } texture_type;
29
30 void texture_setup(void);
31 extern void (*texture_load) (texture_type* ptexture, char * file, int use_alpha);  
32 extern void (*texture_load_part) (texture_type* ptexture, char * file, int x, int y, int w, int h, int use_alpha);
33 extern void (*texture_free) (texture_type* ptexture);  
34 extern void (*texture_draw) (texture_type* ptexture, float x, float y, int update);  
35 extern void (*texture_draw_bg) (texture_type* ptexture, int update);  
36 extern void (*texture_draw_part) (texture_type* ptexture, float sx, float sy, float x, float y, float w, float h, int update);
37 void texture_load_sdl(texture_type* ptexture, char * file, int use_alpha);
38 void texture_load_part_sdl(texture_type* ptexture, char * file, int x, int y, int w, int h, int use_alpha);
39 void texture_free_sdl(texture_type* ptexture);
40 void texture_draw_sdl(texture_type* ptexture, float x, float y, int update);
41 void texture_draw_bg_sdl(texture_type* ptexture, int update);
42 void texture_draw_part_sdl(texture_type* ptexture,float sx, float sy, float x, float y, float w, float h, int update);
43 void texture_from_sdl_surface(texture_type* ptexture, SDL_Surface * sdl_surf, int use_alpha);
44 #ifndef NOOPENGL
45 void texture_load_gl(texture_type* ptexture, char * file, int use_alpha);
46 void texture_load_part_gl(texture_type* ptexture, char * file, int x, int y, int w, int h, int use_alpha);
47 void texture_free_gl(texture_type* ptexture);
48 void texture_draw_gl(texture_type* ptexture, float x, float y, int update);
49 void texture_draw_bg_gl(texture_type* ptexture, int update);
50 void texture_draw_part_gl(texture_type* ptexture, float sx, float sy, float x, float y, float w, float h, int update);
51 void texture_create_gl(SDL_Surface * surf, GLuint * tex);
52 #endif
53
54 #endif /*SUPERTUX_TEXTURE_H*/
55