TORCS  1.3.10
The Open Racing Car Simulator
Loading...
Searching...
No Matches
screen.cpp File Reference

Screen management. More...

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

Go to the source code of this file.

Functions

static int getMsaaIndex (int samples)
void gfScreenInit (void)
static void Reshape (int width, int height)
void GfScrInit (int argc, char *argv[])
void GfScrShutdown (void)
 Shutdown the screen.
void GfScrGetSize (int *scrw, int *scrh, int *vieww, int *viewh)
 Get the screen and viewport sizes.
static void saveParams (void)
void GfScrReinit (void *)
static void updateLabelText (void)
static void ResPrevNext (int delta)
static void DepthPrevNext (int delta)
static void ModePrevNext (int delta)
static void MsaaPrevNext (int delta)
static void VInitPrevNext (int delta)
static void initFromConf (void)
static void onActivate (void *)
void * GfScrMenuInit (void *precMenu)
 Create and activate the video options menu screen.
int GfuiGlutExtensionSupported (const char *str)
 Query an OpenGL extension through GLUT for the current rendering context.

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 char * MsaaLabel [] = {"Off", "2x", "4x", "8x"}
static const int MsaaSamples [] = {0, 2, 4, 8}
static const int DefaultMsaaSamples = 4
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 const int nbMsaa = sizeof(MsaaSamples) / sizeof(MsaaSamples[0])
static int curRes = 0
static int curMode = 0
static int curDepth = 0
static int curVInit = 0
static int curMsaa = 2
static int curMaxFreq = 75
static int ResLabelId
static int DepthLabelId
static int ModeLabelId
static int VInitLabelId
static int MsaaLabelId
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()

void DepthPrevNext ( int delta)
static

Definition at line 699 of file screen.cpp.

Here is the call graph for this function:

◆ getMsaaIndex()

int getMsaaIndex ( int samples)
static

Definition at line 135 of file screen.cpp.

◆ gfScreenInit()

void gfScreenInit ( void )

Definition at line 154 of file screen.cpp.

Here is the call graph for this function:

◆ GfScrInit()

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

Definition at line 284 of file screen.cpp.

Here is the call graph for this function:

◆ GfScrReinit()

void GfScrReinit ( void * )

Definition at line 571 of file screen.cpp.

Here is the call graph for this function:

◆ initFromConf()

void initFromConf ( void )
static

Definition at line 758 of file screen.cpp.

Here is the call graph for this function:

◆ ModePrevNext()

void ModePrevNext ( int delta)
static

Definition at line 713 of file screen.cpp.

Here is the call graph for this function:

◆ MsaaPrevNext()

void MsaaPrevNext ( int delta)
static

Definition at line 728 of file screen.cpp.

Here is the call graph for this function:

◆ onActivate()

void onActivate ( void * )
static

Definition at line 824 of file screen.cpp.

Here is the call graph for this function:

◆ Reshape()

void Reshape ( int width,
int height )
static

Definition at line 269 of file screen.cpp.

◆ ResPrevNext()

void ResPrevNext ( int delta)
static

Definition at line 685 of file screen.cpp.

Here is the call graph for this function:

◆ saveParams()

void saveParams ( void )
static

Definition at line 538 of file screen.cpp.

Here is the call graph for this function:

◆ updateLabelText()

void updateLabelText ( void )
static

Definition at line 668 of file screen.cpp.

Here is the call graph for this function:

◆ VInitPrevNext()

void VInitPrevNext ( int delta)
static

Definition at line 743 of file screen.cpp.

Here is the call graph for this function:

Variable Documentation

◆ curDepth

int curDepth = 0
static

Definition at line 117 of file screen.cpp.

◆ curMaxFreq

int curMaxFreq = 75
static

Definition at line 121 of file screen.cpp.

◆ curMode

int curMode = 0
static

Definition at line 116 of file screen.cpp.

◆ curMsaa

int curMsaa = 2
static

Definition at line 119 of file screen.cpp.

◆ curRes

int curRes = 0
static

Definition at line 115 of file screen.cpp.

◆ curVInit

int curVInit = 0
static

Definition at line 118 of file screen.cpp.

◆ DefaultMsaaSamples

const int DefaultMsaaSamples = 4
static

Definition at line 107 of file screen.cpp.

◆ DepthLabelId

int DepthLabelId
static

Definition at line 127 of file screen.cpp.

◆ Depthlist

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

Definition at line 104 of file screen.cpp.

◆ GfScrCenX

int GfScrCenX
static

Definition at line 59 of file screen.cpp.

◆ GfScrCenY

int GfScrCenY
static

Definition at line 60 of file screen.cpp.

◆ GfScrHeight

int GfScrHeight
static

Definition at line 56 of file screen.cpp.

◆ GfScrWidth

int GfScrWidth
static

Definition at line 55 of file screen.cpp.

◆ GfViewHeight

int GfViewHeight
static

Definition at line 58 of file screen.cpp.

◆ GfViewWidth

int GfViewWidth
static

Definition at line 57 of file screen.cpp.

◆ LabelColor

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

Definition at line 132 of file screen.cpp.

◆ Mode

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

Definition at line 102 of file screen.cpp.

◆ ModeLabelId

int ModeLabelId
static

Definition at line 128 of file screen.cpp.

◆ MsaaLabel

const char* MsaaLabel[] = {"Off", "2x", "4x", "8x"}
static

Definition at line 105 of file screen.cpp.

◆ MsaaLabelId

int MsaaLabelId
static

Definition at line 130 of file screen.cpp.

◆ MsaaSamples

const int MsaaSamples[] = {0, 2, 4, 8}
static

Definition at line 106 of file screen.cpp.

◆ nbDepth

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

Definition at line 112 of file screen.cpp.

◆ nbMode

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

Definition at line 110 of file screen.cpp.

◆ nbMsaa

const int nbMsaa = sizeof(MsaaSamples) / sizeof(MsaaSamples[0])
static

Definition at line 113 of file screen.cpp.

◆ nbRes

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

Definition at line 99 of file screen.cpp.

◆ nbVInit

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

Definition at line 111 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 73 of file screen.cpp.

◆ ResLabelId

int ResLabelId
static

Definition at line 126 of file screen.cpp.

◆ scrHandle

void* scrHandle = NULL
static

Definition at line 62 of file screen.cpp.

◆ usedFG

int usedFG = 0
static

Definition at line 66 of file screen.cpp.

◆ usedGM

int usedGM = 0
static

Definition at line 64 of file screen.cpp.

◆ VInit

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

Definition at line 103 of file screen.cpp.

◆ VInitLabelId

int VInitLabelId
static

Definition at line 129 of file screen.cpp.