TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
optionmenu.cpp
Go to the documentation of this file.
1/***************************************************************************
2
3 file : optionmenu.cpp
4 created : Mon Apr 24 14:22:53 CEST 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#include <stdio.h>
20#include <tgfclient.h>
21#include "optionmenu.h"
22#include <graphconfig.h>
23#include <simuconfig.h>
24#include <soundconfig.h>
25#include <openglconfig.h>
26
27static void *optionHandle = NULL;
28
29void *
30TorcsOptionOptionInit(void *precMenu)
31{
32 if (optionHandle) return optionHandle;
33
35
36 GfuiScreenAddBgImg(optionHandle, "data/img/splash-options.png");
37
38 void *graphicMenu = GraphMenuInit(optionHandle);
40 "Graphic", "Configure graphic parameters",
41 [graphicMenu] { GfuiScreenActivate(graphicMenu); });
42
43 void *displayMenu = GfScrMenuInit(optionHandle);
45 "Display", "Configure display parameters",
46 [displayMenu] { GfuiScreenActivate(displayMenu); });
47
48/*
49 GfuiMenuButtonCreate(optionHandle,
50 "Simulation", "Configure simulation parameters",
51 SimuMenuInit(optionHandle), GfuiScreenActivate);
52*/
53
54 void *soundMenu = SoundMenuInit(optionHandle);
56 "Sound", "Configure sound parameters",
57 [soundMenu] { GfuiScreenActivate(soundMenu); });
58
59 void *openGLMenu = OpenGLMenuInit(optionHandle);
61 "OpenGL", "Configure OpenGL parameters",
62 [openGLMenu] { GfuiScreenActivate(openGLMenu); });
63
65 "Back",
66 "Back to Main",
67 [precMenu] { GfuiScreenActivate(precMenu); });
68
69 return optionHandle;
70}
void * GraphMenuInit(void *prevMenu)
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 GfuiScreenAddBgImg(void *scr, const char *filename)
Add an image background to a screen.
Definition gui.cpp:1058
void * GfuiMenuScreenCreate(const char *title)
Create a new menu screen.
Definition guimenu.cpp:77
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
void * GfScrMenuInit(void *precMenu)
Create and activate the video options menu screen.
Definition screen.cpp:836
void * OpenGLMenuInit(void *prevMenu)
void * TorcsOptionOptionInit(void *precMenu)
static void * optionHandle
void * SoundMenuInit(void *prevMenu)