当前位置: 首页>>代码示例>>C++>>正文


C++ R_Init函数代码示例

本文整理汇总了C++中R_Init函数的典型用法代码示例。如果您正苦于以下问题:C++ R_Init函数的具体用法?C++ R_Init怎么用?C++ R_Init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了R_Init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: VID_Init

/**
 * @sa R_Shutdown
 */
void VID_Init (void)
{
	vid_stretch = Cvar_Get("vid_stretch", "0", CVAR_ARCHIVE | CVAR_R_CONTEXT, "Backward compatibility to stretch the screen with a 4:3 ratio");
	vid_fullscreen = Cvar_Get("vid_fullscreen", "1", CVAR_ARCHIVE | CVAR_R_CONTEXT, "Run the game in fullscreen mode");
	vid_mode = Cvar_Get("vid_mode", "-1", CVAR_ARCHIVE | CVAR_R_CONTEXT, "The video mode - set to -1 and use vid_width and vid_height to use a custom resolution");
	Cvar_SetCheckFunction("vid_mode", CL_CvarCheckVidMode);
	vid_grabmouse = Cvar_Get("vid_grabmouse", "0", CVAR_ARCHIVE, "Grab the mouse in the game window - open the console to switch back to your desktop via Alt+Tab");
	vid_gamma = Cvar_Get("vid_gamma", "1", CVAR_ARCHIVE, "Controls the gamma settings");
	vid_ignoregamma = Cvar_Get("vid_ignoregamma", "0", CVAR_ARCHIVE, "Don't control the gamma settings if set to 1");
	Cvar_SetCheckFunction("vid_gamma", CL_CvarCheckVidGamma);
	vid_height = Cvar_Get("vid_height", "-1", CVAR_ARCHIVE, "Custom video height - set vid_mode to -1 to use this");
	vid_width = Cvar_Get("vid_width", "-1", CVAR_ARCHIVE, "Custom video width - set vid_mode to -1 to use this");

	Cmd_AddCommand("vid_restart", VID_Restart_f, "Restart the renderer - or change the resolution");
	Cmd_AddCommand("vid_minimize", VID_Minimize, "Minimize the game window");

	/* memory pools */
	vid_genericPool = Mem_CreatePool("Vid: Generic");
	vid_imagePool = Mem_CreatePool("Vid: Image system");
	vid_lightPool = Mem_CreatePool("Vid: Light system");
	vid_modelPool = Mem_CreatePool("Vid: Model system");

	/* Start the graphics mode */
	R_Init();
}
开发者ID:Ed-von-Schleck,项目名称:ufoai,代码行数:28,代码来源:cl_video.cpp

示例2: D_DoomMain

void D_DoomMain(void)
{
    I_Printf("I_Init\n");
    I_Init();
    I_Printf("Z_Init\n");
    Z_Init();
    I_Printf("W_Init\n");
    W_Init();
    I_Printf("R_Init\n");
    R_Init();
    I_Printf("P_Init\n");
    P_Init();
    I_Printf("ST_Init\n");
    ST_Init();
    I_Printf("S_Init\n");
    S_Init();

    gameaction = ga_nothing;
    gamestate = GS_NONE;
    gametic = 0;
    startskill = sk_medium;
    gameskill = sk_medium;
    startmap = 1;
    ticdup = 1;
    offsetms = 0;
    playeringame[0] = true;

    D_DebugParams();
    D_SplashScreen();
    D_DoomLoop();
}
开发者ID:svkaiser,项目名称:doom64DS,代码行数:31,代码来源:d_main.c

示例3: RE_BeginRegistration

