xref: /haiku/src/tests/kits/interface/ScreenTest.cpp (revision 15074e05613bb25d762ca0dddc77712920d7197d)
1 #include <Application.h>
2 #include <Screen.h>
3 
4 #include <stdio.h>
5 #include <string.h>
6 
7 // TODO: very basic, will need to be extended
8 int main()
9 {
10 	BApplication app("application/x-vnd.BScreenTest");
11 	BScreen screen;
12 	display_mode mode;
13 
14 	if (!screen.IsValid()) {
15 		printf("Invalid BScreen object\n");
16 		exit(-1);
17 	}
18 
19 	status_t status = screen.GetMode(&mode);
20 	if (status < B_OK)
21 		printf("%s\n", strerror(status));
22 	else
23 		printf("width: %d, height: %d\n", mode.virtual_width, mode.virtual_height);
24 
25 	printf("Screen frame: \n");
26 	screen.Frame().PrintToStream();
27 }