DisplayModeVk.h#

The DisplayMode class.

Includes#

  • PVRVk/DebugUtilsVk.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"

namespace pvrvk {
struct DisplayModeCreateInfo
{
public:
    DisplayModeCreateInfo() : _flags(DisplayModeCreateFlagsKHR::e_NONE), _parameters(DisplayModeParametersKHR()) {}

    DisplayModeCreateInfo(DisplayModeParametersKHR parameters, DisplayModeCreateFlagsKHR flags = DisplayModeCreateFlagsKHR::e_NONE) : _flags(flags), _parameters(parameters) {}

    DisplayModeCreateFlagsKHR getFlags() const { return _flags; }

    DisplayModeCreateInfo& setFlags(DisplayModeCreateFlagsKHR flags)
    {
        this->_flags = flags;
        return *this;
    }

    DisplayModeParametersKHR getParameters() const { return _parameters; }

    DisplayModeCreateInfo& setParameters(DisplayModeParametersKHR parameters)
    {
        this->_parameters = parameters;
        return *this;
    }

private:
    DisplayModeCreateFlagsKHR _flags;
    DisplayModeParametersKHR _parameters;
};

namespace impl {
class DisplayMode_ : public PVRVkPhysicalDeviceObjectBase<VkDisplayModeKHR, ObjectType::e_DISPLAY_MODE_KHR>
{
private:
    friend class PhysicalDevice_;
    friend class Display_;

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

    static DisplayMode constructShared(const PhysicalDeviceWeakPtr& physicalDevice, const DisplayModePropertiesKHR& displayModeProperties)
    {
        return std::make_shared<DisplayMode_>(make_shared_enabler{}, physicalDevice, displayModeProperties);
    }

    static DisplayMode constructShared(const PhysicalDeviceWeakPtr& physicalDevice, pvrvk::Display& display, const pvrvk::DisplayModeCreateInfo& displayModeCreateInfo)
    {
        return std::make_shared<DisplayMode_>(make_shared_enabler{}, physicalDevice, display, displayModeCreateInfo);
    }

    DisplayModeParametersKHR _parameters;

public:
    DECLARE_NO_COPY_SEMANTICS(DisplayMode_)
    DisplayMode_(make_shared_enabler, const PhysicalDeviceWeakPtr& physicalDevice, const DisplayModePropertiesKHR& displayModeProperties);
    DisplayMode_(make_shared_enabler, const PhysicalDeviceWeakPtr& physicalDevice, pvrvk::Display& display, const pvrvk::DisplayModeCreateInfo& displayModeCreateInfo);

    DisplayModeParametersKHR getParameters() const { return _parameters; }
};
} // namespace impl
} // namespace pvrvk