/*
** RE_BeginRegistration
*/
void RE_BeginRegistration(glconfig_t *glconfigOut)
{
	R_Init();

	*glconfigOut = glConfig;

	R_SyncRenderThread();

	tr.visIndex = 0;
	memset(tr.visClusters, -2, sizeof(tr.visClusters)); // force markleafs to regenerate

	R_ClearFlares();

	RE_ClearScene();

	// HACK: give world entity white color for "colored" shader keyword
	tr.worldEntity.e.shaderRGBA[0] = 255;
	tr.worldEntity.e.shaderRGBA[1] = 255;
	tr.worldEntity.e.shaderRGBA[2] = 255;
	tr.worldEntity.e.shaderRGBA[3] = 255;

	tr.worldEntity.e.nonNormalizedAxes = qfalse;

	// RB: world will be never ignored by occusion query test
	tr.worldEntity.occlusionQuerySamples = 1;

	tr.registered = qtrue;

	// NOTE: this sucks, for some reason the first stretch pic is never drawn
	// without this we'd see a white flash on a level load because the very
	// first time the level shot would not be drawn
	RE_StretchPic(0, 0, 0, 0, 0, 0, 1, 1, 0);
}
开发者ID:scenna,项目名称:etlegacy,代码行数:36,代码来源:tr_model.c

示例4: CL_Init

/*
====================
CL_Init
====================
*/
void CL_Init( void )
{
	qboolean loaded;
	if( host.type == HOST_DEDICATED )
		return; // nothing running on the client

	Con_Init();	
	CL_InitLocal();

	R_Init();	// init renderer
	S_Init();	// init sound

	// unreliable buffer. unsed for unreliable commands and voice stream
	BF_Init( &cls.datagram, "cls.datagram", cls.datagram_buf, sizeof( cls.datagram_buf ));

	loaded = CL_LoadProgs( va( "%s/%s" , GI->dll_path, GI->client_lib ));
	if( !loaded )
#if defined (__ANDROID__)
		{
			char clientlib[256];
			Q_strncpy( clientlib, getenv("XASH3D_ENGLIBDIR"), 256 );
			Q_strncat( clientlib, "/" CLIENTDLL, 256 );
			loaded = CL_LoadProgs( clientlib );
		}
#else
		loaded = CL_LoadProgs( CLIENTDLL );
#endif
	if( loaded )
	{
		cls.initialized = true;
		cl.maxclients = 1; // allow to drawing player in menu
		cls.olddemonum = -1;
		cls.demonum = -1;
	}
}
开发者ID:ShaunNoWay,项目名称:xash3d,代码行数:40,代码来源:cl_main.c

示例5: VID_CheckChanges

/*
============
VID_CheckChanges

This function gets called once just before drawing each frame, and it's sole purpose in life
is to check to see if any of the video mode parameters have changed, and if they have to 
update the rendering DLL and/or video mode to match.
============
*/
void VID_CheckChanges (void)
{

	if ( vid_restart )
	{
		cl.force_refdef = true;		// can't use a paused refdef
		S_StopAllSounds();

		/*
		** refresh has changed
		*/
		vid_fullscreen->modified = true;
		cl.refresh_prepped = false;
		cls.disable_screen = true;

		VID_Shutdown();

		Com_Printf( "--------- [Loading Renderer] ---------\n" );

		vid_active = true;
		if ( R_Init( 0, 0 ) == -1 )
		{
			R_Shutdown();
			Com_Error (ERR_FATAL, "Couldn't initialize renderer!");
		}

		Com_Printf( "------------------------------------\n");

		vid_restart = false;
		cls.disable_screen = false;

		IN_Activate(false);
		IN_Activate(true);
	}
}
开发者ID:chrisnew,项目名称:quake2,代码行数:44,代码来源:vid_so.c

示例6: CL_Init

