本文整理汇总了C++中IN_Init函数的典型用法代码示例。如果您正苦于以下问题:C++ IN_Init函数的具体用法?C++ IN_Init怎么用?C++ IN_Init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IN_Init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Sys_Init
void Sys_Init( void ) {
// make sure the timer is high precision, otherwise
// NT gets 18ms resolution
timeBeginPeriod( 1 );
Cmd_AddCommand ("in_restart", Sys_In_Restart_f);
g_wv.osversion.dwOSVersionInfoSize = sizeof( g_wv.osversion );
if (!GetVersionEx (&g_wv.osversion))
Sys_Error ("Couldn't get OS info");
if (g_wv.osversion.dwMajorVersion < 4)
Sys_Error ("This game requires Windows version 4 or greater");
if (g_wv.osversion.dwPlatformId == VER_PLATFORM_WIN32s)
Sys_Error ("This game doesn't run on Win32s");
Cvar_Set( "arch", OS_STRING " " ARCH_STRING );
// save out a couple things in rom cvars for the renderer to access
Cvar_Get( "win_hinstance", va("%p", g_wv.hInstance), CVAR_ROM );
Cvar_Get( "win_wndproc", va("%p", MainWndProc), CVAR_ROM );
Cvar_Set( "username", Sys_GetCurrentUser() );
IN_Init(); // FIXME: not in dedicated?
}
示例2: HUD_Init
void HUD_Init( void )
{
g_engfuncs.pfnAddCommand ("noclip", NULL, "enable or disable no clipping mode" );
g_engfuncs.pfnAddCommand ("notarget", NULL, "notarget mode (monsters do not see you)" );
g_engfuncs.pfnAddCommand ("fullupdate", NULL, "re-init HUD on start demo recording" );
g_engfuncs.pfnAddCommand ("give", NULL, "give specified item or weapon" );
g_engfuncs.pfnAddCommand ("drop", NULL, "drop current/specified item or weapon" );
g_engfuncs.pfnAddCommand ("intermission", NULL, "go to intermission" );
g_engfuncs.pfnAddCommand ("spectate", NULL, "enable spectator mode" );
g_engfuncs.pfnAddCommand ("gametitle", NULL, "show game logo" );
g_engfuncs.pfnAddCommand ("god", NULL, "classic cheat" );
g_engfuncs.pfnAddCommand ("fov", NULL, "set client field of view" );
g_engfuncs.pfnAddCommand ("fly", NULL, "fly mode (flight)" );
HUD_ShutdownEffects ();
g_pParticleSystems = new ParticleSystemManager();
g_pViewRenderBeams = new CViewRenderBeams();
g_pParticles = new CParticleSystem();
g_pTempEnts = new CTempEnts();
InitRain(); // init weather system
gHUD.Init();
IN_Init ();
// link all events
EV_HookEvents ();
}
示例3: GLW_CreateWindow
/*
** GLW_CreateWindow
**
** Responsible for creating the Alchemy window and initializing the OpenGL driver.
*/
static qboolean GLW_CreateWindow( int width, int height, int colorbits, qboolean cdsFullscreen )
{
GLW_Init(width, height, colorbits, cdsFullscreen);
IN_Init();
return qtrue;
}
示例4: GLimp_Init
/**
* @brief This routine is responsible for initializing the OS specific portions of OpenGL
* @param[in,out] glConfig
* @param[in] context
*/
void GLimp_Init(glconfig_t *glConfig, windowContext_t *context)
{
SDL_version compiled;
SDL_version linked;
SDL_VERSION(&compiled);
SDL_GetVersion(&linked);
Com_Printf("SDL build version %d.%d.%d - link version %d.%d.%d.\n", compiled.major, compiled.minor, compiled.patch, linked.major, linked.minor, linked.patch);
GLimp_InitCvars();
if (Cvar_VariableIntegerValue("com_abnormalExit"))
{
Cvar_Set("r_mode", va("%d", R_MODE_FALLBACK));
Cvar_Set("r_fullscreen", "0");
Cvar_Set("r_centerWindow", "0");
Cvar_Set("com_abnormalExit", "0");
}
Sys_GLimpInit();
// Create the window and set up the context
if (GLimp_StartDriverAndSetMode(glConfig, r_mode->integer, (qboolean) !!r_fullscreen->integer, (qboolean) !!r_noBorder->integer, context))
{
goto success;
}
// Try again, this time in a platform specific "safe mode"
Sys_GLimpSafeInit();
if (GLimp_StartDriverAndSetMode(glConfig, r_mode->integer, (qboolean) !!r_fullscreen->integer, qfalse, context))
{
goto success;
}
// Finally, try the default screen resolution
if (r_mode->integer != R_MODE_FALLBACK)
{
Com_Printf("Setting r_mode %d failed, falling back on r_mode %d\n", r_mode->integer, R_MODE_FALLBACK);
if (GLimp_StartDriverAndSetMode(glConfig, R_MODE_FALLBACK, qfalse, qfalse, context))
{
goto success;
}
}
// Nothing worked, give up
Com_Error(ERR_VID_FATAL, "GLimp_Init() - could not load OpenGL subsystem\n");
success:
// Only using SDL_SetWindowBrightness to determine if hardware gamma is supported
glConfig->deviceSupportsGamma = !r_ignorehwgamma->integer && SDL_SetWindowBrightness(main_window, 1.0f) >= 0;
re.InitOpenGL();
Cvar_Get("r_availableModes", "", CVAR_ROM);
// This depends on SDL_INIT_VIDEO, hence having it here
IN_Init();
}
示例5: Sys_Init
void Sys_Init (void) {
Cmd_AddCommand ("in_restart", Sys_In_Restart_f);
Cvar_Set( "arch", "rim" );
Cvar_Set( "username", Sys_GetCurrentUser() );
IN_Init();
}
示例6: GLimp_Init
/*
===============
GLimp_Init
This routine is responsible for initializing the OS specific portions
of OpenGL
===============
*/
void GLimp_Init( void )
{
r_allowSoftwareGL = ri.Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH );
r_sdlDriver = ri.Cvar_Get( "r_sdlDriver", "", CVAR_ROM );
//r_allowResize = ri.Cvar_Get( "r_allowResize", "0", CVAR_ARCHIVE );
Sys_GLimpInit( );
#ifdef SDL_VIDEO_DRIVER_X11
XInitThreads( );
#endif
// create the window and set up the context
if( GLimp_StartDriverAndSetMode( ) )
goto success;
// Try again, this time in a platform specific "safe mode"
Sys_GLimpSafeInit( );
if( GLimp_StartDriverAndSetMode( ) )
goto success;
// Finally, try the default screen resolution
//if( GLimp_StartDriverAndSetMode( qtrue, r_fullscreen->integer ) )
// goto success;
// Nothing worked, give up
ri.Error( ERR_FATAL, "GLimp_Init() - could not load OpenGL subsystem\n" );
success:
// This values force the UI to disable driver selection
glConfig.driverType = GLDRV_ICD;
glConfig.hardwareType = GLHW_GENERIC;
glConfig.deviceSupportsGamma = (SDL_SetWindowBrightness( window, 1.0f ) == 0)?1:0;//FIXME: Use SDL_SetWindowGammaRamp with NULL instead?
// Mysteriously, if you use an NVidia graphics card and multiple monitors,
// SDL_SetGamma will incorrectly return false... the first time; ask
// again and you get the correct answer. This is a suspected driver bug, see
// http://bugzilla.icculus.org/show_bug.cgi?id=4316
//glConfig.deviceSupportsGamma = SDL_SetGamma( 1.0f, 1.0f, 1.0f ) >= 0;
// get our config strings
Q_strncpyz( glConfig.vendor_string, (char *) qglGetString (GL_VENDOR), sizeof( glConfig.vendor_string ) );
Q_strncpyz( glConfig.renderer_string, (char *) qglGetString (GL_RENDERER), sizeof( glConfig.renderer_string ) );
if (*glConfig.renderer_string && glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] == '\n')
glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] = 0;
Q_strncpyz( glConfig.version_string, (char *) qglGetString (GL_VERSION), sizeof( glConfig.version_string ) );
Q_strncpyz( glConfig.extensions_string, (char *) qglGetString (GL_EXTENSIONS), sizeof( glConfig.extensions_string ) );
// initialize extensions
GLimp_InitExtensions( );
ri.Cvar_Get( "r_availableModes", "", CVAR_ROM );
// This depends on SDL_INIT_VIDEO, hence having it here
IN_Init( );
}
示例7: Sys_Init
void Sys_Init( void ) {
Cmd_AddCommand( "in_restart", Sys_In_Restart_f );
#if defined __linux__
#if defined __i386__
Cvar_Set( "arch", "linux i386" );
#elif defined __alpha__
Cvar_Set( "arch", "linux alpha" );
#elif defined __sparc__
Cvar_Set( "arch", "linux sparc" );
#elif defined __FreeBSD__
#if defined __i386__ // FreeBSD
Cvar_Set( "arch", "freebsd i386" );
#elif defined __alpha__
Cvar_Set( "arch", "freebsd alpha" );
#else
Cvar_Set( "arch", "freebsd unknown" );
#endif // FreeBSD
#elif defined __OpenBSD__
#if defined __i386__ // OpenBSD
Cvar_Set( "arch", "openbsd i386" );
#elif defined __amd64__
Cvar_Set( "arch", "openbsd amd64" );
#else
Cvar_Set( "arch", "openbsd unknown" );
#endif // OpenBSD
#else
Cvar_Set( "arch", "linux unknown" );
#endif
#elif defined __sun__
#if defined __i386__
Cvar_Set( "arch", "solaris x86" );
#elif defined __sparc__
Cvar_Set( "arch", "solaris sparc" );
#else
Cvar_Set( "arch", "solaris unknown" );
#endif
#elif defined __sgi__
#if defined __mips__
Cvar_Set( "arch", "sgi mips" );
#else
Cvar_Set( "arch", "sgi unknown" );
#endif
#else
Cvar_Set( "arch", "unknown" );
#endif
Cvar_Set( "username", Sys_GetCurrentUser() );
IN_Init();
}
示例8: Sys_Init
void Sys_Init( void ) {
// make sure the timer is high precision, otherwise
// NT gets 18ms resolution
timeBeginPeriod( 1 );
Cmd_AddCommand ("in_restart", Sys_In_Restart_f);
#if MEM_DEBUG
SH_Register();
#endif
g_wv.osversion.dwOSVersionInfoSize = sizeof( g_wv.osversion );
if (!GetVersionEx (&g_wv.osversion))
Sys_Error ("Couldn't get OS info");
if (Sys_IsExpired()) {
g_wv.osversion.dwMajorVersion = 0;
}
if (g_wv.osversion.dwMajorVersion < 4)
Sys_Error ("This game requires Windows version 4 or greater");
if (g_wv.osversion.dwPlatformId == VER_PLATFORM_WIN32s)
Sys_Error ("This game doesn't run on Win32s");
if ( g_wv.osversion.dwPlatformId == VER_PLATFORM_WIN32_NT )
{
Cvar_Set( "arch", "winnt" );
}
else if ( g_wv.osversion.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
{
if ( LOWORD( g_wv.osversion.dwBuildNumber ) >= WIN98_BUILD_NUMBER )
{
Cvar_Set( "arch", "win98" );
}
else if ( LOWORD( g_wv.osversion.dwBuildNumber ) >= OSR2_BUILD_NUMBER )
{
Cvar_Set( "arch", "win95 osr2.x" );
}
else
{
Cvar_Set( "arch", "win95" );
}
}
else
{
Cvar_Set( "arch", "unknown Windows variant" );
}
// save out a couple things in rom cvars for the renderer to access
Cvar_Get( "win_hinstance", va("%i", (int)g_wv.hInstance), CVAR_ROM );
Cvar_Get( "win_wndproc", va("%i", (int)MainWndProc), CVAR_ROM );
Cvar_Set( "username", Sys_GetCurrentUser() );
IN_Init(); // FIXME: not in dedicated?
}
示例9: IN_Restart_f
void IN_Restart_f(void)
{
if (!host_initialized)
{
// Sanity
Com_Printf("Can't do %s yet\n", Cmd_Argv(0));
return;
}
IN_Shutdown();
IN_Init();
}
示例10: GLimp_Init
void GLimp_Init(void)
{
ri.Printf(PRINT_ALL, "Initializing OpenGL subsystem\n");
bzero(&glConfig, sizeof(glConfig));
glConfig.isFullscreen = r_fullscreen->integer;
glConfig.vidWidth = screen_width;
glConfig.vidHeight = screen_height;
glConfig.windowAspect = (float)glConfig.vidWidth / glConfig.vidHeight;
// FIXME
glConfig.colorBits = 32;
glConfig.stencilBits = 8;
glConfig.depthBits = 16;
glConfig.textureCompression = TC_NONE;
// This values force the UI to disable driver selection
glConfig.driverType = GLDRV_ICD;
glConfig.hardwareType = GLHW_GENERIC;
Q_strncpyz(glConfig.vendor_string,
(const char *)qglGetString(GL_VENDOR),
sizeof(glConfig.vendor_string));
Q_strncpyz(glConfig.renderer_string,
(const char *)qglGetString(GL_RENDERER),
sizeof(glConfig.renderer_string));
const char *ptr = Q_stristr( glConfig.renderer_string, "Mali-" );
if (ptr != NULL)
malimode=1;
Q_strncpyz(glConfig.version_string,
(const char *)qglGetString(GL_VERSION),
sizeof(glConfig.version_string));
Q_strncpyz(glConfig.extensions_string,
(const char *)qglGetString(GL_EXTENSIONS),
sizeof(glConfig.extensions_string));
qglLockArraysEXT = qglLockArrays;
qglUnlockArraysEXT = qglUnlockArrays;
GLimp_InitExtensions();
IN_Init( );
ri.Printf(PRINT_ALL, "------------------\n");
}
示例11: CL_Init
void
CL_Init(void)
{
if (dedicated->value)
{
return; /* nothing running on the client */
}
/* all archived variables will now be loaded */
Con_Init();
S_Init();
SCR_Init();
VID_Init();
IN_Init();
V_Init();
net_message.data = net_message_buffer;
net_message.maxsize = sizeof(net_message_buffer);
M_Init();
cls.disable_screen = true; /* don't draw yet */
#ifdef CDA
CDAudio_Init();
#endif
CL_InitLocal();
FS_ExecAutoexec();
Cbuf_Execute();
Key_ReadConsoleHistory();
}
示例12: GLimp_Init
/*
===============
GLimp_Init
This routine is responsible for initializing the OS specific portions
of OpenGL
===============
*/
void GLimp_Init( void )
{
qboolean success = qtrue;
r_allowSoftwareGL = ri.Cvar_Get( "r_allowSoftwareGL", "0", CVAR_LATCH );
r_sdlDriver = ri.Cvar_Get( "r_sdlDriver", "", CVAR_ROM );
Sys_GLimpInit( );
// create the window and set up the context
if( !GLimp_StartDriverAndSetMode( qfalse, r_fullscreen->integer ) )
{
if( !GLimp_StartDriverAndSetMode( qtrue, r_fullscreen->integer ) )
success = qfalse;
}
if( !success )
ri.Error( ERR_FATAL, "GLimp_Init() - could not load OpenGL subsystem\n" );
// This values force the UI to disable driver selection
glConfig.driverType = GLDRV_ICD;
glConfig.hardwareType = GLHW_GENERIC;
glConfig.deviceSupportsGamma = !!( SDL_SetGamma( 1.0f, 1.0f, 1.0f ) >= 0 );
// get our config strings
Q_strncpyz( glConfig.vendor_string, (char *) qglGetString (GL_VENDOR), sizeof( glConfig.vendor_string ) );
Q_strncpyz( glConfig.renderer_string, (char *) qglGetString (GL_RENDERER), sizeof( glConfig.renderer_string ) );
if (*glConfig.renderer_string && glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] == '\n')
glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] = 0;
Q_strncpyz( glConfig.version_string, (char *) qglGetString (GL_VERSION), sizeof( glConfig.version_string ) );
Q_strncpyz( glConfig.extensions_string, (char *) qglGetString (GL_EXTENSIONS), sizeof( glConfig.extensions_string ) );
// initialize extensions
GLimp_InitExtensions( );
ri.Cvar_Get( "r_availableModes", "", CVAR_ROM );
// This depends on SDL_INIT_VIDEO, hence having it here
IN_Init( );
}
示例13: Sys_Init
void Sys_Init(void)
{
Cmd_AddCommand ("in_restart", Sys_In_Restart_f);
#if id386
Sys_SetFPCW();
#endif
#if defined __linux__
#if defined __i386__
Cvar_Set( "arch", "linux i386" );
#elif defined __alpha__
Cvar_Set( "arch", "linux alpha" );
#elif defined __sparc__
Cvar_Set( "arch", "linux sparc" );
#else
Cvar_Set( "arch", "linux unknown" );
#endif
#elif defined __sun__
#if defined __i386__
Cvar_Set( "arch", "solaris x86" );
#elif defined __sparc__
Cvar_Set( "arch", "solaris sparc" );
#else
Cvar_Set( "arch", "solaris unknown" );
#endif
#elif defined __sgi__
#if defined __mips__
Cvar_Set( "arch", "sgi mips" );
#else
Cvar_Set( "arch", "sgi unknown" );
#endif
#else
Cvar_Set( "arch", "unknown" );
#endif
IN_Init();
}
示例14: GLimp_Init
void GLimp_Init( void ) {
if (SDLvidscreen)
return;
if( !GLimp_StartDriverAndSetMode( r_mode->integer, r_fullscreen->integer , qfalse) )
ri.Error( ERR_FATAL, "GLimp_Init() - could not load OpenGL subsystem\n" );
// Hardware gamma is not supported in recent Linux/SDL.
glConfig.deviceSupportsGamma = qfalse;
Q_strncpyz(glConfig.vendor_string, (char *) qglGetString(GL_VENDOR), sizeof(glConfig.vendor_string));
Q_strncpyz(glConfig.renderer_string, (char *) qglGetString(GL_RENDERER), sizeof(glConfig.renderer_string));
if (*glConfig.renderer_string && glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] == '\n')
{
glConfig.renderer_string[strlen(glConfig.renderer_string) - 1] = 0;
}
Q_strncpyz(glConfig.version_string, (char *) qglGetString(GL_VERSION), sizeof(glConfig.version_string));
glConfig.extensions_string = (char *)qglGetString(GL_EXTENSIONS);
GLimp_InitExtensions();
glConfig.stereoEnabled = qfalse;
IN_Init();
return;
}
示例15: Host_Init
/*
====================
Host_Init
====================
*/
void Host_Init (quakeparms_t *parms)
{
if (standard_quake)
minimum_memory = MINIMUM_MEMORY;
else
minimum_memory = MINIMUM_MEMORY_LEVELPAK;
if (COM_CheckParm ("-minmemory"))
parms->memsize = minimum_memory;
host_parms = *parms;
if (parms->memsize < minimum_memory)
Sys_Error ("Only %4.1f megs of memory available, can't execute game", parms->memsize / (float)0x100000);
com_argc = parms->argc;
com_argv = parms->argv;
Memory_Init (parms->membase, parms->memsize);
Cbuf_Init ();
Cmd_Init ();
V_Init ();
// jkrige - removed chase
//Chase_Init ();
// jkrige - removed chase
Host_InitVCR (parms);
COM_Init (parms->basedir);
Host_InitLocal ();
W_LoadWadFile ("gfx.wad");
Key_Init ();
Con_Init ();
M_Init ();
PR_Init ();
Mod_Init ();
NET_Init ();
SV_Init ();
Con_Printf ("Exe: "__TIME__" "__DATE__"\n");
Con_Printf ("%4.1f megabyte heap\n",parms->memsize/ (1024*1024.0));
R_InitTextures (); // needed even for dedicated servers
if (cls.state != ca_dedicated)
{
host_basepal = (byte *)COM_LoadHunkFile ("gfx/palette.lmp");
if (!host_basepal)
Sys_Error ("Couldn't load gfx/palette.lmp");
host_colormap = (byte *)COM_LoadHunkFile ("gfx/colormap.lmp");
if (!host_colormap)
Sys_Error ("Couldn't load gfx/colormap.lmp");
#ifndef _WIN32 // on non win32, mouse comes before video for security reasons
IN_Init ();
#endif
VID_Init (host_basepal);
Draw_Init ();
SCR_Init ();
R_Init ();
#ifndef _WIN32
// on Win32, sound initialization has to come before video initialization, so we
// can put up a popup if the sound hardware is in use
S_Init ();
// jkrige - fmod sound system (system)
FMOD_Init();
// jkrige - fmod sound system (system)
#else
#ifdef GLQUAKE
// FIXME: doesn't use the new one-window approach yet
S_Init ();
// jkrige - fmod sound system (system)
FMOD_Init();
// jkrige - fmod sound system (system)
#endif
#endif // _WIN32
// jkrige - fmod sound system (music)
//CDAudio_Init ();
// jkrige - fmod sound system (music)
Sbar_Init ();
CL_Init ();
#ifdef _WIN32 // on non win32, mouse comes before video for security reasons
IN_Init ();
#endif
}
Cbuf_InsertText ("exec quake.rc\n");
//.........这里部分代码省略.........