OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 using o3d::DisplayWindowWindows; | 60 using o3d::DisplayWindowWindows; |
61 | 61 |
62 #if defined(RENDERER_CB) | 62 #if defined(RENDERER_CB) |
63 using o3d::DisplayWindowCB; | 63 using o3d::DisplayWindowCB; |
64 using o3d::gpu_plugin::CommandBuffer; | 64 using o3d::gpu_plugin::CommandBuffer; |
65 using o3d::gpu_plugin::NPObjectPointer; | 65 using o3d::gpu_plugin::NPObjectPointer; |
66 using o3d::gpu_plugin::StubNPBrowser; | 66 using o3d::gpu_plugin::StubNPBrowser; |
67 using o3d::RendererCBLocal; | 67 using o3d::RendererCBLocal; |
68 #endif | 68 #endif |
69 | 69 |
70 const int kWindowWidth = 512; | 70 const int kWindowWidth = 16; |
71 const int kWindowHeight = 512; | 71 const int kWindowHeight = 16; |
72 | 72 |
73 o3d::ServiceLocator* g_service_locator = NULL; | 73 o3d::ServiceLocator* g_service_locator = NULL; |
74 o3d::DisplayWindow* g_display_window = NULL; | 74 o3d::DisplayWindow* g_display_window = NULL; |
75 | 75 |
76 HWND g_window_handle = NULL; | 76 HWND g_window_handle = NULL; |
77 | 77 |
78 o3d::String *g_program_path = NULL; | 78 o3d::String *g_program_path = NULL; |
79 o3d::String *g_program_name = NULL; | 79 o3d::String *g_program_name = NULL; |
80 o3d::Renderer* g_renderer = NULL; | 80 o3d::Renderer* g_renderer = NULL; |
81 | 81 |
(...skipping 20 matching lines...) Expand all Loading... |
102 ::SetUnhandledExceptionFilter(LocalUnhandledExceptionFilter); | 102 ::SetUnhandledExceptionFilter(LocalUnhandledExceptionFilter); |
103 | 103 |
104 std::string error; | 104 std::string error; |
105 if (!o3d::RendererInstallCheck(&error)) { | 105 if (!o3d::RendererInstallCheck(&error)) { |
106 return false; | 106 return false; |
107 } | 107 } |
108 WNDCLASSEX wc = {0}; | 108 WNDCLASSEX wc = {0}; |
109 | 109 |
110 wc.lpszClassName = L"MY_WINDOWS_CLASS"; | 110 wc.lpszClassName = L"MY_WINDOWS_CLASS"; |
111 wc.cbSize = sizeof(WNDCLASSEX); | 111 wc.cbSize = sizeof(WNDCLASSEX); |
112 wc.style = CS_HREDRAW | CS_VREDRAW; | 112 wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; |
113 wc.lpfnWndProc = ::WindowProc; | 113 wc.lpfnWndProc = ::WindowProc; |
114 wc.cbClsExtra = 0; | 114 wc.cbClsExtra = 0; |
115 wc.cbWndExtra = 0; | 115 wc.cbWndExtra = 0; |
116 wc.hInstance = instance; | 116 wc.hInstance = instance; |
117 wc.hIcon = ::LoadIcon(instance, IDI_APPLICATION); | 117 wc.hIcon = ::LoadIcon(instance, IDI_APPLICATION); |
118 wc.hIconSm = NULL; | 118 wc.hIconSm = NULL; |
119 wc.hCursor = ::LoadCursor(instance, IDC_ARROW); | 119 wc.hCursor = ::LoadCursor(instance, IDC_ARROW); |
120 wc.hbrBackground = static_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)); | 120 wc.hbrBackground = static_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)); |
121 wc.lpszMenuName = NULL; | 121 wc.lpszMenuName = NULL; |
122 | 122 |
123 if (!::RegisterClassEx(&wc)) | 123 if (!::RegisterClassEx(&wc)) |
124 return false; | 124 return false; |
125 | 125 |
126 // Leaving this window onscreen leads to a redraw error which makes it | 126 // Leaving this window onscreen leads to a redraw error which makes it |
127 // a hassle to debug tests in an IDE, so we place the window somewhere that | 127 // a hassle to debug tests in an IDE, so we place the window somewhere that |
128 // won't happen. | 128 // won't happen. |
129 g_window_handle = ::CreateWindowExW(NULL, | 129 g_window_handle = ::CreateWindowExW(NULL, |
130 wc.lpszClassName, | 130 wc.lpszClassName, |
131 L"", | 131 L"", |
132 WS_OVERLAPPEDWINDOW, | 132 WS_OVERLAPPEDWINDOW, |
133 -1000, | 133 10, |
134 0, | 134 10, |
135 kWindowWidth, | 135 kWindowWidth, |
136 kWindowHeight, | 136 kWindowHeight, |
137 0, | 137 0, |
138 0, | 138 0, |
139 instance, | 139 instance, |
140 0); | 140 0); |
141 | 141 |
142 if (g_window_handle == NULL) | 142 if (g_window_handle == NULL) |
143 return false; | 143 return false; |
144 | 144 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 delete g_renderer; | 238 delete g_renderer; |
239 g_renderer = NULL; | 239 g_renderer = NULL; |
240 | 240 |
241 delete display_window; | 241 delete display_window; |
242 g_display_window = NULL; | 242 g_display_window = NULL; |
243 g_program_path = NULL; | 243 g_program_path = NULL; |
244 g_program_name = NULL; | 244 g_program_name = NULL; |
245 | 245 |
246 return ret; | 246 return ret; |
247 } | 247 } |
OLD | NEW |