本文整理汇总了C++中R_IssueRenderCommands函数的典型用法代码示例。如果您正苦于以下问题:C++ R_IssueRenderCommands函数的具体用法?C++ R_IssueRenderCommands怎么用?C++ R_IssueRenderCommands使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了R_IssueRenderCommands函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RE_EndFrame
/*
=============
RE_EndFrame
Returns the number of msec spent in the back end
=============
*/
void RE_EndFrame( int *frontEndMsec, int *backEndMsec ) {
swapBuffersCommand_t *cmd;
//printf("here 2a\n");
if ( !tr.registered ) {
printf("tr.registered == false\n");
return;
}
//printf("here 2b\n");
cmd = R_GetCommandBuffer( sizeof( *cmd ) );
if ( !cmd ) {
printf("R_GetCommandBuffer == 0\n");
return;
}
cmd->commandId = RC_SWAP_BUFFERS;
//printf("here 2c\n");
R_IssueRenderCommands( qtrue );
//printf("here 2d\n");
// use the other buffers next frame, because another CPU
// may still be rendering into the current ones
R_ToggleSmpFrame();
//printf("here 2e\n");
if ( frontEndMsec ) {
*frontEndMsec = tr.frontEndMsec;
}
tr.frontEndMsec = 0;
if ( backEndMsec ) {
*backEndMsec = backEnd.pc.msec;
}
backEnd.pc.msec = 0;
//printf("here 2f\n");
}
示例2: RE_EndFrame
/*
=============
RE_EndFrame
Returns the number of msec spent in the back end
=============
*/
void RE_EndFrame(int *frontEndMsec, int *backEndMsec)
{
renderCommandList_t *cmdList;
if (!tr.registered)
{
return;
}
// Needs to use reserved space, so no R_GetCommandBuffer.
cmdList = &backEndData->commands;
assert(cmdList);
// add swap-buffers command
*( int * )(cmdList->cmds + cmdList->used) = RC_SWAP_BUFFERS;
cmdList->used += sizeof(swapBuffersCommand_t);
R_IssueRenderCommands(qtrue);
// use the other buffers next frame, because another CPU
// may still be rendering into the current ones
R_InitNextFrame();
if (frontEndMsec)
{
*frontEndMsec = tr.frontEndMsec;
}
tr.frontEndMsec = 0;
if (backEndMsec)
{
*backEndMsec = backEnd.pc.msec;
}
backEnd.pc.msec = 0;
}
示例3: R_IssueRenderCommands
/*
==============
CaptureRenderToFile
==============
*/
void idRenderSystemLocal::CaptureRenderToFile( const char *fileName, bool fixAlpha ) {
if ( !glConfig.isInitialized ) {
return;
}
renderCrop_t *rc = &renderCrops[currentRenderCrop];
guiModel->EmitFullScreen();
guiModel->Clear();
R_IssueRenderCommands();
qglReadBuffer( GL_BACK );
// include extra space for OpenGL padding to word boundaries
int c = ( rc->width + 3 ) * rc->height;
byte *data = (byte *)R_StaticAlloc( c * 3 );
qglReadPixels( rc->x, rc->y, rc->width, rc->height, GL_RGB, GL_UNSIGNED_BYTE, data );
byte *data2 = (byte *)R_StaticAlloc( c * 4 );
for ( int i = 0 ; i < c ; i++ ) {
data2[ i * 4 ] = data[ i * 3 ];
data2[ i * 4 + 1 ] = data[ i * 3 + 1 ];
data2[ i * 4 + 2 ] = data[ i * 3 + 2 ];
data2[ i * 4 + 3 ] = 0xff;
}
R_WriteTGA( fileName, data2, rc->width, rc->height, true );
R_StaticFree( data );
R_StaticFree( data2 );
}
示例4: RE_EndFrame
/*
=============
RE_EndFrame
Returns the number of msec spent in the back end
=============
*/
void RE_EndFrame( int *frontEndMsec, int *backEndMsec ) {
swapBuffersCommand_t *cmd;
if ( !tr.registered ) {
return;
}
cmd = (swapBuffersCommand_t *) R_GetCommandBuffer( sizeof( *cmd ) );
if ( !cmd ) {
return;
}
cmd->commandId = RC_SWAP_BUFFERS;
R_IssueRenderCommands( qtrue );
// use the other buffers next frame, because another CPU
// may still be rendering into the current ones
R_ToggleSmpFrame();
if ( frontEndMsec ) {
*frontEndMsec = tr.frontEndMsec;
}
tr.frontEndMsec = 0;
if ( backEndMsec ) {
*backEndMsec = backEnd.pc.msec;
}
backEnd.pc.msec = 0;
for(int i=0;i<MAX_LIGHT_STYLES;i++)
{
styleUpdated[i] = false;
}
}
示例5: RE_EndFrame
/*
=============
RE_EndFrame
Returns the number of msec spent in the back end
=============
*/
void RE_EndFrame( int *frontEndMsec, int *backEndMsec ) {
swapBuffersCommand_t *cmd;
if ( !tr.registered ) {
return;
}
cmd = (swapBuffersCommand_t *) R_GetCommandBuffer( sizeof( *cmd ) );
if ( !cmd ) {
return;
}
cmd->commandId = RC_SWAP_BUFFERS;
R_IssueRenderCommands( qtrue );
// use the other buffers next frame, because another CPU
// may still be rendering into the current ones
R_InitNextFrame();
if ( frontEndMsec ) {
*frontEndMsec = tr.frontEndMsec;
}
tr.frontEndMsec = 0;
if ( backEndMsec ) {
*backEndMsec = backEnd.pc.msec;
}
backEnd.pc.msec = 0;
}
示例6: R_IssuePendingRenderCommands
/*
====================
R_IssuePendingRenderCommands
Issue any pending commands and wait for them to complete.
====================
*/
void R_IssuePendingRenderCommands( void ) {
if ( !tr.registered ) {
return;
}
R_IssueRenderCommands( qfalse );
}
示例7: RE_EndFrame
/*
=============
RE_EndFrame
Returns the number of msec spent in the back end
=============
*/
void RE_EndFrame( int *frontEndMsec, int *backEndMsec ) {
swapBuffersCommand_t *cmd;
if ( !tr.registered ) {
return;
}
cmd = R_GetCommandBuffer( sizeof( *cmd ) );
if ( !cmd ) {
return;
}
cmd->commandId = RC_SWAP_BUFFERS;
R_IssueRenderCommands( qtrue );
R_InitNextFrame();
if ( frontEndMsec ) {
*frontEndMsec = tr.frontEndMsec;
}
tr.frontEndMsec = 0;
if ( backEndMsec ) {
*backEndMsec = backEnd.pc.msec;
}
backEnd.pc.msec = 0;
}
示例8: R_SyncRenderThread
/*
====================
R_SyncRenderThread
Issue any pending commands and wait for them to complete.
After exiting, the render thread will have completed its work
and will remain idle and the main thread is free to issue
OpenGL calls until R_IssueRenderCommands is called.
====================
*/
void R_SyncRenderThread( void ) {
#ifndef _XBOX
if ( !tr.registered ) {
return;
}
R_IssueRenderCommands( qfalse );
#endif
}
示例9: R_SyncRenderThread
/*
====================
R_SyncRenderThread
Issue any pending commands and wait for them to complete.
After exiting, the render thread will have completed its work
and will remain idle and the main thread is free to issue
OpenGL calls until R_IssueRenderCommands is called.
====================
*/
void R_SyncRenderThread( void ) {
if ( !tr.registered ) {
return;
}
R_IssueRenderCommands( qfalse );
if ( !glConfig.smpActive ) {
return;
}
GLimp_FrontEndSleep();
}
示例10: R_PerformanceCounters
/*
=============
EndFrame
Returns the number of msec spent in the back end
=============
*/
void idRenderSystemLocal::EndFrame( int *frontEndMsec, int *backEndMsec, bool swapFrontBack ) {
emptyCommand_t *cmd;
if ( !glConfig.isInitialized ) {
return;
}
// close any gui drawing
guiModel->EmitFullScreen();
guiModel->Clear();
// save out timing information
if ( frontEndMsec ) {
*frontEndMsec = pc.frontEndMsec;
}
if ( backEndMsec ) {
*backEndMsec = backEnd.pc.msec;
}
// print any other statistics and clear all of them
R_PerformanceCounters();
// check for dynamic changes that require some initialization
R_CheckCvars();
// check for errors
GL_CheckErrors();
// add the swapbuffers command
if(swapFrontBack)
{
cmd = (emptyCommand_t *)R_GetCommandBuffer( sizeof( *cmd ) );
cmd->commandId = RC_SWAP_BUFFERS;
}
// start the back end up again with the new command list
R_IssueRenderCommands();
// use the other buffers next frame, because another CPU
// may still be rendering into the current buffers
R_ToggleSmpFrame();
// we can now release the vertexes used this frame
vertexCache.EndFrame();
if ( session->writeDemo ) {
session->writeDemo->WriteInt( DS_RENDER );
session->writeDemo->WriteInt( DC_END_FRAME );
if ( r_showDemo.GetBool() ) {
common->Printf( "write DC_END_FRAME\n" );
}
}
}
示例11: R_SyncRenderThread
/*
====================
R_SyncRenderThread
Issue any pending commands and wait for them to complete.
After exiting, the render thread will have completed its work
and will remain idle and the main thread is free to issue
OpenGL calls until R_IssueRenderCommands is called.
====================
*/
void R_SyncRenderThread() {
if (!tr.registered) {
return;
}
R_IssueRenderCommands(false);
if (!glConfig.smpActive) {
return;
}
GLimp_SyncRenderThread();
}
示例12: memset
frameInfo_t idRenderSystemLocal::LocalEndFrame() {
frameInfo_t info;
memset(&info, 0, sizeof(info));
if (!glConfig.isInitialized) {
return info;
}
// close any gui drawing
guiModel->EmitFullScreen();
guiModel->Clear();
// save out timing information
info.time.frontEndMsec = pc.frontEndMsec;
info.time.backEndMsec = backEnd.pc.msec;
// print any other statistics and clear all of them
R_PerformanceCounters();
// check for errors
GL_CheckErrors(false);
// add the swapbuffers command
auto cmd = R_GetCommandBuffer<emptyCommand_t>();
cmd->commandId = RC_SWAP_BUFFERS;
// start the back end up again with the new command list
info.framebuffer = R_IssueRenderCommands();
// use the other buffers next frame, because another CPU
// may still be rendering into the current buffers
R_ToggleSmpFrame();
// we can now release the vertexes used this frame
vertexCache.EndFrame();
if (session->writeDemo) {
session->writeDemo->WriteInt(DS_RENDER);
session->writeDemo->WriteInt(DC_END_FRAME);
if (r_showDemo.GetBool()) {
common->Printf("write DC_END_FRAME\n");
}
}
return info;
}
示例13: RE_EndFrame
/*
=============
RE_EndFrame
Returns the number of msec spent in the back end
=============
*/
void RE_EndFrame( int *frontEndMsec, int *backEndMsec )
{
swapBuffersCommand_t *cmd;
if ( !tr.registered )
{
return;
}
GLimp_HandleCvars();
cmd = (swapBuffersCommand_t*) R_GetCommandBuffer( sizeof( *cmd ) );
if ( !cmd )
{
return;
}
cmd->commandId = RC_SWAP_BUFFERS;
R_IssueRenderCommands( qtrue );
// use the other buffers next frame, because another CPU
// may still be rendering into the current ones
R_ToggleSmpFrame();
// update the results of the vis tests
R_UpdateVisTests();
if ( frontEndMsec )
{
*frontEndMsec = tr.frontEndMsec;
}
tr.frontEndMsec = 0;
if ( backEndMsec )
{
*backEndMsec = backEnd.pc.msec;
}
backEnd.pc.msec = 0;
}
示例14: RE_EndFrame
/*
=============
RE_EndFrame
Returns the number of msec spent in the back end
=============
*/
void RE_EndFrame( int *frontEndMsec, int *backEndMsec ) {
if ( !tr.registered ) {
return;
}
if ( !R_GetCommandBuffer( RC_SWAP_BUFFERS, 0 ) ) {
return;
}
R_IssueRenderCommands( qtrue );
// use the other buffers next frame, because another CPU
// may still be rendering into the current ones
R_ToggleSmpFrame();
if ( frontEndMsec ) {
*frontEndMsec = tr.frontEndMsec;
}
tr.frontEndMsec = 0;
if ( backEndMsec ) {
*backEndMsec = backEnd.pc.msec;
}
backEnd.pc.msec = 0;
}
示例15: R_GenerateReflectionRawData
void __cdecl R_GenerateReflectionRawData(DiskGfxReflectionProbe* probeRawData)
{
if (!*g_ffDir)
{
sprintf_s(g_ffDir, "%s/%s/", Dvar_GetString("fs_basepath"), Dvar_GetString("fs_game"));
}
refdef_s refdef;
char* ptr = *((char**)0x02FF5354);
refdef_s* refsrc = (refdef_s*)(ptr + 0x8C100);
memcpy(&refdef, refsrc, sizeof(refdef_s));
refdef.vieworg[1] = probeRawData->origin[0];
refdef.vieworg[2] = probeRawData->origin[1];
refdef.yaw = probeRawData->origin[2];
R_InitPrimaryLights(refdef.primaryLights[0].dir);
for (int cubemapShot = 1; cubemapShot < 7; cubemapShot++)
{
R_BeginCubemapShot(256, 0);
R_BeginFrame();
GfxCmdArray* s_cmdList = *(GfxCmdArray**)0x03B370C0;
GfxBackEndData* frontEndDataOut = *(GfxBackEndData**)0x03B3708C;
frontEndDataOut->cmds = &s_cmdList->cmds[s_cmdList->usedTotal];
frontEndDataOut->viewInfo[frontEndDataOut->viewInfoCount].cmds = NULL;
R_ClearScene(0);
FX_BeginUpdate(0);
R_CalcCubeMapViewValues(&refdef, cubemapShot, 256);
float* vec = (float*)0x3AC3060;
vec[0] = refdef.vieworg[0];
vec[1] = refdef.vieworg[1];
vec[2] = refdef.vieworg[2];
int* unk1 = (int*)0x3AC3058; *unk1 = refdef.time;
float* unk2 = (float*)0x3AC305C; *unk2 = refdef.time * 0.001f;
R_UpdateFrameFog(refdef.localClientNum);
R_UpdateFrameSun();
float zFar = R_GetFarPlaneDist();
FxCameraUpdate fxUpdateCmd;
memset(&fxUpdateCmd, 0, sizeof(FxCameraUpdate));
FxCmd cmd;
memset(&cmd, 0, sizeof(FxCmd));
FX_GetCameraUpdateFromRefdefAndZFar(&fxUpdateCmd, &refdef, zFar);
FX_SetNextUpdateCamera(0, &fxUpdateCmd);
FX_FillUpdateCmd(0, &cmd);
Sys_ResetUpdateSpotLightEffectEvent();
Sys_AddWorkerCmdInternal((void*)0x00BA5420, &cmd, 0);
Sys_ResetUpdateNonDependentEffectsEvent();
Sys_AddWorkerCmdInternal((void*)0x00BA52E0, &cmd, 0);
Sys_AddWorkerCmdInternal((void*)0x00BA5300, &cmd, 0);
Sys_AddWorkerCmdInternal((void*)0x00BA5330, &cmd, 0);
R_RenderScene(&refdef, 0);
R_EndFrame();
R_IssueRenderCommands(3);
R_EndCubemapShot(cubemapShot);
}
R_CreateReflectionRawDataFromCubemapShot(probeRawData);
}