RetroArch/deps/switchres/examples/test_liblink.cpp
Subs f24893bcb1
[CRT] Add KMS modeswitch (#15131)
* Prepare to update deps/switchres

* Squashed 'deps/switchres/' content from commit ca72648b32

git-subtree-dir: deps/switchres
git-subtree-split: ca72648b3253eca8c5addf64d1e4aa1c43f5db94

* Add CRT modeswitching to KMS
Display the real refresh rate
Enable the CRT SwitchRes menu
Add another switchres.ini path for Lakka
2023-03-25 11:57:10 +01:00

37 lines
736 B
C++

#include <stdio.h>
#include <stdlib.h>
#include <switchres/switchres_wrapper.h>
int main(int argc, char** argv)
{
sr_mode srm;
int ret;
sr_init();
sr_init_disp(NULL, NULL);
ret = sr_add_mode(384, 224, 59.63, 0, &srm);
if (!ret)
{
printf("ERROR: Couldn't add the required mode. Exiting!\n");
sr_deinit();
exit(1);
}
printf("SR returned resolution: %dx%d@%f%s\n", srm.width, srm.height, srm.refresh, srm.interlace? "i" : "");
printf("Press any key to switch to new mode\n");
getchar();
ret = sr_switch_to_mode(384, 224, 59.63, 0, &srm);
if (!ret)
{
printf("ERROR: Couldn't switch to the required mode. Exiting!\n");
sr_deinit();
exit(1);
}
printf("Press any key to quit.\n");
getchar();
sr_deinit();
}