TORCS  1.3.9
The Open Racing Car Simulator
mainmenu.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 
3  file : mainmenu.cpp
4  created : Sat Mar 18 23:42:38 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 #include <stdio.h>
22 #include <tgfclient.h>
23 #include <singleplayer.h>
24 #include <driverconfig.h>
25 
26 #include "mainmenu.h"
27 #include "exitmenu.h"
28 #include "optionmenu.h"
29 
30 
31 void *menuHandle = NULL;
33 
34 static void
35 TorcsMainMenuActivate(void * /* dummy */)
36 {
37  if (RacemanModLoaded != NULL) {
39  }
40 }
41 
42 /*
43  * Function
44  * TorcsMainMenuInit
45  *
46  * Description
47  * init the main menus
48  *
49  * Parameters
50  * none
51  *
52  * Return
53  * 0 ok -1 nok
54  *
55  * Remarks
56  *
57  */
58 int
60 {
61  menuHandle = GfuiScreenCreateEx((float*)NULL,
62  NULL, TorcsMainMenuActivate,
63  NULL, (tfuiCallback)NULL,
64  1);
65 
66  GfuiScreenAddBgImg(menuHandle, "data/img/splash-main.png");
67 
68  GfuiTitleCreate(menuHandle, "TORCS", 0);
69 
71  "The Open Racing Car Simulator",
73  320,
74  420,
76  0);
77 
79  "Race", "Races Menu",
81 
83  "Configure Players", "Players configuration menu",
85 
87  "Options", "Configure",
89 
91 
93  "Quit", "Quit TORCS",
95 
96  return 0;
97 }
98 
99 /*
100  * Function
101  *
102  *
103  * Description
104  *
105  *
106  * Parameters
107  *
108  *
109  * Return
110  *
111  *
112  * Remarks
113  *
114  */
115 int
117 {
119  return 0;
120 }
int GfuiMenuButtonCreate(void *scr, const char *text, const char *tip, void *userdata, tfuiCallback onpush)
Add a button to a menu screen.
Definition: guimenu.cpp:110
int GfuiLabelCreate(void *scr, const char *text, int font, int x, int y, int align, int maxlen)
Add a label to a screen.
Definition: guilabel.cpp:142
void GfuiScreenAddBgImg(void *scr, const char *filename)
Add an image background to a screen.
Definition: gui.cpp:961
The Gaming Framework API (client part).
#define GFUI_FONT_LARGE
Definition: tgfclient.h:168
void * GfuiScreenCreateEx(float *bgColor, void *userDataOnActivate, tfuiCallback onActivate, void *userDataOnDeactivate, tfuiCallback onDeactivate, int mouseAllowed)
Create a screen.
Definition: gui.cpp:578
void GfuiMenuDefaultKeysAdd(void *scr)
Add the default menu keyboard callback to a screen.
Definition: guimenu.cpp:55
int GfModUnloadList(tModList **modlist)
Unload the DLLs of a list.
Definition: module.cpp:91
void * TorcsDriverMenuInit(void *prevMenu)
void(* tfuiCallback)(void *)
Definition: tgfclient.h:105
void * ReSinglePlayerInit(void *precMenu)
void GfuiScreenActivate(void *screen)
Activate a screen and make it current.
Definition: gui.cpp:467
#define GFUI_ALIGN_HC_VB
Definition: tgfclient.h:72
void * TorcsOptionOptionInit(void *precMenu)
Definition: optionmenu.cpp:31
int GfuiTitleCreate(void *scr, const char *text, int maxlen)
Add a Title to the screen.
Definition: guilabel.cpp:170
void * TorcsMainExitMenuInit(void *mainMenu)
Definition: exitmenu.cpp:86
list of module interfaces
Definition: tgf.h:203
int GfuiMenuBackQuitButtonCreate(void *scr, const char *text, const char *tip, void *userdata, tfuiCallback onpush)
Add the "Back" or "Quit" button at the bottom of the menu screen.
Definition: guimenu.cpp:156