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

Method ExampleBase

deps/LLGL/examples/Cpp/ExampleBase/ExampleBase.cpp:252–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252ExampleBase::ExampleBase(
253 const std::wstring& title,
254 const LLGL::Extent2D& resolution,
255 std::uint32_t samples,
256 bool vsync,
257 bool debugger)
258:
259 profilerObj_ { new LLGL::RenderingProfiler() },
260 debuggerObj_ { new LLGL::RenderingDebugger() },
261 samples_ { samples },
262 timer { LLGL::Timer::Create() },
263 profiler { *profilerObj_ }
264{
265 // Set report callback to standard output
266 LLGL::Log::SetReportCallbackStd();
267 LLGL::Log::SetReportLimit(10);
268
269 // Set up renderer descriptor
270 LLGL::RenderSystemDescriptor rendererDesc = rendererModule_;
271
272 #if defined LLGL_OS_ANDROID
273 if (auto state = ExampleBase::androidApp_)
274 rendererDesc.androidApp = state;
275 else
276 throw std::invalid_argument("'android_app' state was not specified");
277 #endif
278
279 #if defined _DEBUG && 0
280 rendererDesc.debugCallback = [](const std::string& type, const std::string& message)
281 {
282 std::cerr << type << ": " << message << std::endl;
283 };
284 #endif
285
286 // Create render system
287 renderer = LLGL::RenderSystem::Load(
288 rendererDesc,
289 (debugger ? profilerObj_.get() : nullptr),
290 (debugger ? debuggerObj_.get() : nullptr)
291 );
292
293 if (!debugger)
294 debuggerObj_.reset();
295
296 // Create render context
297 LLGL::RenderContextDescriptor contextDesc;
298 {
299 contextDesc.videoMode.resolution = resolution;
300 contextDesc.vsync.enabled = vsync;
301 contextDesc.samples = samples;
302 }
303 context = renderer->CreateRenderContext(contextDesc);
304
305 // Create command buffer
306 commands = renderer->CreateCommandBuffer();
307
308 // Get command queue
309 commandQueue = renderer->GetCommandQueue();

Callers

nothing calls this directly

Calls 15

SetReportCallbackStdFunction · 0.85
SetReportLimitFunction · 0.85
ToStringFunction · 0.85
GetSurfaceMethod · 0.80
SetBehaviorMethod · 0.80
getMethod · 0.45
resetMethod · 0.45
CreateRenderContextMethod · 0.45
CreateCommandBufferMethod · 0.45
GetCommandQueueMethod · 0.45
SetClearColorMethod · 0.45
GetResolutionMethod · 0.45

Tested by

no test coverage detected