Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3103 in orxonox.OLD for orxonox/branches/images


Ignore:
Timestamp:
Dec 5, 2004, 5:01:10 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/images: testing SDL_image. It rocks.

Location:
orxonox/branches/images
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/images/config.h.in

    r3086 r3103  
    3131/* Define to 1 if you have the <OpenGL/gl.h> header file. */
    3232#undef HAVE_OPENGL_GL_H
     33
     34/* Define to 1 if you have the <png.h> header file. */
     35#undef HAVE_PNG_H
    3336
    3437/* Define to 1 if you have the <SDL/SDL.h> header file. */
  • orxonox/branches/images/configure.ac

    r3098 r3103  
    151151        echo "SDL library not found."
    152152        echo "please install the SDL library, which can be found at http://www.libsdl.org"
     153        echo "------------------"
     154        exit -1
     155     fi   
     156
     157#checking for SDL_image-headers
     158  AC_CHECK_HEADERS(SDL/SDL_image.h ,,
     159      [AC_MSG_ERROR([cannot find SDL_image headers]) ])
     160  AC_CHECK_LIB([SDL_image], [main], FOUND_SDL_image=yes)
     161     if test "$FOUND_SDL_image" = "yes" ; then
     162       LIBS="$LIBS -lSDL_image"
     163     else
     164        echo "------------------"
     165        echo "SDL_image library not found."
     166        echo "please install the SDL_image library, which can be found at http://www.libsdl.org/projects/SDL_image/"
    153167        echo "------------------"
    154168        exit -1
  • orxonox/branches/images/importer/material.cc

    r3098 r3103  
    376376
    377377
    378 
     378#ifdef HAVE_SDL_SDL_IMAGE_H
     379bool Material::loadImage(char* imageName, GLuint* texture)
     380{
     381  SDL_Surface* map;
     382  Image* pImage = new Image;
     383  map=IMG_Load(imageName);
     384  if(!map)
     385    {
     386      printf("IMG_Load: %s\n", IMG_GetError());
     387    }
     388  pImage->height = map->h;
     389  pImage->width  = map->w;
     390  pImage->data   = (GLubyte*)map->pixels;
     391
     392  loadTexToGL (pImage, texture);
     393 
     394}
     395#else
    379396/**
    380397   \brief Makes the Programm ready to Read-in a texture-File
     
    10751092  return true;
    10761093}
     1094
     1095#endif /* HAVE_SDL_SDL_IMAGE_H */
  • orxonox/branches/images/importer/material.h

    r3098 r3103  
    1414#include <stdlib.h>
    1515#include <fstream>
     16
     17#if HAVE_CONFIG_H
     18#include <config.h>
     19#endif
     20
     21#ifdef HAVE_SDL_SDL_IMAGE_H
     22#include <SDL/SDL_image.h>
     23#endif
    1624
    1725// IMAGE LIBS //
     
    92100
    93101  bool loadImage(char* imageName, GLuint* texture);
     102#ifndef HAVE_SDL_SDL_IMAGE_H
    94103
    95104  bool loadBMP (char* bmpName, GLuint* texture);
     
    104113
    105114  bool loadPNG(const char* pngName, GLuint* texture);
     115#endif
    106116};
    107117#endif
Note: See TracChangeset for help on using the changeset viewer.