TORCS  1.3.9
The Open Racing Car Simulator
screen.cpp File Reference

Screen management. More...

#include <stdio.h>
#include <GL/glut.h>
#include <math.h>
#include <unistd.h>
#include <tgfclient.h>
#include <portability.h>
#include <musicplayer/musicplayer.h>
#include "gui.h"
#include "fg_gm.h"
#include "glfeatures.h"
Include dependency graph for screen.cpp:

Go to the source code of this file.

Functions

void gfScreenInit (void)
 
static void Reshape (int width, int height)
 
void GfScrInit (int argc, char *argv[])
 
void GfScrShutdown (void)
 Shutdown the screen. More...
 
void GfScrGetSize (int *scrw, int *scrh, int *vieww, int *viewh)
 Get the screen and viewport sizes. More...
 
static void saveParams (void)
 
void GfScrReinit (void *)
 
static void updateLabelText (void)
 
static void ResPrevNext (void *vdelta)
 
static void DepthPrevNext (void *vdelta)
 
static void ModePrevNext (void *vdelta)
 
static void VInitPrevNext (void *vdelta)
 
static void initFromConf (void)
 
static void onActivate (void *)
 
void * GfScrMenuInit (void *precMenu)
 Create and activate the video options menu screen. More...
 
int GfuiGlutExtensionSupported (const char *str)
 

Variables

static int GfScrWidth
 
static int GfScrHeight
 
static int GfViewWidth
 
static int GfViewHeight
 
static int GfScrCenX
 
static int GfScrCenY
 
static void * scrHandle = NULL
 
static int usedGM = 0
 
static int usedFG = 0
 
static char * Res []
 
static const int nbRes = sizeof(Res) / sizeof(Res[0])
 
static const char * Mode [] = {"Full-screen mode", "Window mode"}
 
static const char * VInit [] = {GFSCR_VAL_VINIT_COMPATIBLE, GFSCR_VAL_VINIT_BEST}
 
static const char * Depthlist [] = {"24", "32", "16"}
 
static const int nbMode = sizeof(Mode) / sizeof(Mode[0])
 
static const int nbVInit = sizeof(VInit) / sizeof(VInit[0])
 
static const int nbDepth = sizeof(Depthlist) / sizeof(Depthlist[0])
 
static int curRes = 0
 
static int curMode = 0
 
static int curDepth = 0
 
static int curVInit = 0
 
static int curMaxFreq = 75
 
static int ResLabelId
 
static int DepthLabelId
 
static int ModeLabelId
 
static int VInitLabelId
 
static float LabelColor [] = {1.0, 0.0, 1.0, 1.0}
 

Detailed Description

Screen management.

Author
bernhard Wymann, Eric Espie

Definition in file screen.cpp.

Function Documentation

◆ DepthPrevNext()

static void DepthPrevNext ( void *  vdelta)
static

Definition at line 640 of file screen.cpp.

Here is the call graph for this function:

◆ gfScreenInit()

void gfScreenInit ( void  )

Definition at line 131 of file screen.cpp.

Here is the call graph for this function:

◆ GfScrInit()

void GfScrInit ( int  argc,
char *  argv[] 
)

Definition at line 261 of file screen.cpp.

Here is the call graph for this function:

◆ GfScrReinit()

void GfScrReinit ( void *  )

Definition at line 512 of file screen.cpp.

Here is the call graph for this function:

◆ GfuiGlutExtensionSupported()

int GfuiGlutExtensionSupported ( const char *  str)

Definition at line 944 of file screen.cpp.

◆ initFromConf()

static void initFromConf ( void  )
static

Definition at line 690 of file screen.cpp.

Here is the call graph for this function:

◆ ModePrevNext()

static void ModePrevNext ( void *  vdelta)
static

Definition at line 656 of file screen.cpp.

Here is the call graph for this function:

◆ onActivate()

static void onActivate ( void *  )
static

Definition at line 755 of file screen.cpp.

Here is the call graph for this function:

◆ Reshape()

static void Reshape ( int  width,
int  height 
)
static

Definition at line 246 of file screen.cpp.

◆ ResPrevNext()

