xref: /haiku/src/apps/haiku3d/MainWindow.cpp (revision 21258e2674226d6aa732321b6f8494841895af5f)
1 /*
2  * Copyright 2009, Haiku Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  * 		Alexandre Deckner <alex@zappotek.com>
7  */
8 
9 #include "MainWindow.h"
10 #include "RenderView.h"
11 
12 #include <Application.h>
13 #include <MenuBar.h>
14 #include <MenuItem.h>
15 
16 #include <stdio.h>
17 
18 MainWindow::MainWindow(BRect frame, const char* title)
19 	:
20 	BDirectWindow(frame, title, B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 0)
21 {
22 	fRenderView = new RenderView(Bounds());
23 	fRenderView->SetViewColor(0, 0, 0);
24 
25 	AddChild(fRenderView);
26 	Show();
27 }
28 
29 
30 MainWindow::~MainWindow()
31 {
32 }
33 
34 
35 bool
36 MainWindow::QuitRequested()
37 {
38 	be_app->PostMessage(B_QUIT_REQUESTED);
39 	return true;
40 }
41 
42 
43 void
44 MainWindow::MessageReceived(BMessage* message)
45 {
46 	switch (message->what) {
47 		default:
48 			BDirectWindow::MessageReceived(message);
49 	}
50 }
51 
52 
53 void
54 MainWindow::DirectConnected(direct_buffer_info* info)
55 {
56 	fRenderView->DirectConnected(info);
57 }
58