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

Function main

deps/LLGL/tests/Test_OpenGL.cpp:21–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21int main()
22{
23 try
24 {
25 // Setup profiler and debugger
26 std::shared_ptr<LLGL::RenderingProfiler> profiler;
27 std::shared_ptr<LLGL::RenderingDebugger> debugger;
28
29 profiler = std::make_shared<LLGL::RenderingProfiler>();
30 debugger = std::make_shared<LLGL::RenderingDebugger>();
31
32 // Load render system module
33 auto renderer = LLGL::RenderSystem::Load("OpenGL", profiler.get(), debugger.get());
34
35 // Create render context
36 LLGL::RenderContextDescriptor contextDesc;
37
38 contextDesc.videoMode.resolution = { 800, 600 };
39 //contextDesc.videoMode.fullscreen = true;
40 contextDesc.samples = 8;
41 contextDesc.vsync.enabled = true;
42
43 /*contextDesc.profileOpenGL.extProfile = true;
44 contextDesc.profileOpenGL.coreProfile = true;
45 contextDesc.profileOpenGL.version = LLGL::OpenGLVersion::OpenGL_3_0;*/
46
47 #if 0
48 contextDesc.debugCallback = [](const std::string& type, const std::string& message)
49 {
50 std::cout << type << ':' << std::endl << " " << message << std::endl;
51 };
52 #endif
53
54 #ifdef __linux__
55
56 auto context = renderer->CreateRenderContext(contextDesc);
57
58 auto window = static_cast<LLGL::Window*>(&(context->GetSurface()));
59
60 #else
61
62 LLGL::WindowDescriptor windowDesc;
63 {
64 windowDesc.size = contextDesc.videoMode.resolution;
65 windowDesc.borderless = contextDesc.videoMode.fullscreen;
66 windowDesc.centered = !contextDesc.videoMode.fullscreen;
67 windowDesc.resizable = true;
68 }
69 auto window = std::shared_ptr<LLGL::Window>(LLGL::Window::Create(windowDesc));
70
71 auto context = renderer->CreateRenderContext(contextDesc, window);
72
73 #endif
74
75 window->Show();
76
77 // Create command buffer
78 auto commandQueue = renderer->GetCommandQueue();

Callers

nothing calls this directly

Calls 15

GetSurfaceMethod · 0.80
AppendAttributeMethod · 0.80
QueryConstantBuffersMethod · 0.80
QueryStorageBuffersMethod · 0.80
KeyDownMethod · 0.80
SetVideoModeMethod · 0.80
getMethod · 0.45
CreateRenderContextMethod · 0.45
ShowMethod · 0.45
GetCommandQueueMethod · 0.45
CreateCommandBufferMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected