torcs - 1.2.2

src/modules/graphic/ssggraph.sav/grutil.h

Go to the documentation of this file.
00001 /***************************************************************************
00002 
00003     file                 : grutil.h
00004     created              : Wed Nov  1 22:35:08 CET 2000
00005     copyright            : (C) 2000 by Eric Espie
00006     email                : torcs@free.fr
00007     version              : $Id: grutil.h,v 1.6 2003/06/24 21:02:26 torcs Exp $
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *   This program is free software; you can redistribute it and/or modify  *
00014  *   it under the terms of the GNU General Public License as published by  *
00015  *   the Free Software Foundation; either version 2 of the License, or     *
00016  *   (at your option) any later version.                                   *
00017  *                                                                         *
00018  ***************************************************************************/
00019  
00020 
00021 #ifndef _GRUTIL_H_
00022 #define _GRUTIL_H_
00023 
00024 #include <stdio.h>
00025 
00026 #if 1
00027 #define TRACE_GL(msg) { GLenum rc; if ((rc = glGetError()) != GL_NO_ERROR) printf("%s %s\n", msg, gluErrorString(rc)); }
00028 #else
00029 #define TRACE_GL(msg)
00030 #endif
00031 
00032 #ifdef DEBUG
00033 #define DBG_SET_NAME(base, name, index, subindex)               \
00034 {                                                               \
00035     char __buf__[256];                                          \
00036     if (subindex != -1) {                                       \
00037         sprintf(__buf__, "%s-%d-%d", name, index, subindex);    \
00038     } else {                                                    \
00039         sprintf(__buf__, "%s-%d", name, index);                 \
00040     }                                                           \
00041     (base)->setName((const char *)__buf__);                     \
00042 }
00043 #else
00044 #define DBG_SET_NAME(base, name, index, subindex)
00045 #endif
00046  
00047 
00048 /* Vars to set before calling grSsgLoadTexCb */
00049 extern float    grGammaValue;
00050 extern int      grMipMap;
00051 
00052 extern char *grFilePath;        /* Multiple path (: separated) used to search for files */
00053 extern char *grTexturePath;
00054 
00055 
00056 extern int grGetFilename(char *filename, char *filepath, char *buf);
00057 extern GLuint grLoadTexture(char *filename, char *filepath, float screen_gamma, int mipmap);
00058 ssgState * grSsgEnvTexState(char *img);
00059 extern ssgState *grSsgLoadTexState(char *img);
00060 extern ssgState *grSsgLoadTexStateEx(char *img, char *filepath, int wrap, int mipmap);
00061 extern int grPruneTree(ssgEntity *start, bool init);
00062 extern void grForceState(ssgEntity *start, ssgState *state);
00063 extern bool grLoadPngTexture (const char *fname, ssgTextureInfo* info);
00064 extern void grShutdownState(void);
00065 extern void grWriteTime(float *color, int font, int x, int y, tdble sec, int sgn);
00066 extern float grGetHOT(float x, float y);
00067 
00068 #endif /* _GRUTIL_H_ */ 
00069 
00070 
00071 

Generated at Thu Feb 26 21:52:29 2004 for torcs by doxygen 1.3.3 written by Dimitri van Heesch, © 1997-1999
TORCS © Eric Espié 1999, 2002.