MCPcopy Create free account
hub / github.com/LukasBanana/LLGL / DrawSceneIntoTexture

Function DrawSceneIntoTexture

examples/Cpp/RenderTarget/Example.cpp:423–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

OnDrawFrameFunction · 0.85

Calls 11

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

Tested by

no test coverage detected