#ifndef __gli_h__
#define __gli_h__

/* gli.h - OpenGL image (GLI) file loader */

/* Copyright NVIDIA Corporation, 1999. */

/* A lightweight generic image file loader for OpenGL programs. */

#include <stdio.h>
#if __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#include <GL/glext.h>
#endif

#ifdef  __cplusplus
extern "C" {
#endif

typedef struct {

  GLsizei  width;
  GLsizei  height;
  GLint    components;
  GLenum   type;
  GLenum   format;
  GLenum   internalFormat;

  GLsizei  cmapEntries;
  GLenum   cmapFormat;
  GLubyte *cmap;

  GLubyte *pixels;
  
} gliGenericImage;

extern gliGenericImage *gliReadTGA(FILE *fp, const char *name, int yFlip);
extern void gliFree(gliGenericImage *image);
extern gliGenericImage *gliScaleImage(gliGenericImage *image, int nw, int nh);
extern void gliConvertImageToCoreFormat(gliGenericImage *image);

#ifdef  __cplusplus
}
#endif

#endif /* __gli_h__ */
