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 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 if (hr == D3DERR_DEVICELOST) { | 1259 if (hr == D3DERR_DEVICELOST) { |
1260 // We've lost the device, update the flag so that render calls don't | 1260 // We've lost the device, update the flag so that render calls don't |
1261 // get called. | 1261 // get called. |
1262 have_device_ = false; | 1262 have_device_ = false; |
1263 set_need_to_render(true); | 1263 set_need_to_render(true); |
1264 return; | 1264 return; |
1265 } else if (hr == D3DERR_DEVICENOTRESET) { | 1265 } else if (hr == D3DERR_DEVICENOTRESET) { |
1266 // Direct3d tells us it is possible to reset the device now.. | 1266 // Direct3d tells us it is possible to reset the device now.. |
1267 // So let's attempt a reset! | 1267 // So let's attempt a reset! |
1268 if (ResetDevice()) { | 1268 if (ResetDevice()) { |
1269 lost_resources_callback_manager_.Run(); | 1269 CallLostResourcesCallback(); |
1270 } | 1270 } |
1271 } | 1271 } |
1272 } | 1272 } |
1273 | 1273 |
1274 // The window has been resized; change the size of our back buffer | 1274 // The window has been resized; change the size of our back buffer |
1275 // and do a reset. | 1275 // and do a reset. |
1276 void RendererD3D9::Resize(int width, int height) { | 1276 void RendererD3D9::Resize(int width, int height) { |
1277 if (width > 0 && height > 0) { | 1277 if (width > 0 && height > 0) { |
1278 // New size of back buffer | 1278 // New size of back buffer |
1279 d3d_present_parameters_.BackBufferWidth = width; | 1279 d3d_present_parameters_.BackBufferWidth = width; |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1631 static int swizzle_table[] = { 2, 1, 0, 3, }; | 1631 static int swizzle_table[] = { 2, 1, 0, 3, }; |
1632 return swizzle_table; | 1632 return swizzle_table; |
1633 } | 1633 } |
1634 | 1634 |
1635 // This is a factory function for creating Renderer objects. Since | 1635 // This is a factory function for creating Renderer objects. Since |
1636 // we're implementing D3D9, we only ever return a D3D9 renderer. | 1636 // we're implementing D3D9, we only ever return a D3D9 renderer. |
1637 Renderer* Renderer::CreateDefaultRenderer(ServiceLocator* service_locator) { | 1637 Renderer* Renderer::CreateDefaultRenderer(ServiceLocator* service_locator) { |
1638 return RendererD3D9::CreateDefault(service_locator); | 1638 return RendererD3D9::CreateDefault(service_locator); |
1639 } | 1639 } |
1640 } // namespace o3d | 1640 } // namespace o3d |
OLD | NEW |