Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3185 in orxonox.OLD for orxonox/trunk/src/material.h


Ignore:
Timestamp:
Dec 15, 2004, 6:24:28 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/src: merged trunk/importer into trunk/src again.
All conflicts resolved in favor of trunk/src.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/material.h

    r2853 r3185  
    99extern int verbose; //!< will be obsolete soon.
    1010
    11 #include <GL/gl.h>
    12 #include <GL/glu.h>
    13 #include <stdlib.h>
    14 #include <fstream>
     11#include "stdincl.h"
     12
     13#if HAVE_CONFIG_H
     14#include <config.h>
     15#endif /* HAVE_CONFIG_H */
     16
     17#ifdef HAVE_SDL_SDL_IMAGE_H
     18#include <SDL/SDL_image.h>
     19#else
     20// IMAGE LIBS //
     21#ifdef HAVE_JPEGLIB_H
     22extern "C"{         // This has to be done, because not a c++ lib
     23#include <jpeglib.h>
     24}
     25#endif /* HAVE_JPEGLIB_H */
     26#ifdef HAVE_PNG_H
     27#include <png.h>
     28#endif /* HAVE_PNG_H */
     29#endif /* HAVE_SDL_SDL_IMAGE_H */
     30
     31class PathList
     32{
     33 public:
     34  PathList();
     35  PathList(char* pName);
     36
     37  ~PathList();
     38  void addPath (char* pName);
     39  char* pathName;
     40  PathList* next;
     41};
     42
    1543
    1644//! Class to handle Materials.
     
    2149  Material (char* mtlName);
    2250  Material* addMaterial(char* mtlName);
     51  ~Material ();
     52  void init(void);
    2353
    24   void init(void);
    25   ~Material ();
    26 
     54  Material* search (char* mtlName);
     55  bool select (void);
    2756
    2857  void setName (char* mtlName);
     
    4170  void setTransparency (char* trans);
    4271
    43   Material* search (char* mtlName);
    4472
    45   bool select (void);
    46 
    47   Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists.
     73 
     74  void addTexturePath(char* pathName);
     75  char* searchTextureInPaths(char* texName) const;
     76 // MAPPING //
     77  void setDiffuseMap(char* dMap);
     78  void setAmbientMap(char* aMap);
     79  void setSpecularMap(char* sMap);
     80  void setBump(char* bump);
    4881
    4982 private:
    50   char name [50];
     83  struct Image
     84  {
     85    int rowSpan;
     86    GLuint width;
     87    GLuint height;
     88    GLuint bpp;
     89    GLuint type;
     90    GLubyte *data;
     91  };
     92
     93
     94  char* name;
    5195  int illumModel;
    5296  float diffuse [4];
     
    56100  float transparency;
    57101
     102  static PathList* pathList;
     103 
     104  GLuint diffuseTexture;
     105  GLuint ambientTexture;
     106  GLuint specularTexture;
     107 
     108  bool diffuseTextureSet;
     109  bool ambientTextureSet;
     110  bool specularTextureSet;
     111
     112  Material* nextMat; //!< pointer to the Next Material of the List. NULL if no next exists.
     113
     114  // TEXTURING
     115  bool loadTexToGL (Image* pImage, GLuint* texture);
     116
     117  bool loadImage(char* imageName, GLuint* texture);
     118#ifndef HAVE_SDL_SDL_IMAGE_H
     119
     120  bool loadBMP (char* bmpName, GLuint* texture);
     121
     122  bool loadJPG (char* jpgName, GLuint* texture);
     123
     124  /// TGA ///
     125
     126  bool loadTGA(const char * tgaName, GLuint* texture);
     127  bool loadUncompressedTGA(const char * filename, FILE * fTGA, GLuint* texture);
     128  bool loadCompressedTGA(const char * filename, FILE * fTGA, GLuint* texture);
     129
     130  bool loadPNG(const char* pngName, GLuint* texture);
     131#endif
    58132};
    59133#endif
Note: See TracChangeset for help on using the changeset viewer.