AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
CommonRenderingContext.h
    1/*
    2 * AUI Framework - Declarative UI toolkit for modern C++20
    3 * Copyright (C) 2020-2025 Alex2772 and Contributors
    4 *
    5 * SPDX-License-Identifier: MPL-2.0
    6 *
    7 * This Source Code Form is subject to the terms of the Mozilla Public
    8 * License, v. 2.0. If a copy of the MPL was not distributed with this
    9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
   10 */
   11
   12#pragma once
   13
   14#include "IRenderingContext.h"
   15#include <AUI/Platform/AWindow.h>
   16#include "AUI/Traits/values.h"
   17#include "ARenderingContextOptions.h"
   18
   20public:
   21#if AUI_PLATFORM_MACOS
   22    void requestFrame();
   23#endif
   24
   25#if !AUI_PLATFORM_LINUX
   26    // to be implemented by IPlatformAbstraction
   27    void init(const Init& init) override;
   28    void destroyNativeWindow(AWindowBase& window) override;
   29#endif
   30
   31    void beginPaint(AWindowBase& window) override;
   32
   33    void endPaint(AWindowBase& window) override;
   34
   35    ~CommonRenderingContext() override = default;
   36
   37
   38protected:
   39#if AUI_PLATFORM_WIN
   40
   41    AString mWindowClass;
   42
   46    HDC mWindowDC;
   47
   51    HDC mPainterDC = nullptr;
   52
   53    PAINTSTRUCT mPaintstruct;
   54#endif
   55#if AUI_PLATFORM_MACOS
   56    AWindow* mWindow;
   57    void* mDisplayLink;
   58    bool mFrameScheduled = false;
   59#endif
   60
   61    bool mSmoothResize = !(ARenderingContextOptions::get().flags & ARenderContextFlags::NO_SMOOTH);
   62};
Represents a Unicode character string.
Definition AString.h:38
Definition AWindowBase.h:33
Represents a window in the underlying windowing system.
Definition AWindow.h:45
Definition CommonRenderingContext.h:19
HDC mPainterDC
Definition CommonRenderingContext.h:51
HDC mWindowDC
Definition CommonRenderingContext.h:46
Glue between AWindow and IRenderer.
Definition IRenderingContext.h:36
Definition IRenderingContext.h:38