xref: /haiku/src/tests/kits/opengl/glinfo/OpenGLWindow.cpp (revision 1deede7388b04dbeec5af85cae7164735ea9e70d)
1 /*
2  * Copyright 2009-2012 Haiku Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		John Scipione <jscipione@gmail.com>
7  *		Artur Wyszynski <harakash@gmail.com>
8  */
9 
10 
11 #include "OpenGLWindow.h"
12 
13 #include <Application.h>
14 #include <Catalog.h>
15 #include <GroupLayout.h>
16 
17 #include "OpenGLView.h"
18 
19 
20 #undef B_TRANSLATION_CONTEXT
21 #define B_TRANSLATION_CONTEXT "OpenGLWindow"
22 
23 
24 OpenGLWindow::OpenGLWindow()
25 	:
26 	BWindow(BRect(50, 50, 300, 400),
27 		B_TRANSLATE_SYSTEM_NAME("GL Info"), B_TITLED_WINDOW,
28 		B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE
29 		| B_AUTO_UPDATE_SIZE_LIMITS)
30 {
31 	SetLayout(new BGroupLayout(B_VERTICAL));
32 	fView = new OpenGLView();
33 	GetLayout()->AddView(fView);
34 	CenterOnScreen();
35 }
36 
37 
38 OpenGLWindow::~OpenGLWindow()
39 {
40 }
41 
42 
43 bool
44 OpenGLWindow::QuitRequested()
45 {
46 	be_app->PostMessage(B_QUIT_REQUESTED);
47 	return true;
48 }
49 
50 
51 void
52 OpenGLWindow::MessageReceived(BMessage* message)
53 {
54 	switch (message->what) {
55 		default:
56 			BWindow::MessageReceived(message);
57 	}
58 }
59