| 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 | { |
no test coverage detected