19#include <AUI/Platform/CommonRenderingContext.h>
20#include "ARenderingContextOptions.h"
21#include "AUI/GL/OpenGLRenderer.h"
27 void init(
const Init& init)
override;
30 AImage makeScreenshot()
override;
32 void destroyNativeWindow(
AWindowBase& window)
override;
39 uint32_t getDefaultFb()
const noexcept;
44 glm::uvec2 viewportSize()
const noexcept {
49 uint32_t getSupersamplingRatio()
const noexcept;
53 if (
auto fb = std::get_if<gl::Framebuffer>(&mFramebuffer)) {
63 static gl::Framebuffer newOffscreenRenderingFramebuffer(glm::uvec2 initialSize);
67 struct NotTried{};
struct Failed{}; std::variant<NotTried, Failed, gl::Framebuffer> mFramebuffer;
69 glm::uvec2 mViewportSize;
73 if (
auto v = g.lock()) {
76 auto temp = _new<OpenGLRenderer>();
81 void tryEnableFramebuffer(glm::uvec2 windowSize);
82 void beginFramebuffer(glm::uvec2 windowSize);
83 void endFramebuffer();
87 static void makeCurrent(HDC hdc)
noexcept;
88#elif AUI_PLATFORM_LINUX
89 static GLXContext ourContext;
90#elif AUI_PLATFORM_MACOS
91 static void* ourContext;
Utility wrapper implementing the stack-allocated (fast) optional idiom.
Definition: AOptional.h:32
Definition: AWindowBase.h:33
Definition: CommonRenderingContext.h:28
Base class for rendering.
Definition: IRenderer.h:149
Definition: OpenGLRenderingContext.h:23
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:177
Definition: Framebuffer.h:26
Definition: ARenderingContextOptions.h:57
Definition: IRenderingContext.h:38
An std::weak_ptr with AUI extensions.
Definition: SharedPtrTypes.h:51