]> git.mxchange.org Git - simgear.git/blobdiff - simgear/screen/texture.hxx
Comment out GLX code for MacOS and (hopefully) add some MacOS AGL compattible code...
[simgear.git] / simgear / screen / texture.hxx
index 4099010bd44c9b5ae8fdb4e3a2ceeb443384385c..00265336a8f7bb3a541738f3d6299ff7686131d4 100644 (file)
@@ -40,6 +40,7 @@ private:
 
 protected:
 
+    FILE *file;
     typedef struct _ImageRec {
         unsigned short imagic;
         unsigned short type;
@@ -49,9 +50,8 @@ protected:
         unsigned int wasteBytes;
         char name[80];
         unsigned long colorMap;
-        gzFile gzfile;
-        FILE *file;
-        GLubyte *tmp, *tmpR, *tmpG, *tmpB;
+        gzFile file;
+        GLubyte *tmp;
         unsigned long rleEnd;
         unsigned int *rowStart;
         int *rowSize;
@@ -99,9 +99,11 @@ public:
     inline GLuint id() { return texture_id; }
     inline GLubyte *texture() { return texture_data; }
     inline void set_data(GLubyte *data) { texture_data = data; }
+    // inline void set_colors(int c) { num_colors = c; }
 
     inline int width() { return texture_width; }
     inline int height() { return texture_height; }
+    inline int colors() { return num_colors; }
 
     // dynamic texture functions.
     // everything drawn to the OpenGL screen after prepare is
@@ -111,8 +113,8 @@ public:
     void finish(unsigned int width, unsigned int height);
 
     // texture pixel manipulation functions.
-    void set_pixel(GLuint x, GLuint y, sgVec3 &c);
-    float *get_pixel(GLuint x, GLuint y);
+    void set_pixel(GLuint x, GLuint y, GLubyte *c);
+    GLubyte *get_pixel(GLuint x, GLuint y);
 
     void bind();
     inline void select(bool keep_data = false) {
@@ -137,6 +139,13 @@ public:
 
     inline const char *err_str() { return errstr; }
     inline void clear_err_str() { errstr = ""; }
+
+    void make_maxcolorwindow();
+    void make_grayscale(float contrast = 1.0);
+    void make_monochrome(float contrast = 1.0,
+                         GLubyte r=255, GLubyte g=255, GLubyte b=255);
+    void make_normalmap(float brightness = 1.0, float contrast = 1.0);
+    void make_bumpmap(float brightness = 1.0, float contrast = 1.0);
 };
 
 #endif