Subpixel rendering (#186)

Reviewed-on: https://git.madvoxel.net/OpenVulkano/OpenVulkano/pulls/186
Reviewed-by: Georg Hagen <georg.hagen@madvoxel.com>
Co-authored-by: ohyzha <oleksii.hyzha.ext@madvoxel.com>
Co-committed-by: ohyzha <oleksii.hyzha.ext@madvoxel.com>
This commit is contained in:
ohyzha
2025-01-13 11:05:54 +01:00
committed by Oleksii_Hyzha
parent c976d75715
commit f2b164d6e8
20 changed files with 452 additions and 112 deletions

View File

@@ -10,6 +10,7 @@
#include <algorithm>
#include <array>
#include "Base/Event.hpp"
#include "Scene/SubpixelLayout.hpp"
#undef max
namespace OpenVulkano
@@ -34,6 +35,9 @@ namespace OpenVulkano
[[nodiscard]] bool GetVSync() const { return m_vSync; }
void SetVSync(bool vSync) { m_vSync = vSync; }
[[nodiscard]] SubpixelLayout GetSubpixelLayout() const { return m_subpixelLayout; }
void SetSubpixelLayout(SubpixelLayout subpixelLayout) { m_subpixelLayout = subpixelLayout; }
[[nodiscard]] int32_t GetFpsCap() const { return m_fpsCap; }
void SetFpsCap(int32_t fpsCap)
{
@@ -58,6 +62,7 @@ namespace OpenVulkano
bool m_preferFramebufferFormatSRGB = true;
bool m_lazyRendering = false;
bool m_vSync = false;
SubpixelLayout m_subpixelLayout = SubpixelLayout::AUTO;
int32_t m_fpsCap = -1; // -1 = no fps cap. 0 = fps cap if vsync, no cap otherwise. > 0 = set fps cap
#ifdef __APPLE__
uint32_t m_preferredImageCount = 3;

View File

@@ -8,6 +8,7 @@
#include "Math/Math.hpp"
#include "Base/PlatformEnums.hpp"
#include "Scene/SubpixelLayout.hpp"
#include <string>
#include <stdexcept>
@@ -89,6 +90,7 @@ namespace OpenVulkano
virtual float GetContentScale() const { return 1; }
virtual float GetInterfaceOrientation() const { return 0; }
virtual SubpixelLayout GetSubpixelLayout() const { return SubpixelLayout::UNKNOWN; }
protected:
static uint32_t CreateWindowId()
{