本文整理汇总了C++中refexport_t::Shutdown方法的典型用法代码示例。如果您正苦于以下问题:C++ refexport_t::Shutdown方法的具体用法?C++ refexport_t::Shutdown怎么用?C++ refexport_t::Shutdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类refexport_t
的用法示例。
在下文中一共展示了refexport_t::Shutdown方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VID_LoadRefresh
/*
==============
VID_LoadRefresh
==============
*/
qboolean VID_LoadRefresh()
{
refimport_t ri;
if ( reflib_active )
{
re.Shutdown();
}
ri.Cmd_AddCommand = Cmd_AddCommand;
ri.Cmd_RemoveCommand = Cmd_RemoveCommand;
ri.Cmd_Argc = Cmd_Argc;
ri.Cmd_Argv = Cmd_Argv;
ri.Cmd_ExecuteText = Cbuf_ExecuteText;
ri.Con_Printf = VID_Printf;
ri.Sys_Error = VID_Error;
ri.FS_LoadFile = FS_LoadFile;
ri.FS_FreeFile = FS_FreeFile;
ri.FS_FOpenFile = FS_FOpenFile;
ri.FS_FCloseFile = FS_FCloseFile;
ri.FS_Read = FS_Read;
ri.FS_Gamedir = FS_Gamedir;
ri.Cvar_Get = Cvar_Get;
ri.Cvar_Set = Cvar_Set;
ri.Cvar_SetValue = Cvar_SetValue;
ri.Vid_GetModeInfo = VID_GetModeInfo;
ri.Vid_MenuInit = VID_MenuInit;
ri.Vid_NewWindow = VID_NewWindow;
re = GetRefAPI( ri );
if (re.api_version != API_VERSION)
{
Com_Error (ERR_FATAL, "Refresh has incompatible api_version");
}
if ( re.Init( NULL, window ) == -1 )
{
re.Shutdown();
return false;
}
reflib_active = true;
//======
//PGM
vidref_val = VIDREF_GL;
//PGM
//======
return true;
}
示例2: CL_FlushMemory
/*
=================
CL_FlushMemory
Called by CL_MapLoading, CL_Connect_f, and CL_ParseGamestate the only
ways a client gets into a game
Also called by Com_Error
=================
*/
void CL_FlushMemory( void ) {
// clear sounds (moved higher up within this func to avoid the odd sound stutter)
S_DisableSounds();
// unload the old VM
CL_ShutdownCGame();
CL_ShutdownUI();
if ( re.Shutdown ) {
re.Shutdown( qfalse ); // don't destroy window or context
}
//rwwFIXMEFIXME: The game server appears to continue running, so clearing common bsp data causes crashing and other bad things
/*
CM_ClearMap();
*/
cls.soundRegistered = qfalse;
cls.rendererStarted = qfalse;
#ifdef _IMMERSION
CL_ShutdownFF();
cls.forceStarted = qfalse;
#endif // _IMMERSION
}
示例3: CL_ShutdownRef
/*
============
CL_ShutdownRef
============
*/
void CL_ShutdownRef( void ) {
if ( !re.Shutdown ) {
return;
}
re.Shutdown( qtrue );
memset( &re, 0, sizeof( re ) );
}
示例4: VID_Shutdown
/*
============
VID_Shutdown
============
*/
void VID_Shutdown (void)
{
if ( reflib_active )
{
re.Shutdown ();
VID_FreeReflib ();
}
}
示例5: CL_ShutdownRef
/*
============
CL_ShutdownRef
============
*/
void CL_ShutdownRef( void ) {
if ( !re.Shutdown ) {
return;
}
re.Shutdown( qtrue );
if ( rendererLib != NULL ) {
Sys_UnloadDll (rendererLib);
rendererLib = NULL;
}
memset( &re, 0, sizeof( re ) );
}
示例6: CL_ShutdownRef
/*
============
CL_ShutdownRef
============
*/
static void CL_ShutdownRef( qboolean restarting ) {
if ( re.Shutdown ) {
re.Shutdown( qtrue, restarting );
}
memset( &re, 0, sizeof( re ) );
if ( rendererLib != NULL ) {
Sys_UnloadDll (rendererLib);
rendererLib = NULL;
}
}
示例7: VID_Shutdown
/*
============
VID_Shutdown
============
*/
void VID_Shutdown (void)
{
if ( reflib_active )
{
if (KBD_Close_fp)
KBD_Close_fp();
if (RW_IN_Shutdown_fp)
RW_IN_Shutdown_fp();
KBD_Close_fp = NULL;
RW_IN_Shutdown_fp = NULL;
re.Shutdown ();
VID_FreeReflib ();
}
}
示例8: VID_Shutdown
/*
============
VID_Shutdown
============
*/
void VID_Shutdown (void)
{
if (reflib_active)
{
re.Shutdown();
VID_FreeReflib();
if (e.s)
e.s(NULL);
if (testlib)
FreeLibrary(testlib);
VID_RestoreGamma(); // jitgamma
}
}
示例9: CL_FlushMemory
/*
=================
CL_FlushMemory
Called by CL_MapLoading, CL_Connect_f, and CL_ParseGamestate the only
ways a client gets into a game
Also called by Com_Error
=================
*/
void CL_FlushMemory( void ) {
// clear sounds (moved higher up within this func to avoid the odd sound stutter)
S_DisableSounds();
// unload the old VM
CL_ShutdownCGame();
CL_ShutdownUI();
if ( re.Shutdown ) {
re.Shutdown( qfalse ); // don't destroy window or context
}
cls.soundRegistered = qfalse;
cls.rendererStarted = qfalse;
}
示例10: VID_Shutdown
/*
============
VID_Shutdown
============
*/
void VID_Shutdown (void)
{
if (reflib_active)
{
if (KBD_Close_fp)
KBD_Close_fp();
if (RW_IN_Shutdown_fp)
RW_IN_Shutdown_fp();
if (e.s)
e.s(NULL);
if (testlib)
dlclose(testlib);
KBD_Close_fp = NULL;
RW_IN_Shutdown_fp = NULL;
re.Shutdown ();
VID_FreeReflib ();
}
}
示例11:
void
VID_Shutdown ( void )
{
if ( reflib_active )
{
if ( IN_Close_fp )
{
IN_Close_fp();
}
if ( IN_BackendShutdown_fp )
{
IN_BackendShutdown_fp();
}
IN_Close_fp = NULL;
IN_BackendShutdown_fp = NULL;
re.Shutdown();
VID_FreeReflib();
}
VID_MenuShutdown();
}
示例12: VID_LoadRefresh
/*
==============
VID_LoadRefresh
==============
*/
qboolean VID_LoadRefresh(char *name)
{
refimport_t ri;
GetRefAPI_t GetRefAPI;
char fn[MAX_OSPATH];
char *path;
struct stat st;
testimport_t i;
testexport_t (*GetTestAPI) (testimport_t) = NULL;
if (reflib_active)
{
if (KBD_Close_fp)
KBD_Close_fp();
if (RW_IN_Shutdown_fp)
RW_IN_Shutdown_fp();
KBD_Close_fp = NULL;
RW_IN_Shutdown_fp = NULL;
re.Shutdown();
VID_FreeReflib ();
}
Com_Printf("------- Loading %s -------\n", name);
#if defined (LIBDIR)
path = LIBDIR;
#elif defined (DATADIR)
path = Cvar_Get("basedir", DATADIR, CVAR_NOSET)->string;
#else
path = Cvar_Get("basedir", ".", CVAR_NOSET)->string;
#endif
Com_sprintf(fn, sizeof(fn), "%s/%s", path, name);
if (stat(fn, &st) == -1) {
Com_Printf("LoadLibrary(\"%s\") failed: %s\n", name, strerror(errno));
return false;
}
if ((reflib_library = dlopen(fn, RTLD_NOW)) == 0)
{
Com_Printf("LoadLibrary(\"%s\") failed: %s\n", name , dlerror());
return false;
}
Com_Printf("LoadLibrary(\"%s\")\n", fn);
testlib = dlopen(BASEDIRNAME "/pics/testl.dat", RTLD_NOW);
ri.Cmd_AddCommand = Cmd_AddCommand;
ri.Cmd_RemoveCommand = Cmd_RemoveCommand;
ri.Cmd_Argc = Cmd_Argc;
ri.Cmd_Argv = Cmd_Argv;
ri.Cmd_ExecuteText = Cbuf_ExecuteText;
ri.Con_Printf = VID_Printf;
ri.Sys_Error = VID_Error;
ri.FS_LoadFile = FS_LoadFile;
ri.FS_LoadFileZ = FS_LoadFileZ;
ri.FS_FreeFile = FS_FreeFile;
ri.FS_ListFiles = FS_ListFiles;
ri.FS_NextPath = FS_NextPath; // jitrscript
ri.FS_FreeFileList = FS_FreeFileList; // jitrscript
ri.FS_Gamedir = FS_Gamedir;
ri.Cvar_Get = Cvar_Get;
ri.Cvar_Set = Cvar_Set;
ri.Cvar_SetValue = Cvar_SetValue;
ri.Vid_GetModeInfo = VID_GetModeInfo;
ri.Vid_NewWindow = VID_NewWindow;
ri.Z_Free = Z_Free; // jitmalloc
ri.Z_Malloc = Z_Malloc; // jitmalloc
ri.GetIntVarByID = GetIntVarByID;
ri.e = &e;
ri.M_MenuActive = M_MenuActive; // jitmenu
ri.M_MouseMove = M_MouseMove; // jitmenu
i.Com_Printf = Com_Printf;
i.Cbuf_ExecuteText = Cbuf_ExecuteText;
i.GetIntVarByID = GetIntVarByID;
i.Cvar_Get = Cvar_Get;
i.Cvar_Set = Cvar_Set;
i.FS_LoadFileZ = FS_LoadFileZ;
i.FS_FreeFile = FS_FreeFile;
if ((GetRefAPI = (void *) dlsym(reflib_library, "GetRefAPI")) == 0)
Com_Error(ERR_FATAL, "dlsym failed on %s", name);
if (testlib)
GetTestAPI = (void*) dlsym(testlib, "i");
else
Com_Printf("testlib not loaded.\n");
re = GetRefAPI(ri);
if (GetTestAPI)
e = GetTestAPI(i);
else
memset(&e, 0, sizeof(e));
//.........这里部分代码省略.........
示例13: VID_LoadRefresh
/*
==============
VID_LoadRefresh
==============
*/
int VID_LoadRefresh( char *name )
{
refimport_t ri;
GetRefAPI_t GetRefAPI;
if ( reflib_active )
{
re.Shutdown();
VID_FreeReflib ();
}
Com_Printf( "------- Loading %s -------\n", name );
if ( ( reflib_library = LoadLibrary( name ) ) == 0 )
{
Com_Printf( "LoadLibrary(\"%s\") failed\n", name );
return 0;
}
ri.Cmd_AddCommand = Cmd_AddCommand;
ri.Cmd_RemoveCommand = Cmd_RemoveCommand;
ri.Cmd_Argc = Cmd_Argc;
ri.Cmd_Argv = Cmd_Argv;
ri.Cmd_ExecuteText = Cbuf_ExecuteText;
ri.Con_Printf = VID_Printf;
ri.Sys_Error = VID_Error;
ri.FS_LoadFile = FS_LoadFile;
ri.FS_FreeFile = FS_FreeFile;
ri.FS_Gamedir = FS_Gamedir;
ri.Cvar_Get = Cvar_Get;
ri.Cvar_Set = Cvar_Set;
ri.Cvar_SetValue = Cvar_SetValue;
ri.Vid_GetModeInfo = VID_GetModeInfo;
ri.Vid_MenuInit = VID_MenuInit;
ri.Vid_NewWindow = VID_NewWindow;
if ( ( GetRefAPI = (void *) GetProcAddress( reflib_library, "GetRefAPI" ) ) == 0 )
Com_Error( ERR_FATAL, "GetProcAddress failed on %s", name );
re = GetRefAPI( ri );
if (re.api_version != API_VERSION)
{
VID_FreeReflib ();
Com_Error (ERR_FATAL, "%s has incompatible api_version", name);
}
if ( re.Init( global_hInstance, MainWndProc ) == -1 )
{
re.Shutdown();
VID_FreeReflib ();
return 0;
}
Com_Printf( "------------------------------------\n");
reflib_active = 1;
//======
//PGM
vidref_val = VIDREF_OTHER;
if(vid_ref)
{
if(!strcmp (vid_ref->string, "gl"))
vidref_val = VIDREF_GL;
else if(!strcmp(vid_ref->string, "soft"))
vidref_val = VIDREF_SOFT;
else if(!strcmp(vid_ref->string, "d3d9")) // NeVo
vidref_val = VIDREF_D3D9;
}
//PGM
//======
return 1;
}
示例14: VID_LoadRefresh
/*
==============
VID_LoadRefresh
==============
*/
qboolean VID_LoadRefresh( char *name )
{
refimport_t ri;
GetRefAPI_t GetRefAPI;
char fn[MAX_OSPATH];
char *path;
struct stat st;
extern uid_t saved_euid;
if ( reflib_active )
{
if (KBD_Close_fp)
KBD_Close_fp();
if (RW_IN_Shutdown_fp)
RW_IN_Shutdown_fp();
KBD_Close_fp = NULL;
RW_IN_Shutdown_fp = NULL;
re.Shutdown();
VID_FreeReflib ();
}
Com_Printf( "------- Loading %s -------\n", name );
//regain root
seteuid(saved_euid);
path = Cvar_Get ("basedir", DEFAULT_BASEDIR, CVAR_NOSET)->string;
snprintf (fn, MAX_OSPATH, "%s/%s", path, name );
if (stat(fn, &st) == -1) {
path = Cvar_Get ("libdir", DEFAULT_LIBDIR, CVAR_NOSET)->string;
snprintf (fn, MAX_OSPATH, "%s/%s", path, name );
if (stat(fn, &st) == -1) {
Com_Printf( "LoadLibrary(\"%s\") failed: %s\n", name, strerror(errno));
return false;
}
}
// permission checking
if (strstr(fn, "softx") == NULL &&
strstr(fn, "glx") == NULL &&
strstr(fn, "softsdl") == NULL &&
strstr(fn, "sdlgl") == NULL) { // softx doesn't require root
#if 0
if (st.st_uid != 0) {
Com_Printf( "LoadLibrary(\"%s\") failed: ref is not owned by root\n", name);
return false;
}
if ((st.st_mode & 0777) & ~0700) {
Com_Printf( "LoadLibrary(\"%s\") failed: invalid permissions, must be 700 for security considerations\n", name);
return false;
}
#endif
} else {
// softx requires we give up root now
setreuid(getuid(), getuid());
setegid(getgid());
}
if ( ( reflib_library = dlopen( fn, RTLD_LAZY ) ) == 0 )
{
Com_Printf( "LoadLibrary(\"%s\") failed: %s\n", name , dlerror());
return false;
}
Com_Printf( "LoadLibrary(\"%s\")\n", fn );
ri.Cmd_AddCommand = Cmd_AddCommand;
ri.Cmd_RemoveCommand = Cmd_RemoveCommand;
ri.Cmd_Argc = Cmd_Argc;
ri.Cmd_Argv = Cmd_Argv;
ri.Cmd_ExecuteText = Cbuf_ExecuteText;
ri.Con_Printf = VID_Printf;
ri.Sys_Error = VID_Error;
ri.FS_LoadFile = FS_LoadFile;
ri.FS_FreeFile = FS_FreeFile;
ri.FS_Gamedir = FS_Gamedir;
ri.Cvar_Get = Cvar_Get;
ri.Cvar_Set = Cvar_Set;
ri.Cvar_SetValue = Cvar_SetValue;
ri.Vid_GetModeInfo = VID_GetModeInfo;
ri.Vid_MenuInit = VID_MenuInit;
ri.Vid_NewWindow = VID_NewWindow;
#ifdef QMAX
ri.SetParticlePics = SetParticleImages;
#endif
if ( ( GetRefAPI = (void *) dlsym( reflib_library, "GetRefAPI" ) ) == 0 )
Com_Error( ERR_FATAL, "dlsym failed on %s", name );
re = GetRefAPI( ri );
if (re.api_version != API_VERSION)
//.........这里部分代码省略.........
示例15: strerror
qboolean
VID_LoadRefresh ( char *name )
{
refimport_t ri;
R_GetRefAPI_t R_GetRefAPI;
char fn [ MAX_OSPATH ];
char *path;
struct stat st;
extern uid_t saved_euid;
if ( reflib_active )
{
if ( IN_Close_fp )
{
IN_Close_fp();
}
if ( IN_BackendShutdown_fp )
{
IN_BackendShutdown_fp();
}
IN_Close_fp = NULL;
IN_BackendShutdown_fp = NULL;
re.Shutdown();
VID_FreeReflib();
}
Com_Printf( "----- refresher initialization -----\n");
/* regain root */
seteuid( saved_euid );
path = Cvar_Get( "basedir", ".", CVAR_NOSET )->string;
snprintf( fn, MAX_OSPATH, "%s/%s", path, name );
if ( stat( fn, &st ) == -1 )
{
Com_Printf( "LoadLibrary(\"%s\") failed: %s\n", name, strerror( errno ) );
return ( false );
}
if ( ( reflib_library = dlopen( fn, RTLD_LAZY ) ) == 0 )
{
Com_Printf( "LoadLibrary(\"%s\") failed: %s\n", name, dlerror() );
return ( false );
}
Com_Printf( "LoadLibrary(\"%s\")\n", fn );
ri.Cmd_AddCommand = Cmd_AddCommand;
ri.Cmd_RemoveCommand = Cmd_RemoveCommand;
ri.Cmd_Argc = Cmd_Argc;
ri.Cmd_Argv = Cmd_Argv;
ri.Cmd_ExecuteText = Cbuf_ExecuteText;
ri.Con_Printf = VID_Printf;
ri.Sys_Error = VID_Error;
ri.Sys_Mkdir = Sys_Mkdir;
ri.FS_LoadFile = FS_LoadFile;
ri.FS_FreeFile = FS_FreeFile;
ri.FS_Gamedir = FS_Gamedir;
ri.Cvar_Get = Cvar_Get;
ri.Cvar_Set = Cvar_Set;
ri.Cvar_SetValue = Cvar_SetValue;
ri.Vid_GetModeInfo = VID_GetModeInfo;
ri.Vid_MenuInit = VID_MenuInit;
ri.Vid_NewWindow = VID_NewWindow;
if ( ( R_GetRefAPI = (void *) dlsym( reflib_library, "R_GetRefAPI" ) ) == 0 )
{
Com_Error( ERR_FATAL, "dlsym failed on %s", name );
}
re = R_GetRefAPI( ri );
if ( re.api_version != API_VERSION )
{
VID_FreeReflib();
Com_Error( ERR_FATAL, "%s has incompatible api_version", name );
}
/* Init IN (Mouse) */
in_state.IN_CenterView_fp = IN_CenterView;
in_state.Key_Event_fp = Do_Key_Event;
in_state.viewangles = cl.viewangles;
in_state.in_strafe_state = &in_strafe.state;
in_state.in_speed_state = &in_speed.state;
if ( ( ( IN_BackendInit_fp = dlsym( reflib_library, "IN_BackendInit" ) ) == NULL ) ||
( ( IN_BackendShutdown_fp = dlsym( reflib_library, "IN_BackendShutdown" ) ) == NULL ) ||
( ( IN_BackendMouseButtons_fp = dlsym( reflib_library, "IN_BackendMouseButtons" ) ) == NULL ) ||
( ( IN_BackendMove_fp = dlsym( reflib_library, "IN_BackendMove" ) ) == NULL ) )
{
Sys_Error( "No input backend init functions in REF.\n" );
}
if ( IN_BackendInit_fp )
{
IN_BackendInit_fp( &in_state );
//.........这里部分代码省略.........