114 glDisable(GL_DEPTH_TEST);
115 glDisable(GL_LIGHTING);
116 glDisable(GL_CULL_FACE);
117 glDisable(GL_ALPHA_TEST);
122 glMatrixMode(GL_PROJECTION);
125 glMatrixMode(GL_MODELVIEW);
129 GLfloat tx1 = 0.0f, tx2 = 1.0f, ty1 = 0.0f, ty2 = 1.0f;
136 if (rfactor >= 1.0f) {
138 tdble tdx = (1.0f-1.0f/rfactor)/2.0f;
143 tdble tdy = (1.0f-rfactor)/2.0f;
148 glEnable(GL_TEXTURE_2D);
151 glTexCoord2f(tx1, ty1); glVertex3f(0.0, 0.0, 0.0);
152 glTexCoord2f(tx1, ty2); glVertex3f(0.0,
ScrH, 0.0);
153 glTexCoord2f(tx2, ty2); glVertex3f(
ScrW,
ScrH, 0.0);
154 glTexCoord2f(tx2, ty1); glVertex3f(
ScrW, 0.0, 0.0);
156 glDisable(GL_TEXTURE_2D);
160 glMatrixMode(GL_PROJECTION);
162 gluOrtho2D(0, 640, 0, 480);
164 static float grWhite[4] = {1.0, 1.0, 1.0, 1.0};
202 const char *filename =
"data/img/splash.png";
203 const int BUFSIZE = 1024;
216 GfTrace(
"Couldn't read %s\n", filename);
222 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
223 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
224 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
s_imgWidth,
s_imgHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid *)(tex));
229 glutSpecialFunc((
void (*)(
int key,
int x,
int y))NULL);
static void splashMouse(int, int s, int, int)
int TorcsMainMenuRun(void)
void * GfParmReadFile(const char *file, int mode)
Read parameter set from file and return handle to parameter set.
#define GFPARM_RMODE_STD
if handle already openned return it
void GfParmReleaseHandle(void *parmHandle)
Release given parameter set handle parmHandle.
static void splashKey(unsigned char, int, int)
#define GFUI_FONT_SMALL_C
The Gaming Framework API (client part).
float tdble
Floating point type used in TORCS.
unsigned char * GfImgReadPng(const char *filename, int *widthp, int *heightp, float screen_gamma)
Load an image from disk to a buffer in RGBA mode.
void GfuiPrintString(const char *text, float *fgColor, int font, int x, int y, int align)
void GfScrGetSize(int *scrw, int *scrh, int *vieww, int *viewh)
Get the screen and viewport sizes.
static void splashTimer(int)
tdble GfParmGetNum(void *handle, const char *path, const char *key, const char *unit, tdble deflt)
Get a numerical parameter from the parameter set handle.
static int SplashDisplaying
static void splashDisplay(void)
#define GFPARM_RMODE_CREAT
Create the file if doesn't exist.