/*
====================
CL_Init
====================
*/
void CL_Init( void )
{
	qboolean loaded;

	Q_memset( &cls, 0, sizeof( cls ) );

	if( Host_IsDedicated() )
		return; // nothing running on the client

	Con_Init();	
	CL_InitLocal();

	R_Init();	// init renderer
	S_Init();	// init sound

	// unreliable buffer. unsed for unreliable commands and voice stream
	BF_Init( &cls.datagram, "cls.datagram", cls.datagram_buf, sizeof( cls.datagram_buf ));

	IN_TouchInit();
#if defined (__ANDROID__)
	{
		char clientlib[256];
		Q_snprintf( clientlib, sizeof(clientlib), "%s/" CLIENTDLL, getenv("XASH3D_GAMELIBDIR"));
		loaded = CL_LoadProgs( clientlib );

		if( !loaded )
		{
			Q_snprintf( clientlib, sizeof(clientlib), "%s/" CLIENTDLL, getenv("XASH3D_ENGLIBDIR"));
			loaded = CL_LoadProgs( clientlib );
		}
	}
#else
	{
		char clientlib[256];
		Com_ResetLibraryError();
		if( Sys_GetParmFromCmdLine( "-clientlib", clientlib ) )
			loaded = CL_LoadProgs( clientlib );
		else
			loaded = CL_LoadProgs( va( "%s/%s" , GI->dll_path, SI.clientlib ));
		if( !loaded )
		{

			loaded = CL_LoadProgs( CLIENTDLL );

		}
	}
#endif
	if( loaded )
	{
		cls.initialized = true;
		cls.keybind_changed = false;
		cl.maxclients = 1; // allow to drawing player in menu
		cls.olddemonum = -1;
		cls.demonum = -1;
	}
	else
		Sys_Warn("Could not load client library:\n%s", Com_GetLibraryError());
}
开发者ID:Reedych,项目名称:xash3d,代码行数:63,代码来源:cl_main.c

示例7: D_DoomWadReboot

