Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated display mode struct #112

Open
andrews05 opened this issue Feb 21, 2023 · 0 comments
Open

Updated display mode struct #112

andrews05 opened this issue Feb 21, 2023 · 0 comments

Comments

@andrews05
Copy link

Just FYI, I've put together a more detailed version of the private struct for display mode descriptions.

typedef struct CGSDisplayModeDescription {
    uint32_t ioDisplayModeID_alt;   // Should be the same as ioDisplayMode
    uint32_t ioFlags_alt;           // Mostly the same but slightly different to ioFlags
    uint32_t width;
    uint32_t height;
    uint32_t maxDepthIndex;
    uint32_t bytesPerRow;
    uint32_t bitsPerPixel;
    uint32_t bitsPerSample;
    uint32_t samplesPerPixel;
    uint32_t refreshRate;
    uint32_t unknown[2];
    char pixelEncoding[64];
    uint32_t unknown2[19];
    uint32_t refreshRate_fixed;     // 16.16 fixed fraction
    uint32_t ioFlags;
    uint32_t ioDisplayModeID;
    uint32_t pixelWidth;
    uint32_t pixelHeight;
    float backingScaleFactor;
} CGSDisplayModeDescription;

The following documents were helpful references for this:
https://developer.apple.com/documentation/coregraphics/cgdisplaymode
https://developer.apple.com/documentation/coregraphics/quartz_display_services/display_mode_standard_properties
https://github.com/aosm/IOGraphics/blob/ae89a5073a37ffd77cfb964921e05fc90810dbb8/IOGraphicsFamily/IOKit/graphics/IOGraphicsTypes.h#L128

@andrews05 andrews05 changed the title Update display mode struct Updated display mode struct Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant