From 77459ad09cbcc1004801f527ce82caa2cbdf6451 Mon Sep 17 00:00:00 2001 From: Dusan Durech Date: Sun, 9 Nov 2008 15:48:16 +0100 Subject: support openGL rendering with makro SUPPORT_OPENGL, uses code in opengl branch --- src/client/image.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/client/image.h') diff --git a/src/client/image.h b/src/client/image.h index 015c0d2..03e952d 100644 --- a/src/client/image.h +++ b/src/client/image.h @@ -3,7 +3,7 @@ # define IMAGE_H -//#include "image.h" +# include "main.h" # include "interface.h" # define IMAGE_NO_ALPHA 0 @@ -14,6 +14,10 @@ # define IMAGE_GROUP_USER "user" # define IMAGE_GROUP_OTHER "other" +#ifdef SUPPORT_OPENGL +#include +#endif + /* typedef struct image_struct { @@ -23,14 +27,29 @@ typedef struct image_struct } image_data_t; */ +#ifndef SUPPORT_OPENGL typedef struct image_struct { int w; int h; SDL_Surface *image; } image_t; +#endif + +#ifdef SUPPORT_OPENGL +typedef struct image_struct +{ + int w; // width of actual picture + int h; // height of actual picture + GLuint tw; // width of allocated texture + GLuint th; // height of allocated texture + GLuint tex_id; // texture id +} image_t; +#endif extern bool_t isImageInicialized(); extern void initImageData(); +extern image_t* newImage(SDL_Surface *surface); +extern void destroyImage(image_t * p); extern image_t *addImageData(char *file, int alpha, char *name, char *group); extern image_t *getImage(char *group, char *name); extern void delImage(char *group, char *name); -- cgit v1.2.3