TORCS  1.3.9
The Open Racing Car Simulator
grutil.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  file : grutil.h
4  created : Wed Nov 1 22:35:08 CET 2000
5  copyright : (C) 2000 by Eric Espie
6  email : torcs@free.fr
7  version : $Id$
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 
20 
21 #ifndef _GRUTIL_H_
22 #define _GRUTIL_H_
23 
24 #include <stdio.h>
25 #include "grtexture.h"
26 
27 #if 1
28 #define TRACE_GL(msg) { GLenum rc; if ((rc = glGetError()) != GL_NO_ERROR) printf("%s %s\n", msg, gluErrorString(rc)); }
29 #else
30 #define TRACE_GL(msg)
31 #endif
32 
33 #ifdef DEBUG
34 #define DBG_SET_NAME(base, name, index, subindex) \
35 { \
36  char __buf__[256]; \
37  if (subindex != -1) { \
38  sprintf(__buf__, "%s-%d-%d", name, index, subindex); \
39  } else { \
40  sprintf(__buf__, "%s-%d", name, index); \
41  } \
42  (base)->setName((const char *)__buf__); \
43 }
44 #else
45 #define DBG_SET_NAME(base, name, index, subindex)
46 #endif
47 
48 
49 /* Vars to set before calling grSsgLoadTexCb */
50 extern float grGammaValue;
51 extern int grMipMap;
52 
53 extern char *grFilePath; /* Multiple path (: separated) used to search for files */
54 extern char *grTexturePath;
55 
56 extern int grGetFilename(const char *filename, char *filepath, char *buf, const int BUFSIZE);
57 ssgState * grSsgEnvTexState(const char *img);
58 extern ssgState *grSsgLoadTexState(const char *img);
59 extern ssgState *grSsgLoadTexStateEx(const char *img, char *filepath, int wrap, int mipmap);
60 extern bool grLoadPngTexture (const char *fname, ssgTextureInfo* info);
61 extern void grShutdownState(void);
62 extern void grWriteTime(float *color, int font, int x, int y, tdble sec, int sgn);
63 extern float grGetHOT(float x, float y);
64 
65 void grRemoveState(char* img);
66 
67 #endif /* _GRUTIL_H_ */
68 
69 
70 
void grWriteTime(float *color, int font, int x, int y, tdble sec, int sgn)
Definition: grutil.cpp:317
float grGammaValue
Definition: grutil.cpp:39
bool grLoadPngTexture(const char *fname, ssgTextureInfo *info)
Definition: grutil.cpp:91
float tdble
Floating point type used in TORCS.
Definition: tgf.h:48
ssgState * grSsgLoadTexStateEx(const char *img, char *filepath, int wrap, int mipmap)
Definition: grutil.cpp:284
void grRemoveState(char *img)
Definition: grutil.cpp:156
char * grFilePath
Definition: grutil.cpp:42
static Vector y[4]
Definition: Convex.cpp:56
int grMipMap
Definition: grutil.cpp:40
ssgState * grSsgEnvTexState(const char *img)
Definition: grutil.cpp:251
void grShutdownState(void)
Definition: grutil.cpp:182
int grGetFilename(const char *filename, char *filepath, char *buf, const int BUFSIZE)
Definition: grutil.cpp:46
int sgn(Scalar x)
Definition: Basic.h:46
ssgState * grSsgLoadTexState(const char *img)
Definition: grutil.cpp:219
float grGetHOT(float x, float y)
Definition: grutil.cpp:354
char * grTexturePath
Definition: grutil.cpp:43