static void ResPrevNext ( void *  vdelta)
static

Definition at line 625 of file screen.cpp.

Here is the call graph for this function:

◆ saveParams()

static void saveParams ( void  )
static

Definition at line 480 of file screen.cpp.

Here is the call graph for this function:

◆ updateLabelText()

static void updateLabelText ( void  )
static

Definition at line 609 of file screen.cpp.

Here is the call graph for this function:

◆ VInitPrevNext()

static void VInitPrevNext ( void *  vdelta)
static

Definition at line 673 of file screen.cpp.

Here is the call graph for this function:

Variable Documentation

◆ curDepth

int curDepth = 0
static

Definition at line 114 of file screen.cpp.

◆ curMaxFreq

int curMaxFreq = 75
static

Definition at line 117 of file screen.cpp.

◆ curMode

int curMode = 0
static

Definition at line 113 of file screen.cpp.

◆ curRes

int curRes = 0
static

Definition at line 112 of file screen.cpp.

◆ curVInit

int curVInit = 0
static

Definition at line 115 of file screen.cpp.

◆ DepthLabelId

int DepthLabelId
static

Definition at line 123 of file screen.cpp.

◆ Depthlist

const char* Depthlist[] = {"24", "32", "16"}
static

Definition at line 105 of file screen.cpp.

◆ GfScrCenX

int GfScrCenX
static

Definition at line 60 of file screen.cpp.

◆ GfScrCenY

int GfScrCenY
static

Definition at line 61 of file screen.cpp.

◆ GfScrHeight

int GfScrHeight
static

Definition at line 57 of file screen.cpp.

◆ GfScrWidth

int GfScrWidth
static

Definition at line 56 of file screen.cpp.

◆ GfViewHeight

int GfViewHeight
static

Definition at line 59 of file screen.cpp.

◆ GfViewWidth

int GfViewWidth
static

Definition at line 58 of file screen.cpp.

◆ LabelColor

float LabelColor[] = {1.0, 0.0, 1.0, 1.0}
static

Definition at line 127 of file screen.cpp.

◆ Mode

const char* Mode[] = {"Full-screen mode", "Window mode"}
static

Definition at line 103 of file screen.cpp.

◆ ModeLabelId

int ModeLabelId
static

Definition at line 124 of file screen.cpp.

◆ nbDepth

const int nbDepth = sizeof(Depthlist) / sizeof(Depthlist[0])
static

Definition at line 110 of file screen.cpp.

◆ nbMode

const int nbMode = sizeof(Mode) / sizeof(Mode[0])
static

Definition at line 108 of file screen.cpp.

◆ nbRes

const int nbRes = sizeof(Res) / sizeof(Res[0])
static

Definition at line 100 of file screen.cpp.

◆ nbVInit

const int nbVInit = sizeof(VInit) / sizeof(VInit[0])
static

Definition at line 109 of file screen.cpp.

◆ Res

char* Res[]
static
Initial value:
= {
"640x480",
"800x600",
"1024x768",
"1152x768",
"1152x864",
"1200x854",
"1200x960",
"1280x720",
"1280x1024",
"1400x900",
"1600x900",
"1600x1200",
"1680x1050",
"1920x1080",
"2560x1080",
"3840x1080",
"1920x1200",
"2560x1440",
"3440x1440",
"5120x1440",
"4096x2160",
"5040x2160",
"8192x2160",
"320x200"
}

Definition at line 74 of file screen.cpp.

◆ ResLabelId

int ResLabelId
static

Definition at line 122 of file screen.cpp.

◆ scrHandle

void* scrHandle = NULL
static

Definition at line 63 of file screen.cpp.

◆ usedFG

int usedFG = 0
static

Definition at line 67 of file screen.cpp.

◆ usedGM

int usedGM = 0
static

Definition at line 65 of file screen.cpp.

◆ VInit

const char* VInit[] = {GFSCR_VAL_VINIT_COMPATIBLE, GFSCR_VAL_VINIT_BEST}
static

Definition at line 104 of file screen.cpp.

◆ VInitLabelId

int VInitLabelId
static

Definition at line 125 of file screen.cpp.