| 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 time or if you call ClearErrorCallback. | 468 time or if you call ClearErrorCallback. |
| 469 %] | 469 %] |
| 470 void ClearErrorCallback(); | 470 void ClearErrorCallback(); |
| 471 | 471 |
| 472 %[ | 472 %[ |
| 473 Makes all parameters get re-evaluated. | 473 Makes all parameters get re-evaluated. |
| 474 %] | 474 %] |
| 475 void InvalidateAllParameters(); | 475 void InvalidateAllParameters(); |
| 476 | 476 |
| 477 %[ | 477 %[ |
| 478 This function is only available in the test version of the plugin. | 478 Gets a copy of the current backbuffer of O3D as a data: url. |
| 479 \param file_name Name to save screenshot to. | 479 |
| 480 \return True on success. | 480 NOTE: Calling it will cause a render to happen. |
| 481 |
| 482 \return A Data URL for the backbuffer. |
| 481 %] | 483 %] |
| 482 bool SaveScreen(String file_name); | 484 String ToDataURL(); |
| 485 |
| 486 %[ |
| 487 Gets a copy of the current backbuffer of O3D as a data: url. |
| 488 \param mime_type The type of data url you want. Currently O3D only supports |
| 489 image/png. See HTML5 canvas tag for info about toDataURL. |
| 490 \return A Data URL for the backbuffer. |
| 491 %] |
| 492 [userglue] String ToDataURL(String mime_type); |
| 483 | 493 |
| 484 %[ | 494 %[ |
| 485 Returns the status of initializing the renderer so we can display the | 495 Returns the status of initializing the renderer so we can display the |
| 486 appropriate message. We require a certain minimum set of graphics | 496 appropriate message. We require a certain minimum set of graphics |
| 487 capabilities. If the user's computer does not have his minimum | 497 capabilities. If the user's computer does not have his minimum |
| 488 set this will be GPU_NOT_UP_TO_SPEC. If the user is out of graphics | 498 set this will be GPU_NOT_UP_TO_SPEC. If the user is out of graphics |
| 489 resources this will be OUT_OF_RESOURCES. If some other error happened this | 499 resources this will be OUT_OF_RESOURCES. If some other error happened this |
| 490 will be INITIALIZATION_ERROR. Otherwise it will be SUCCESS. | 500 will be INITIALIZATION_ERROR. Otherwise it will be SUCCESS. |
| 491 %] | 501 %] |
| 492 [userglue_getter, getter, plugin_data] | 502 [userglue_getter, getter, plugin_data] |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 plugin->service_locator()->GetService<o3d::ClientInfoManager>(); | 577 plugin->service_locator()->GetService<o3d::ClientInfoManager>(); |
| 568 return client_info_manager->client_info(); | 578 return client_info_manager->client_info(); |
| 569 } | 579 } |
| 570 std::vector<o3d::DisplayMode> userglue_method_GetDisplayModes( | 580 std::vector<o3d::DisplayMode> userglue_method_GetDisplayModes( |
| 571 void *plugin_data, o3d::Client *self) { | 581 void *plugin_data, o3d::Client *self) { |
| 572 std::vector<o3d::DisplayMode> modes; | 582 std::vector<o3d::DisplayMode> modes; |
| 573 static_cast<glue::_o3d::PluginObject*>(plugin_data)->GetDisplayModes( | 583 static_cast<glue::_o3d::PluginObject*>(plugin_data)->GetDisplayModes( |
| 574 &modes); | 584 &modes); |
| 575 return modes; | 585 return modes; |
| 576 } | 586 } |
| 587 o3d::String userglue_method_ToDataURL(o3d::Client* self, |
| 588 const o3d::String& mime_type) { |
| 589 // We ignore the mime_type since it's only a suggestion |
| 590 // and we only return the required image/png type. |
| 591 return self->ToDataURL(); |
| 592 } |
| 577 void userglue_method_SetFullscreenClickRegion( | 593 void userglue_method_SetFullscreenClickRegion( |
| 578 void *plugin_data, o3d::Client *self, int x, int y, int width, | 594 void *plugin_data, o3d::Client *self, int x, int y, int width, |
| 579 int height, int mode_id) { | 595 int height, int mode_id) { |
| 580 glue::_o3d::PluginObject *plugin = | 596 glue::_o3d::PluginObject *plugin = |
| 581 static_cast<glue::_o3d::PluginObject*>(plugin_data); | 597 static_cast<glue::_o3d::PluginObject*>(plugin_data); |
| 582 if (!plugin->SetFullscreenClickRegion(x, y, width, height, mode_id)) { | 598 if (!plugin->SetFullscreenClickRegion(x, y, width, height, mode_id)) { |
| 583 O3D_ERROR(plugin->service_locator()) | 599 O3D_ERROR(plugin->service_locator()) |
| 584 << "Call to SetFullscreenClickRegion failed."; | 600 << "Call to SetFullscreenClickRegion failed."; |
| 585 } | 601 } |
| 586 } | 602 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 o3d::Renderer::InitStatus userglue_getter_renderer_init_status( | 643 o3d::Renderer::InitStatus userglue_getter_renderer_init_status( |
| 628 void* plugin_data, o3d::Client*) { | 644 void* plugin_data, o3d::Client*) { |
| 629 return static_cast<glue::_o3d::PluginObject*>( | 645 return static_cast<glue::_o3d::PluginObject*>( |
| 630 plugin_data)->renderer_init_status(); | 646 plugin_data)->renderer_init_status(); |
| 631 } | 647 } |
| 632 %} | 648 %} |
| 633 }; | 649 }; |
| 634 | 650 |
| 635 | 651 |
| 636 } // namespace o3d | 652 } // namespace o3d |
| OLD | NEW |