| 19 | |
| 20 | |
| 21 | int 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(); |
nothing calls this directly
no test coverage detected