TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
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 */
50extern float grGammaValue;
51extern int grMipMap;
52
53extern char *grFilePath; /* Multiple path (: separated) used to search for files */
54extern char *grTexturePath;
55
56extern int grGetFilename(const char *filename, char *filepath, char *buf, const int BUFSIZE);
57ssgState * grSsgEnvTexState(const char *img);
58extern ssgState *grSsgLoadTexState(const char *img);
59extern ssgState *grSsgLoadTexStateEx(const char *img, char *filepath, int wrap, int mipmap);
60extern bool grLoadPngTexture (const char *fname, ssgTextureInfo* info);
61extern void grShutdownState(void);
62extern void grWriteTime(float *color, int font, int x, int y, tdble sec, int sgn);
63extern float grGetHOT(float x, float y);
64
65void grRemoveState(char* img);
66
67#endif /* _GRUTIL_H_ */
68
69
70
int sgn(Scalar x)
Definition Basic.h:46
static Vector y[4]
Definition Convex.cpp:56
float tdble
Floating point type used in TORCS.
Definition tgf.h:47
float grGammaValue
Definition grutil.cpp:39
char * grTexturePath
Definition grutil.cpp:43
char * grFilePath
Definition grutil.cpp:42
int grMipMap
Definition grutil.cpp:40
float grGetHOT(float x, float y)
Definition grutil.cpp:354
void grShutdownState(void)
Definition grutil.cpp:182
ssgState * grSsgLoadTexState(const char *img)
Definition grutil.cpp:219
int grGetFilename(const char *filename, char *filepath, char *buf, const int BUFSIZE)
Definition grutil.cpp:46
void grWriteTime(float *color, int font, int x, int y, tdble sec, int sgn)
Definition grutil.cpp:317
bool grLoadPngTexture(const char *fname, ssgTextureInfo *info)
Definition grutil.cpp:91
ssgState * grSsgEnvTexState(const char *img)
Definition grutil.cpp:251
void grRemoveState(char *img)
Definition grutil.cpp:156
ssgState * grSsgLoadTexStateEx(const char *img, char *filepath, int wrap, int mipmap)
Definition grutil.cpp:284