本文整理汇总了C++中IN_Init函数的典型用法代码示例。如果您正苦于以下问题:C++ IN_Init函数的具体用法?C++ IN_Init怎么用?C++ IN_Init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IN_Init函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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?
}
开发者ID:Keldonas,项目名称:OpenJK,代码行数:27,代码来源:win_main.cpp
示例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 ();
}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:30,代码来源:dll_int.cpp
示例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;
}
开发者ID:3ddy,项目名称:Jedi-Academy,代码行数:12,代码来源:win_glimp_console.cpp
示例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();
}
开发者ID:zturtleman,项目名称:etlegacy,代码行数:65,代码来源:sdl_glimp.c
示例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();
}
开发者ID:LoudHoward,项目名称:Quake3,代码行数:8,代码来源:qnx_main.c
示例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( );
}
开发者ID:massivehaxxor,项目名称:tremfusion,代码行数:64,代码来源:sdl_glimp.c
示例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();
}
开发者ID:jonathangray,项目名称:rtcw-sp-openbsd,代码行数:56,代码来源:unix_main.c
示例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?
}
开发者ID:CairnTrenor,项目名称:OpenJK,代码行数:55,代码来源:win_main.cpp
示例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();
}
开发者ID:jite,项目名称:jquake,代码行数:12,代码来源:in_win.c
示例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");
}
开发者ID:CarlGammaSagan,项目名称:Quake-3-Android-Port-QIII4A,代码行数:47,代码来源:android_glimp.c
示例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();
}
开发者ID:valgusk,项目名称:yquake2,代码行数:41,代码来源:cl_main.c
示例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( );
}
开发者ID:AlienHoboken,项目名称:Tremulous-xserverx-tremded,代码行数:48,代码来源:sdl_glimp.c
示例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();
}
开发者ID:5Quintessential,项目名称:jedioutcast,代码行数:39,代码来源:unix_main.c
示例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;
}
开发者ID:LBoksha,项目名称:RTCW-SP-linux,代码行数:24,代码来源:sdl_glimp.c
示例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");
//.........这里部分代码省略.........
开发者ID:infernuslord,项目名称:uqe-quake,代码行数:101,代码来源:host.c
示例16: IN_Restart
void IN_Restart(void)
{
IN_Init();
}
开发者ID:CarlGammaSagan,项目名称:Quake-3-Android-Port-QIII4A,代码行数:4,代码来源:sys_android.c
示例17: WIN_Init
window_t WIN_Init( const windowDesc_t *windowDesc, glconfig_t *glConfig )
{
Cmd_AddCommand("modelist", R_ModeList_f);
Cmd_AddCommand("minimize", GLimp_Minimize);
r_sdlDriver = Cvar_Get( "r_sdlDriver", "", CVAR_ROM );
// Window cvars
r_fullscreen = Cvar_Get( "r_fullscreen", "0", CVAR_ARCHIVE|CVAR_LATCH );
r_noborder = Cvar_Get( "r_noborder", "0", CVAR_ARCHIVE|CVAR_LATCH );
r_centerWindow = Cvar_Get( "r_centerWindow", "0", CVAR_ARCHIVE|CVAR_LATCH );
r_customwidth = Cvar_Get( "r_customwidth", "1600", CVAR_ARCHIVE|CVAR_LATCH );
r_customheight = Cvar_Get( "r_customheight", "1024", CVAR_ARCHIVE|CVAR_LATCH );
r_swapInterval = Cvar_Get( "r_swapInterval", "0", CVAR_ARCHIVE );
r_stereo = Cvar_Get( "r_stereo", "0", CVAR_ARCHIVE|CVAR_LATCH );
r_mode = Cvar_Get( "r_mode", "4", CVAR_ARCHIVE|CVAR_LATCH );
r_displayRefresh = Cvar_Get( "r_displayRefresh", "0", CVAR_LATCH );
Cvar_CheckRange( r_displayRefresh, 0, 240, qtrue );
// Window render surface cvars
r_stencilbits = Cvar_Get( "r_stencilbits", "8", CVAR_ARCHIVE|CVAR_LATCH );
r_depthbits = Cvar_Get( "r_depthbits", "0", CVAR_ARCHIVE|CVAR_LATCH );
r_colorbits = Cvar_Get( "r_colorbits", "0", CVAR_ARCHIVE|CVAR_LATCH );
r_ignorehwgamma = Cvar_Get( "r_ignorehwgamma", "0", CVAR_ARCHIVE|CVAR_LATCH );
r_ext_multisample = Cvar_Get( "r_ext_multisample", "0", CVAR_ARCHIVE|CVAR_LATCH );
// Create the window and set up the context
if(!GLimp_StartDriverAndSetMode( glConfig, windowDesc, r_mode->integer,
(qboolean)r_fullscreen->integer, (qboolean)r_noborder->integer ))
{
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, windowDesc, R_MODE_FALLBACK, qfalse, qfalse ))
{
// Nothing worked, give up
Com_Error( ERR_FATAL, "GLimp_Init() - could not load OpenGL subsystem" );
}
}
}
glConfig->deviceSupportsGamma =
(qboolean)(!r_ignorehwgamma->integer && SDL_SetWindowBrightness( screen, 1.0f ) >= 0);
Cvar_Get( "r_availableModes", "", CVAR_ROM );
// This depends on SDL_INIT_VIDEO, hence having it here
IN_Init( screen );
// window_t is only really useful for Windows if the renderer wants to create a D3D context.
window_t window = {};
window.api = windowDesc->api;
#if defined(_WIN32)
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
if ( SDL_GetWindowWMInfo(screen, &info) )
{
switch(info.subsystem) {
case SDL_SYSWM_WINDOWS:
window.handle = info.info.win.window;
break;
default:
break;
}
}
#endif
return window;
}
开发者ID:BruceJohnJennerLawso,项目名称:OpenJK,代码行数:74,代码来源:sdl_window.cpp
示例18: Host_Init
bool
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)
return Sys_Error("Only %4.1f megs of memory reported, 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();
Chase_Init();
COM_Init();
Host_InitLocal();
if (!W_LoadWadFile("gfx.wad"))
return false;
Key_Init();
Con_Init();
M_Init();
PR_Init();
Mod_Init(R_ModelLoader());
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)
return Sys_Error("Couldn't load gfx/palette.lmp");
host_colormap = (byte*)COM_LoadHunkFile("gfx/colormap.lmp");
if (!host_colormap)
return Sys_Error("Couldn't load gfx/colormap.lmp");
if (coloredlights)
host_fullbrights = 256-host_colormap[16384]; // leilei - variable our fullbright counts if available
VID_Init(host_basepal);
Draw_Init();
SCR_Init();
R_Init();
S_Init();
CDAudio_Init();
BGM_Init();
Sbar_Init();
CL_Init();
IN_Init();
}
Hunk_AllocName(0, "-HOST_HUNKLEVEL-");
host_hunklevel = Hunk_LowMark();
host_initialized = true;
Sys_Printf("========Quake Initialized=========\n");
/* In case exec of quake.rc fails */
if (!setjmp(host_abort)) {
Cbuf_InsertText("exec quake.rc\n");
Cbuf_Execute();
}
return true;
}
开发者ID:libretro,项目名称:tyrquake,代码行数:85,代码来源:host.c
示例19: Sys_Init
//.........这里部分代码省略.........
}
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 );
//
// figure out our CPU
//
Cvar_Get( "sys_cpustring", "detect", 0 );
if ( !Q_stricmp( Cvar_VariableString( "sys_cpustring"), "detect" ) )
{
Com_Printf( "...detecting CPU, found " );
cpuid = Sys_GetProcessorId();
switch ( cpuid )
{
case CPUID_GENERIC:
Cvar_Set( "sys_cpustring", "generic" );
break;
case CPUID_INTEL_UNSUPPORTED:
Cvar_Set( "sys_cpustring", "x86 (pre-Pentium)" );
break;
case CPUID_INTEL_PENTIUM:
Cvar_Set( "sys_cpustring", "x86 (P5/PPro, non-MMX)" );
break;
case CPUID_INTEL_MMX:
Cvar_Set( "sys_cpustring", "x86 (P5/Pentium2, MMX)" );
break;
case CPUID_INTEL_KATMAI:
Cvar_Set( "sys_cpustring", "Intel Pentium III" );
break;
case CPUID_INTEL_WILLIAMETTE:
Cvar_Set( "sys_cpustring", "Intel Pentium IV" );
break;
case CPUID_AMD_3DNOW:
Cvar_Set( "sys_cpustring", "AMD w/ 3DNow!" );
break;
case CPUID_AXP:
Cvar_Set( "sys_cpustring", "Alpha AXP" );
break;
default:
Com_Error( ERR_FATAL, "Unknown cpu type %d\n", cpuid );
break;
}
}
else
{
Com_Printf( "...forcing CPU type to " );
if ( !Q_stricmp( Cvar_VariableString( "sys_cpustring" ), "generic" ) )
{
cpuid = CPUID_GENERIC;
}
else if ( !Q_stricmp( Cvar_VariableString( "sys_cpustring" ), "x87" ) )
{
cpuid = CPUID_INTEL_PENTIUM;
}
else if ( !Q_stricmp( Cvar_VariableString( "sys_cpustring" ), "mmx" ) )
{
cpuid = CPUID_INTEL_MMX;
}
else if ( !Q_stricmp( Cvar_VariableString( "sys_cpustring" ), "3dnow" ) )
{
cpuid = CPUID_AMD_3DNOW;
}
else if ( !Q_stricmp( Cvar_VariableString( "sys_cpustring" ), "PentiumIII" ) )
{
cpuid = CPUID_INTEL_KATMAI;
}
else if ( !Q_stricmp( Cvar_VariableString( "sys_cpustring" ), "PentiumIV" ) )
{
cpuid = CPUID_INTEL_WILLIAMETTE;
}
else if ( !Q_stricmp( Cvar_VariableString( "sys_cpustring" ), "axp" ) )
{
cpuid = CPUID_AXP;
}
else
{
Com_Printf( "WARNING: unknown sys_cpustring '%s'\n", Cvar_VariableString( "sys_cpustring" ) );
cpuid = CPUID_GENERIC;
}
}
Cvar_SetValue( "sys_cpuid", cpuid );
Com_Printf( "%s\n", Cvar_VariableString( "sys_cpustring" ) );
Cvar_Set( "username", Sys_GetCurrentUser() );
IN_Init(); // FIXME: not in dedicated?
}
开发者ID:Agustinlv,项目名称:BlueHarvest,代码行数:101,代码来源:win_main.cpp
示例20: IN_Restart
/*
===============
IN_Restart
===============
*/
void IN_Restart()
{
IN_ShutdownJoystick();
IN_Init( window );
}
开发者ID:ChunHungLiu,项目名称:Unvanquished,代码行数:10,代码来源:sdl_input.cpp
注:本文中的IN_Init函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论