summaryrefslogtreecommitdiff
path: root/src/client/image.h
diff options
context:
space:
mode:
authorDusan Durech <dusan.d@centrum.sk>2008-11-09 15:48:16 +0100
committerDusan Durech <dusan.d@centrum.sk>2008-11-09 15:48:16 +0100
commit77459ad09cbcc1004801f527ce82caa2cbdf6451 (patch)
tree2fa6efec9e66b813f552cf17111776ea71249bf9 /src/client/image.h
parent74693f80cd8188303b3e164f478988133aef4c84 (diff)
support openGL rendering with makro SUPPORT_OPENGL, uses code in opengl branch
Diffstat (limited to 'src/client/image.h')
-rw-r--r--src/client/image.h21
1 files changed, 20 insertions, 1 deletions
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 <SDL_opengl.h>
+#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);