renderer_compositor.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*************************************************************************/
  2. /* renderer_compositor.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifndef RENDERING_SERVER_COMPOSITOR_H
  31. #define RENDERING_SERVER_COMPOSITOR_H
  32. #include "core/math/camera_matrix.h"
  33. #include "core/templates/pair.h"
  34. #include "core/templates/self_list.h"
  35. #include "servers/rendering/renderer_canvas_render.h"
  36. #include "servers/rendering/renderer_scene.h"
  37. #include "servers/rendering/renderer_scene_render.h"
  38. #include "servers/rendering/renderer_storage.h"
  39. #include "servers/rendering_server.h"
  40. class RendererCompositor {
  41. protected:
  42. static RendererCompositor *(*_create_func)();
  43. public:
  44. static RendererCompositor *create();
  45. virtual RendererStorage *get_storage() = 0;
  46. virtual RendererCanvasRender *get_canvas() = 0;
  47. virtual RendererSceneRender *get_scene() = 0;
  48. virtual void set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale, bool p_use_filter = true) = 0;
  49. virtual void initialize() = 0;
  50. virtual void begin_frame(double frame_step) = 0;
  51. struct BlitToScreen {
  52. RID render_target;
  53. Rect2i rect;
  54. //lens distorted parameters for VR should go here
  55. };
  56. virtual void prepare_for_blitting_render_targets() = 0;
  57. virtual void blit_render_targets_to_screen(DisplayServer::WindowID p_screen, const BlitToScreen *p_render_targets, int p_amount) = 0;
  58. virtual void end_frame(bool p_swap_buffers) = 0;
  59. virtual void finalize() = 0;
  60. virtual uint64_t get_frame_number() const = 0;
  61. virtual float get_frame_delta_time() const = 0;
  62. virtual bool is_low_end() const = 0;
  63. virtual ~RendererCompositor() {}
  64. };
  65. #endif // RASTERIZER_H