MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / CaptureRenderToImage

Method CaptureRenderToImage

neo/renderer/RenderSystem.cpp:886–918  ·  view source on GitHub ↗

================ CaptureRenderToImage ================ */

Source from the content-addressed store, hash-verified

884================
885*/
886void idRenderSystemLocal::CaptureRenderToImage( const char *imageName ) {
887 if ( !glConfig.isInitialized ) {
888 return;
889 }
890 guiModel->EmitFullScreen();
891 guiModel->Clear();
892
893 if ( session->writeDemo ) {
894 session->writeDemo->WriteInt( DS_RENDER );
895 session->writeDemo->WriteInt( DC_CAPTURE_RENDER );
896 session->writeDemo->WriteHashString( imageName );
897
898 if ( r_showDemo.GetBool() ) {
899 common->Printf( "write DC_CAPTURE_RENDER: %s\n", imageName );
900 }
901 }
902
903 // look up the image before we create the render command, because it
904 // may need to sync to create the image
905 idImage *image = globalImages->ImageFromFile(imageName, TF_DEFAULT, true, TR_REPEAT, TD_DEFAULT);
906
907 renderCrop_t *rc = &renderCrops[currentRenderCrop];
908
909 copyRenderCommand_t *cmd = (copyRenderCommand_t *)R_GetCommandBuffer( sizeof( *cmd ) );
910 cmd->commandId = RC_COPY_RENDER;
911 cmd->x = rc->x;
912 cmd->y = rc->y;
913 cmd->imageWidth = rc->width;
914 cmd->imageHeight = rc->height;
915 cmd->image = image;
916
917 guiModel->Clear();
918}
919
920/*
921==============

Callers 13

DoubleVisionMethod · 0.80
BerserkVisionMethod · 0.80
InfluenceVisionMethod · 0.80
StartWipeMethod · 0.80
ProcessDemoCommandMethod · 0.80
R_RemoteRenderFunction · 0.80
R_MirrorRenderFunction · 0.80
R_XrayRenderFunction · 0.80
Event_CamShotMethod · 0.80
SingleViewMethod · 0.80
AccumPassMethod · 0.80
InitializeMethod · 0.80

Calls 8

R_GetCommandBufferFunction · 0.85
EmitFullScreenMethod · 0.80
WriteHashStringMethod · 0.80
ImageFromFileMethod · 0.80
ClearMethod · 0.45
WriteIntMethod · 0.45
GetBoolMethod · 0.45
PrintfMethod · 0.45

Tested by

no test coverage detected