MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / DrawSceneIntoTexture

Function DrawSceneIntoTexture

deps/LLGL/examples/Cpp/RenderTarget/Example.cpp:417–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415 }
416
417 void DrawSceneIntoTexture()
418 {
419 #ifndef ENABLE_CBUFFER_RANGE
420
421 // Update constant buffer with current settings
422 Settings settings;
423 UpdateSettingsForTexture(settings);
424 commands->UpdateBuffer(*constantBuffer, 0, &settings, sizeof(settings));
425
426 #endif // /ENABLE_CBUFFER_RANGE
427
428 // Begin render pass for render target
429 commands->BeginRenderPass(*renderTarget);
430 {
431 // Clear color and depth buffers of active framebuffer (i.e. the render target)
432 commands->SetClearColor({ 0.2f, 0.7f, 0.1f });
433 commands->Clear(LLGL::ClearFlags::ColorDepth);
434
435 // Bind graphics pipeline for render target
436 commands->SetPipelineState(*pipelines[0]);
437
438 // Set common buffers and sampler states
439 commands->SetIndexBuffer(*indexBuffer);
440 commands->SetVertexBuffer(*vertexBuffer);
441
442 if (resourceHeap)
443 {
444 // Set graphics pipeline resources
445 commands->SetResourceHeap(*resourceHeap, 0);
446 }
447 else
448 {
449 // Set resource directly
450 commands->SetResource(*constantBuffer, 3, LLGL::BindFlags::ConstantBuffer, shaderStages);
451 commands->SetResource(*colorMap, 2, LLGL::BindFlags::Sampled, shaderStages);
452 commands->SetResource(*samplerState, 1, 0, shaderStages);
453 }
454
455 // Draw scene
456 commands->DrawIndexed(36, 0);
457 }
458 commands->EndRenderPass();
459 }
460
461 void DrawSceneOntoScreen()
462 {

Callers 1

OnDrawFrameFunction · 0.85

Calls 12

UpdateSettingsForTextureFunction · 0.85
UpdateBufferMethod · 0.45
BeginRenderPassMethod · 0.45
SetClearColorMethod · 0.45
ClearMethod · 0.45
SetPipelineStateMethod · 0.45
SetIndexBufferMethod · 0.45
SetVertexBufferMethod · 0.45
SetResourceHeapMethod · 0.45
SetResourceMethod · 0.45
DrawIndexedMethod · 0.45
EndRenderPassMethod · 0.45

Tested by

no test coverage detected