ScreenTest: style fixes.
This commit is contained in:
@@ -8,30 +8,30 @@ int main()
|
|||||||
{
|
{
|
||||||
BApplication app("application/x-vnd.BScreenTest");
|
BApplication app("application/x-vnd.BScreenTest");
|
||||||
BScreen screen;
|
BScreen screen;
|
||||||
|
|
||||||
if (!screen.IsValid()) {
|
if (!screen.IsValid()) {
|
||||||
printf("Invalid BScreen object\n");
|
printf("Invalid BScreen object\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
display_mode oldMode;
|
display_mode oldMode;
|
||||||
status_t status = screen.GetMode(&oldMode);
|
status_t status = screen.GetMode(&oldMode);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
printf("%s\n", strerror(status));
|
printf("%s\n", strerror(status));
|
||||||
else
|
else
|
||||||
printf("width: %d, height: %d, space: %lu\n",
|
printf("width: %d, height: %d, space: %lu\n",
|
||||||
oldMode.virtual_width,
|
oldMode.virtual_width,
|
||||||
oldMode.virtual_height,
|
oldMode.virtual_height,
|
||||||
oldMode.space);
|
oldMode.space);
|
||||||
|
|
||||||
printf("Screen frame: ");
|
printf("Screen frame: ");
|
||||||
screen.Frame().PrintToStream();
|
screen.Frame().PrintToStream();
|
||||||
|
|
||||||
printf("\nTrying to set mode to 800x600: ");
|
printf("\nTrying to set mode to 800x600: ");
|
||||||
display_mode newMode = oldMode;
|
display_mode newMode = oldMode;
|
||||||
newMode.virtual_width = 800;
|
newMode.virtual_width = 800;
|
||||||
newMode.virtual_height = 600;
|
newMode.virtual_height = 600;
|
||||||
|
|
||||||
status = screen.SetMode(&newMode);
|
status = screen.SetMode(&newMode);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
printf("FAILED (%s)\n", strerror(status));
|
printf("FAILED (%s)\n", strerror(status));
|
||||||
@@ -42,17 +42,17 @@ int main()
|
|||||||
printf("%s\n", strerror(status));
|
printf("%s\n", strerror(status));
|
||||||
else {
|
else {
|
||||||
printf("width: %d, height: %d, space: %lu\n",
|
printf("width: %d, height: %d, space: %lu\n",
|
||||||
newMode.virtual_width,
|
newMode.virtual_width,
|
||||||
newMode.virtual_height,
|
newMode.virtual_height,
|
||||||
newMode.space);
|
newMode.space);
|
||||||
printf("Screen frame: ");
|
printf("Screen frame: ");
|
||||||
screen.Frame().PrintToStream();
|
screen.Frame().PrintToStream();
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
snooze(4000000);
|
snooze(4000000);
|
||||||
|
|
||||||
printf("resetting video mode: ");
|
printf("resetting video mode: ");
|
||||||
status = screen.SetMode(&oldMode);
|
status = screen.SetMode(&oldMode);
|
||||||
if (status < B_OK)
|
if (status < B_OK)
|
||||||
|
|||||||
Reference in New Issue
Block a user