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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 g_renderer = o3d::Renderer::CreateDefaultRenderer(g_service_locator); | 153 g_renderer = o3d::Renderer::CreateDefaultRenderer(g_service_locator); |
154 | 154 |
155 // Initialize the renderer for off-screen rendering if kOffScreenRenderer | 155 // Initialize the renderer for off-screen rendering if kOffScreenRenderer |
156 // is in the environment. | 156 // is in the environment. |
157 bool success; | 157 bool success; |
158 o3d::DisplayWindowWindows* display_window = | 158 o3d::DisplayWindowWindows* display_window = |
159 new o3d::DisplayWindowWindows(); | 159 new o3d::DisplayWindowWindows(); |
160 display_window = display_window; | 160 display_window = display_window; |
161 display_window->set_hwnd(g_window_handle); | 161 display_window->set_hwnd(g_window_handle); |
162 g_display_window = display_window; | 162 g_display_window = display_window; |
163 bool offscreen = ::GetEnvironmentVariableW(kOffScreenRenderer, NULL, 0); | 163 bool offscreen = (::GetEnvironmentVariableW(kOffScreenRenderer, |
| 164 NULL, 0) == 0); |
164 if (offscreen) { | 165 if (offscreen) { |
165 success = | 166 success = |
166 g_renderer->Init(*g_display_window, true) == o3d::Renderer::SUCCESS; | 167 g_renderer->Init(*g_display_window, true) == o3d::Renderer::SUCCESS; |
167 } else { | 168 } else { |
168 success = | 169 success = |
169 g_renderer->Init(*g_display_window, false) == o3d::Renderer::SUCCESS; | 170 g_renderer->Init(*g_display_window, false) == o3d::Renderer::SUCCESS; |
170 if (success) { | 171 if (success) { |
171 ::SetWindowPos(g_window_handle, HWND_TOPMOST, 0, 0, 0, 0, | 172 ::SetWindowPos(g_window_handle, HWND_TOPMOST, 0, 0, 0, 0, |
172 SWP_NOMOVE | SWP_NOSIZE); | 173 SWP_NOMOVE | SWP_NOSIZE); |
173 ::ShowWindow(g_window_handle, SW_SHOWNORMAL); | 174 ::ShowWindow(g_window_handle, SW_SHOWNORMAL); |
(...skipping 19 matching lines...) Expand all Loading... |
193 delete g_renderer; | 194 delete g_renderer; |
194 g_renderer = NULL; | 195 g_renderer = NULL; |
195 | 196 |
196 delete display_window; | 197 delete display_window; |
197 g_display_window = NULL; | 198 g_display_window = NULL; |
198 g_program_path = NULL; | 199 g_program_path = NULL; |
199 g_program_name = NULL; | 200 g_program_name = NULL; |
200 | 201 |
201 return ret; | 202 return ret; |
202 } | 203 } |
OLD | NEW |