Game
Vulkan Resolution - Unreal Engine Plugin



4 months ago

I've made a plugin for Unreal Engine that fetches monitor's information and makes an array of all possible screen resolutions based on the aspect ratio.

This plugin is primarily intended for Vulkan, as Get Screen Resolutions have not been implemented.


This plugin was developed for UE4 4.26.2 and has been tested on versions 4.27 and 5.2.

Function Breakdown

1. Get Supported Resolutions

This function retrieves a list of supported screen resolutions for a specified monitor. It takes an integer MonitorIndex as input, which indicates which monitor's resolutions to fetch.

  • Obtains the display metrics for all connected monitors.

  • Checks if the provided MonitorIndex is valid; if not, it adjusts it to the last monitor.

  • Calculates the aspect ratio of the monitor by finding the greatest common divisor (GCD) of its width and height.

  • Generates a list of possible resolutions based on the aspect ratio.

  • Includes the current monitor's native resolution in the list.

  • Returns an array of FIntPoint structures representing the supported resolutions.

2. Get Primary Monitor's Supported Resolutions

This function calls GetSupportedResolutions with an argument of 0, which corresponds to the primary monitor. It returns the list of supported resolutions for the primary monitor.

3. Get Monitor Info

This function retrieves detailed information about a specific monitor based on the provided MonitorIndex.

Name: The name of the monitor.
ID: The unique identifier of the monitor.
NativeWidth: The native width of the monitor.
NativeHeight: The native height of the monitor.
MaxResolution: The maximum supported resolution of the monitor.
bIsPrimary: A boolean indicating whether the monitor is the primary monitor.
DPI: The dots per inch (DPI) of the monitor.

4. Get Number Of Connected Monitors

Basically just returns the number of monitors currently connected to the system.


I've also made Patreon, I'm planning on doing some patreon exclusive content.



2 comments

Loading...

Next up

Looks kinda goofy

Added Details

Now I gotta work on AI Culling

Our 2024 Advent Calendar has opened! Day 18: @Otis_Le_PoOtis is the Creator of Bondee’s Barnyard and posts updates about their dev journey and their work on the sequel!) Accept the quest and give them a follow to get Coins and a seasonal sticker!

Android port was a bust

But I've used it as an opportunity to make the pc version better

Happy #WIPWednesday!

Are you working on a game?

Making some art?

Practicing a song?

Something else?

Tell us in the comments!

Tf is this?

Android Port Update

I managed to optimize it and get it to around 50fps, (locked it to 30 for stability)

Occassional dips here and there when loading, but overall, it's playable

@Miles_Games is a Jolter to Watch! They post great game dev updates about the holiday-themed platformer TEAM SLAY-BELLS! Follow them before the quest ends on December 24 and you'll get Coins!

Kitty and fennec