DisplayVk.h#

The Display class.

Includes#

  • PVRVk/DebugUtilsVk.h

  • PVRVk/DisplayModeVk.h

  • PVRVk/ForwardDecObjectsVk.h

  • PVRVk/PVRVkObjectBaseVk.h

  • PVRVk/PhysicalDeviceVk.h

Included By#

Namespaces#

Classes#

Source Code#

#pragma once
#include "PVRVk/ForwardDecObjectsVk.h"
#include "PVRVk/PhysicalDeviceVk.h"
#include "PVRVk/PVRVkObjectBaseVk.h"
#include "PVRVk/DebugUtilsVk.h"
#include "PVRVk/DisplayModeVk.h"

namespace pvrvk {
namespace impl {
class Display_ : public PVRVkPhysicalDeviceObjectBase<VkDisplayKHR, ObjectType::e_DISPLAY_KHR>
{
private:
    friend class PhysicalDevice_;

    class make_shared_enabler
    {
    protected:
        make_shared_enabler() {}
        friend class Display_;
    };

    static Display constructShared(const PhysicalDeviceWeakPtr& physicalDevice, const DisplayPropertiesKHR& displayProperties)
    {
        return std::make_shared<Display_>(make_shared_enabler{}, physicalDevice, displayProperties);
    }

    std::vector<DisplayMode> _displayModes;
    DisplayPropertiesKHR _properties;

public:
    DECLARE_NO_COPY_SEMANTICS(Display_)
    Display_(make_shared_enabler, const PhysicalDeviceWeakPtr& physicalDevice, const DisplayPropertiesKHR& displayProperties);

    ~Display_() { _displayModes.clear(); }

    size_t getNumDisplayModes() const { return _displayModes.size(); }

    DisplayMode& getDisplayMode(uint32_t displayModeIndex) { return _displayModes[displayModeIndex]; }

    const DisplayMode& getDisplayMode(uint32_t displayModeIndex) const { return _displayModes[displayModeIndex]; }

    inline const char* getDisplayName() const { return _properties.getDisplayName(); }

    inline const Extent2D& getPhysicalDimensions() const { return _properties.getPhysicalDimensions(); }

    inline const Extent2D& getPhysicalResolution() const { return _properties.getPhysicalResolution(); }

    inline SurfaceTransformFlagsKHR getSupportedTransforms() const { return _properties.getSupportedTransforms(); }

    inline bool getPlaneReorderPossible() const { return _properties.getPlaneReorderPossible() != 0; }

    inline bool getPersistentContent() const { return _properties.getPersistentContent() != 0; }
};
} // namespace impl
} // namespace pvrvk