TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
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-2026 by Eric Espié, Bernhard Wymann
6 email : berniw@bluewin.ch
7
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19
20#include <stdio.h>
21#include <tgfclient.h>
22#include <singleplayer.h>
23#include <driverconfig.h>
24
25#include "mainmenu.h"
26#include "exitmenu.h"
27#include "optionmenu.h"
28
29
30void *menuHandle = NULL;
32
33static void
40
41/*
42 * Function
43 * TorcsMainMenuInit
44 *
45 * Description
46 * init the main menus
47 *
48 * Parameters
49 * none
50 *
51 * Return
52 * 0 ok -1 nok
53 *
54 * Remarks
55 *
56 */
57int
59{
63 1);
64
65 GfuiScreenAddBgImg(menuHandle, "data/img/splash-main.png");
66
67 GfuiTitleCreate(menuHandle, "TORCS", 0);
68
70 "The Open Racing Car Simulator",
72 320,
73 420,
75 0);
76
77 void *raceMenu = ReSinglePlayerInit(menuHandle);
79 "Race", "Races Menu",
80 [raceMenu] { GfuiScreenActivate(raceMenu); });
81
82 void *driverMenu = TorcsDriverMenuInit(menuHandle);
84 "Configure Players", "Players configuration menu",
85 [driverMenu] { GfuiScreenActivate(driverMenu); });
86
87 void *optionMenu = TorcsOptionOptionInit(menuHandle);
89 "Options", "Configure",
90 [optionMenu] { GfuiScreenActivate(optionMenu); });
91
93
95 "Quit", "Quit TORCS",
97
98 return 0;
99}
100
101/*
102 * Function
103 *
104 *
105 * Description
106 *
107 *
108 * Parameters
109 *
110 *
111 * Return
112 *
113 *
114 * Remarks
115 *
116 */
117int
119{
121 return 0;
122}
void * TorcsDriverMenuInit(void *prevMenu)
void * TorcsMainExitMenuInit(void *mainMenu)
Definition exitmenu.cpp:90
int GfuiMenuButtonCreateAction(void *scr, const char *text, const char *tip, const tGfuiAction &onpush)
Add a menu button with a focus tip.
Definition guimenu.cpp:165
void * GfuiScreenCreateExAction(float *bgColor, const tGfuiAction &onActivate, const tGfuiAction &onDeactivate, int mouseAllowed)
Create a screen.
Definition gui.cpp:619
void GfuiMenuDefaultKeysAdd(void *scr)
Add the default menu keyboard callback to a screen.
Definition guimenu.cpp:56
int GfuiTitleCreate(void *scr, const char *text, int maxlen)
Add a Title to the screen.
Definition guilabel.cpp:150
void GfuiScreenAddBgImg(void *scr, const char *filename)
Add an image background to a screen.
Definition gui.cpp:1058
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:121
int GfuiMenuBackQuitButtonCreateAction(void *scr, const char *text, const char *tip, const tGfuiAction &onpush)
Add the "Back" or "Quit" button at the bottom of the menu screen.
Definition guimenu.cpp:187
void GfuiScreenActivate(void *screen)
Activate a screen and make it current.
Definition gui.cpp:508
int GfModUnloadList(tModList **modlist)
Unload the DLLs of a list.
Definition module.cpp:91
int TorcsMainMenuRun(void)
Definition mainmenu.cpp:118
static void TorcsMainMenuActivate(void)
Definition mainmenu.cpp:34
tModList * RacemanModLoaded
Definition mainmenu.cpp:31
void * menuHandle
Definition mainmenu.cpp:30
int TorcsMainMenuInit(void)
Definition mainmenu.cpp:58
void * TorcsOptionOptionInit(void *precMenu)
void * ReSinglePlayerInit(void *precMenu)
struct ModList tModList
list of module interfaces
#define GFUI_FONT_LARGE
Definition tgfclient.h:248
std::function< void()> tGfuiAction
Definition tgfclient.h:107
#define GFUI_ALIGN_HC_VB
Definition tgfclient.h:74