//
// [denis] D_DoomWadReboot
// change wads at runtime
// on 404, returns a vector of bad files
//
std::vector<size_t> D_DoomWadReboot (std::vector<std::string> wadnames, 
                                     std::vector<std::string> patch_files)
{
	std::vector<size_t> fails;

	if (modifiedgame && (gameinfo.flags & GI_SHAREWARE))
		I_FatalError ("\nYou cannot switch WAD with the shareware version. Register!");

	SV_SendReconnectSignal();

	G_ExitLevel(0, 0);
	DThinker::DestroyAllThinkers();

	Z_Init();

	wadfiles.clear();

	std::string custwad;
	if(wadnames.size())
		custwad = wadnames[0];

	D_AddDefWads(custwad);

	for(size_t i = 0; i < wadnames.size(); i++)
	{
		std::string file = BaseFileSearch(wadnames[i], ".WAD");

		if(file.length())
			wadfiles.push_back(file);
		else
		{
			Printf (PRINT_HIGH, "could not find WAD: %s\n", wadnames[i].c_str());
			fails.push_back(i);
		}
	}

	if(wadnames.size() > 1)
		modifiedgame = true;

	wadhashes = W_InitMultipleFiles (wadfiles);
	SV_InitMultipleFiles (wadfiles);

	// get skill / episode / map from parms
	strcpy (startmap, (gameinfo.flags & GI_MAPxx) ? "MAP01" : "E1M1");

	D_InitStrings ();
	D_DoDefDehackedPatch(patch_files);

	G_SetLevelStrings ();
	S_ParseSndInfo();

	R_Init();
	P_Init();

	return fails;
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:61,代码来源:d_main.cpp

示例8: Window

    Window(void) : SYS::GLWindow(0, TEXT("Normalmapping"), 800, 800) {
        _angle = 0.0f;

        R_Init();

        glClearColor(0.0f, 0.0f, 0.0f, 1.0f);

        R_CreateShader(&_vertexShader, GL_VERTEX_SHADER, "vertexshader.txt");
        R_CreateShader(&_pixelShader, GL_FRAGMENT_SHADER, "pixelshader.txt");

        _program = glx.CreateProgram();
        glx.AttachShader(_program, _vertexShader.shader);
        glx.AttachShader(_program, _pixelShader.shader);
        R_LinkProgram(_program);
        glx.UseProgram(_program);

        FS::Dump& dump = FS::Dump::Instance();

        /*
        R_LoadModelMD5(&_model, "hunter/hunter.md5mesh");

        _model.meshes[0].texDiffuse = R_GetTexture(dump, TYPE_TGA, "hunter/hunterbody.tga");
        _model.meshes[0].texNormal = R_GetTexture(dump, TYPE_TGA, "hunter/highres/hunterbody_local.tga");
        _model.meshes[0].texAdd = R_GetTexture(dump, TYPE_TGA, "hunter/hunterbody_add.tga");
        _model.meshes[0].texSpec = R_GetTexture(dump, TYPE_TGA, "hunter/hunterbody_s.tga");

        _model.meshes[1].texDiffuse = R_GetTexture(dump, TYPE_TGA, "hunter/hunterhead.tga");
        _model.meshes[1].texNormal = R_GetTexture(dump, TYPE_TGA, "hunter/hunterhead_local.tga");
        _model.meshes[1].texAdd = R_GetTexture(dump, TYPE_TGA, "hunter/hunterhead_add.tga");
        _model.meshes[1].texSpec = R_GetTexture(dump, TYPE_TGA, "hunter/hunterhead_s.tga");

        _model.meshes[2].texDiffuse = R_GetTexture(dump, TYPE_TGA, "rifle/rifle.tga");
        _model.meshes[2].texNormal = R_GetTexture(dump, TYPE_TGA, "rifle/rifle_local.tga");
        _model.meshes[2].texAdd = R_GetTexture(dump, TYPE_TGA, "rifle/rifle_add.tga");
        _model.meshes[2].texSpec = R_GetTexture(dump, TYPE_TGA, "rifle/rifle_s.tga");
        */

        R_LoadModelMD5(&_model, "hellknight/hellknight.md5mesh");
        _model.meshes[0].texDiffuse = R_GetTexture(dump, TYPE_TGA, "hellknight/hellknight.tga");
        _model.meshes[0].texNormal = R_GetTexture(dump, TYPE_TGA, "hellknight/hellknight_local.tga");
        _model.meshes[0].texSpec = R_GetTexture(dump, TYPE_TGA, "hellknight/hellknight_s.tga");

        GLuint sampler;
        sampler = glx.GetUniformLocation(_program, "texDiffuse");
        glx.Uniform1i(sampler, 0);
        sampler = glx.GetUniformLocation(_program, "texNormal");
        glx.Uniform1i(sampler, 1);
        sampler = glx.GetUniformLocation(_program, "texAdd");
        glx.Uniform1i(sampler, 2);
        sampler = glx.GetUniformLocation(_program, "texSpec");
        glx.Uniform1i(sampler, 3);

        _lightPos = M::Vector3(-200.0f, 200.0f, 0.0f);
    }
开发者ID:plainoldcj,项目名称:glib,代码行数:54,代码来源:main.cpp

示例9: D_DoomMain

void D_DoomMain(void)
{
	BigNumFont = LoadAResource(rBIGNUMB);	/* Cache the large numeric font (Needed always) */
	R_Init();			/* Init refresh system */
	P_Init();			/* Init main code */
	O_Init();			/* Init controls */
	for (;;) {
		RunTitle();			/* Show the title page */
		RunDemo(rDEMO1);	/* Run the first demo */
		RunCredits();		/* Show the credits page */
		RunDemo(rDEMO2);	/* Run the second demo */
	}
}
开发者ID:Almamu,项目名称:doom3do,代码行数:13,代码来源:dmain.c

示例10: VID_LoadRefresh

/*
==============
VID_LoadRefresh
==============
*/
qboolean VID_LoadRefresh(void)
{
//	GetRefAPI_t	GetRefAPI;
	
	if ( reflib_active )
	{
		R_Shutdown();
		VID_FreeReflib ();
	}

	VID_Printf(PRINT_INFO, "-------- Loading OpenGL Ref --------\n");

#if 0
	if ( ( reflib_library = LoadLibrary( name ) ) == 0 )
	{
		VID_Printf(PRINT_ALL, "LoadLibrary(\"%s\") failed\n", name );

		return false;
	}
#endif

	Swap_Init();

#if 0
	if ( ( GetRefAPI = (void *) GetProcAddress( reflib_library, "GetRefAPI" ) ) == 0 )
		Com_Error( ERR_FATAL, "GetProcAddress failed on %s", name );

	re = GetRefAPI( ri );
#endif

#if 0
	if (re.api_version != API_VERSION)
	{
		VID_FreeReflib ();
		Com_Error (ERR_FATAL, "%s has incompatible api_version", name);
	}
#endif

	if ( R_Init( global_hInstance, MainWndProc ) == -1 )
	{
		R_Shutdown();
		VID_FreeReflib ();
		return false;
	}

	VID_Printf(PRINT_INFO, "------------------------------------\n");
	reflib_active = true;

	return true;
}
开发者ID:mattx86,项目名称:myq2,代码行数:55,代码来源:vid_dll.c

示例11: RE_BeginRegistration

/*
** RE_BeginRegistration
*/
void RE_BeginRegistration( glconfig_t *glconfigOut ) {
	ri.Hunk_Clear();

	R_Init();
	*glconfigOut = glConfig;

	R_SyncRenderThread();

	tr.viewCluster = -1;		// force markleafs to regenerate
//	R_ClearFlares();
	RE_ClearScene();

	tr.registered = qtrue;
}
开发者ID:5Quintessential,项目名称:jedioutcast,代码行数:17,代码来源:tr_model.cpp

示例12: RE_BeginRegistration

/*
** RE_BeginRegistration
*/
void RE_BeginRegistration( glconfig_t *glconfigOut ) {

	R_Init();

	*glconfigOut = glConfig;

	R_IssuePendingRenderCommands();

	tr.viewCluster = -1;		// force markleafs to regenerate
	R_ClearFlares();
	RE_ClearScene();

	tr.registered = qtrue;
}
开发者ID:CarterTsai,项目名称:ioq3,代码行数:17,代码来源:tr_model.c

示例13: D_NewWadInit

void D_NewWadInit()
{
    if (DefaultsLoaded)	{		// [ML] This is being called while loading defaults,
        G_SetLevelStrings ();
        G_ParseMapInfo ();
        G_ParseMusInfo ();
        S_ParseSndInfo();

        R_Init();
        P_Init();
    } else {					// let DoomMain know it doesn't have to do everything
        RebootInit = true;
    }
}
开发者ID:WChrisK,项目名称:OdaStats,代码行数:14,代码来源:d_main.cpp

示例14: D_Init

//
// D_Init
//
// Called to initialize subsystems when loading a new set of WAD resource
// files.
//
void D_Init()
{
	// only print init messages during startup, not when changing WADs
	static bool first_time = true;

	SetLanguageIDs();

	M_ClearRandom();

	// [AM] Init rand() PRNG, needed for non-deterministic maplist shuffling.
	srand(time(NULL));

	// start the Zone memory manager
	bool use_zone = !Args.CheckParm("-nozone");
	Z_Init(use_zone);
	if (first_time)
		Printf(PRINT_HIGH, "Z_Init: Heapsize: %u megabytes\n", got_heapsize);

	// Load palette and set up colormaps
	V_InitPalette("PLAYPAL");
	R_InitColormaps();

//	if (first_time)
//		Printf(PRINT_HIGH, "Res_InitTextureManager: Init image resource management.\n");
//	Res_InitTextureManager();

	// [RH] Initialize localizable strings.
	GStrings.FreeData();
	GStrings.LoadStrings(W_GetNumForName("LANGUAGE"), STRING_TABLE_SIZE, false);
	GStrings.Compact();

	// init the renderer
	if (first_time)
		Printf(PRINT_HIGH, "R_Init: Init DOOM refresh daemon.\n");
	R_Init();

	G_SetLevelStrings();
	G_ParseMapInfo();
	G_ParseMusInfo();
	S_ParseSndInfo();

	if (first_time)
		Printf(PRINT_HIGH, "P_Init: Init Playloop state.\n");
//	P_InitEffects();
	P_Init();

	first_time = false;
}
开发者ID:davidsgalbraith,项目名称:odamex,代码行数:54,代码来源:d_main.cpp

示例15: VID_Restart_f

/**
 * @brief Perform a renderer restart
 */
static void VID_Restart_f (void)
{
	refdef.ready = false;

	Com_Printf("renderer restart\n");

	R_Shutdown();
	R_Init();
	UI_Reinit();
	/** @todo only reload the skins, not all models */
	CL_ViewPrecacheModels();

	/** @todo going back into the map isn't working as long as GAME_ReloadMode is called */
	/*CL_ViewLoadMedia();*/
	GAME_ReloadMode();
}
开发者ID:Ed-von-Schleck,项目名称:ufoai,代码行数:19,代码来源:cl_video.cpp


注:本文中的R_Init函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。