bmx-ng / sdl.mod

SDL backend for BlitzMax
7 stars 6 forks source link

DesktopDepth() returns "format", not bitdepth #37

Closed GWRon closed 2 years ago

GWRon commented 2 years ago

int bmx_SDL_GetDisplayDepth(int display) {
    SDL_DisplayMode mode;
    SDL_GetCurrentDisplayMode(display, &mode);
    return mode.format; // TODO - make this a proper bit depth number
}

could at least be extended similar to the latest adjustments regarding "displaymodes":

int bmx_SDL_GetDisplayDepth(int display) {
    SDL_DisplayMode mode;
    SDL_GetCurrentDisplayMode(display, &mode);
    switch(mode.format) {
        case SDL_PIXELFORMAT_RGBA8888:
            return 32;
        case SDL_PIXELFORMAT_RGB888:
            return 24;
    }
    return mode.format; // TODO - make this a proper bit depth number
}
GWRon commented 2 years ago

Fixed in https://github.com/bmx-ng/sdl.mod/commit/5e036c1e2f1bcffbab0bea2700534a9017e1a1f1