DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
r_modules.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void R_Modules_DeviceLost (void)
 
void R_Modules_DeviceRestored (void)
 
void R_Modules_Init (void)
 
void R_Modules_NewMap (void)
 
void R_Modules_Restart_f (struct cmd_state_s *cmd)
 
void R_Modules_Shutdown (void)
 
void R_Modules_Start (void)
 
void R_RegisterModule (const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
 

Function Documentation

◆ R_Modules_DeviceLost()

void R_Modules_DeviceLost ( void )

Definition at line 107 of file r_modules.c.

108{
109 int i;
110 for (i = 0;i < MAXRENDERMODULES;i++)
111 {
112 if (rendermodule[i].name == NULL)
113 continue;
114 if (!rendermodule[i].active)
115 continue;
116 if (!rendermodule[i].devicelost)
117 continue;
119 }
120}
const GLchar * name
Definition glquake.h:601
int i
#define NULL
Definition qtypes.h:12
rendermodule_t rendermodule[MAXRENDERMODULES]
Definition r_modules.c:18
#define MAXRENDERMODULES
Definition r_modules.c:4
void(* devicelost)(void)
Definition r_modules.c:13

References rendermodule_t::devicelost, i, MAXRENDERMODULES, name, NULL, and rendermodule.

◆ R_Modules_DeviceRestored()

void R_Modules_DeviceRestored ( void )

Definition at line 123 of file r_modules.c.

124{
125 int i;
126 for (i = 0;i < MAXRENDERMODULES;i++)
127 {
128 if (rendermodule[i].name == NULL)
129 continue;
130 if (!rendermodule[i].active)
131 continue;
132 if (!rendermodule[i].devicerestored)
133 continue;
135 }
136}
void(* devicerestored)(void)
Definition r_modules.c:14

References rendermodule_t::devicerestored, i, MAXRENDERMODULES, name, NULL, and rendermodule.

◆ R_Modules_Init()

void R_Modules_Init ( void )

Definition at line 20 of file r_modules.c.

21{
22 Cmd_AddCommand(CF_CLIENT, "r_restart", R_Modules_Restart_f, "restarts renderer");
23}
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
Definition cmd.c:1661
#define CF_CLIENT
cvar/command that only the client can change/execute
Definition cmd.h:48
void R_Modules_Restart_f(cmd_state_t *cmd)
Definition r_modules.c:83

References CF_CLIENT, Cmd_AddCommand(), and R_Modules_Restart_f().

Referenced by CL_Init().

◆ R_Modules_NewMap()

void R_Modules_NewMap ( void )

Definition at line 92 of file r_modules.c.

93{
94 int i;
96 for (i = 0;i < MAXRENDERMODULES;i++)
97 {
98 if (rendermodule[i].name == NULL)
99 continue;
100 if (!rendermodule[i].active)
101 continue;
103 }
105}
void R_SkinFrame_PrepareForPurge(void)
Definition gl_rmain.c:2168
void R_SkinFrame_Purge(void)
Definition gl_rmain.c:2203
void(* newmap)(void)
Definition r_modules.c:12

References i, MAXRENDERMODULES, name, rendermodule_t::newmap, NULL, R_SkinFrame_PrepareForPurge(), R_SkinFrame_Purge(), and rendermodule.

Referenced by CL_SetupWorldModel().

◆ R_Modules_Restart_f()

void R_Modules_Restart_f ( struct cmd_state_s * cmd)

◆ R_Modules_Shutdown()

void R_Modules_Shutdown ( void )

Definition at line 67 of file r_modules.c.

68{
69 int i;
70 // shutdown in reverse
71 for (i = MAXRENDERMODULES - 1;i >= 0;i--)
72 {
73 if (rendermodule[i].name == NULL)
74 continue;
75 if (!rendermodule[i].active)
76 continue;
77 Con_DPrintf("Stopping render module \"%s\"\n", rendermodule[i].name);
80 }
81}
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
Definition console.c:1544
void(* shutdown)(void)
Definition r_modules.c:11

References rendermodule_t::active, Con_DPrintf(), i, MAXRENDERMODULES, name, NULL, rendermodule, and rendermodule_t::shutdown.

Referenced by CL_Shutdown(), R_Modules_Restart_f(), and VID_Restart_f().

◆ R_Modules_Start()

void R_Modules_Start ( void )

Definition at line 49 of file r_modules.c.

50{
51 int i;
52 for (i = 0;i < MAXRENDERMODULES;i++)
53 {
54 if (rendermodule[i].name == NULL)
55 continue;
56 if (rendermodule[i].active)
57 {
58 Con_Printf ("R_Modules_Start: module \"%s\" already active\n", rendermodule[i].name);
59 continue;
60 }
61 Con_DPrintf("Starting render module \"%s\"\n", rendermodule[i].name);
64 }
65}
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
Definition console.c:1514
void(* start)(void)
Definition r_modules.c:10

References rendermodule_t::active, Con_DPrintf(), Con_Printf(), i, MAXRENDERMODULES, name, NULL, rendermodule, and rendermodule_t::start.

Referenced by R_Modules_Restart_f(), VID_Restart_f(), and VID_Start().

◆ R_RegisterModule()

void R_RegisterModule ( const char * name,
void(* start )(void),
void(* shutdown )(void),
void(* newmap )(void),
void(* devicelost )(void),
void(* devicerestored )(void) )

Definition at line 25 of file r_modules.c.

26{
27 int i;
28 for (i = 0;i < MAXRENDERMODULES;i++)
29 {
30 if (rendermodule[i].name == NULL)
31 break;
32 if (!strcmp(name, rendermodule[i].name))
33 {
34 Con_Printf("R_RegisterModule: module \"%s\" registered twice\n", name);
35 return;
36 }
37 }
38 if (i >= MAXRENDERMODULES)
39 Sys_Error("R_RegisterModule: ran out of renderer module slots (%i)", MAXRENDERMODULES);
42 rendermodule[i].start = start;
43 rendermodule[i].shutdown = shutdown;
44 rendermodule[i].newmap = newmap;
45 rendermodule[i].devicelost = devicelost;
46 rendermodule[i].devicerestored = devicerestored;
47}
const char * name
Definition r_modules.c:9
void Sys_Error(const char *error,...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN
Causes the entire program to exit ASAP.
Definition sys_shared.c:724

References rendermodule_t::active, Con_Printf(), rendermodule_t::devicelost, rendermodule_t::devicerestored, i, MAXRENDERMODULES, name, rendermodule_t::name, rendermodule_t::newmap, NULL, rendermodule, rendermodule_t::shutdown, rendermodule_t::start, and Sys_Error().

Referenced by CL_MeshEntities_Init(), CL_Video_Init(), gl_backend_init(), GL_Draw_Init(), GL_Main_Init(), Mod_RenderInit(), Palette_Init(), R_Explosion_Init(), R_LightningBeams_Init(), R_Particles_Init(), R_Shadow_Init(), R_Sky_Init(), R_Textures_Init(), and Sbar_Init().