GraphicsEvents.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. // Copyright (c) 2008-2023 the Urho3D project
  2. // License: MIT
  3. #pragma once
  4. #include "../Core/Object.h"
  5. namespace Urho3D
  6. {
  7. /// New screen mode set.
  8. URHO3D_EVENT(E_SCREENMODE, ScreenMode)
  9. {
  10. URHO3D_PARAM(P_WIDTH, Width); // int
  11. URHO3D_PARAM(P_HEIGHT, Height); // int
  12. URHO3D_PARAM(P_FULLSCREEN, Fullscreen); // bool
  13. URHO3D_PARAM(P_BORDERLESS, Borderless); // bool
  14. URHO3D_PARAM(P_RESIZABLE, Resizable); // bool
  15. URHO3D_PARAM(P_HIGHDPI, HighDPI); // bool
  16. URHO3D_PARAM(P_MONITOR, Monitor); // int
  17. URHO3D_PARAM(P_REFRESHRATE, RefreshRate); // int
  18. }
  19. /// Window position changed.
  20. URHO3D_EVENT(E_WINDOWPOS, WindowPos)
  21. {
  22. URHO3D_PARAM(P_X, X); // int
  23. URHO3D_PARAM(P_Y, Y); // int
  24. }
  25. /// Request for queuing rendersurfaces either in manual or always-update mode.
  26. URHO3D_EVENT(E_RENDERSURFACEUPDATE, RenderSurfaceUpdate)
  27. {
  28. }
  29. /// Frame rendering started.
  30. URHO3D_EVENT(E_BEGINRENDERING, BeginRendering)
  31. {
  32. }
  33. /// Frame rendering ended.
  34. URHO3D_EVENT(E_ENDRENDERING, EndRendering)
  35. {
  36. }
  37. /// Update of a view started.
  38. URHO3D_EVENT(E_BEGINVIEWUPDATE, BeginViewUpdate)
  39. {
  40. URHO3D_PARAM(P_VIEW, View); // View pointer
  41. URHO3D_PARAM(P_TEXTURE, Texture); // Texture pointer
  42. URHO3D_PARAM(P_SURFACE, Surface); // RenderSurface pointer
  43. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  44. URHO3D_PARAM(P_CAMERA, Camera); // Camera pointer
  45. }
  46. /// Update of a view ended.
  47. URHO3D_EVENT(E_ENDVIEWUPDATE, EndViewUpdate)
  48. {
  49. URHO3D_PARAM(P_VIEW, View); // View pointer
  50. URHO3D_PARAM(P_TEXTURE, Texture); // Texture pointer
  51. URHO3D_PARAM(P_SURFACE, Surface); // RenderSurface pointer
  52. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  53. URHO3D_PARAM(P_CAMERA, Camera); // Camera pointer
  54. }
  55. /// Render of a view started.
  56. URHO3D_EVENT(E_BEGINVIEWRENDER, BeginViewRender)
  57. {
  58. URHO3D_PARAM(P_VIEW, View); // View pointer
  59. URHO3D_PARAM(P_TEXTURE, Texture); // Texture pointer
  60. URHO3D_PARAM(P_SURFACE, Surface); // RenderSurface pointer
  61. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  62. URHO3D_PARAM(P_CAMERA, Camera); // Camera pointer
  63. }
  64. /// A view has allocated its screen buffers for rendering. They can be accessed now with View::FindNamedTexture().
  65. URHO3D_EVENT(E_VIEWBUFFERSREADY, ViewBuffersReady)
  66. {
  67. URHO3D_PARAM(P_VIEW, View); // View pointer
  68. URHO3D_PARAM(P_TEXTURE, Texture); // Texture pointer
  69. URHO3D_PARAM(P_SURFACE, Surface); // RenderSurface pointer
  70. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  71. URHO3D_PARAM(P_CAMERA, Camera); // Camera pointer
  72. }
  73. /// A view has set global shader parameters for a new combination of vertex/pixel shaders. Custom global parameters can now be set.
  74. URHO3D_EVENT(E_VIEWGLOBALSHADERPARAMETERS, ViewGlobalShaderParameters)
  75. {
  76. URHO3D_PARAM(P_VIEW, View); // View pointer
  77. URHO3D_PARAM(P_TEXTURE, Texture); // Texture pointer
  78. URHO3D_PARAM(P_SURFACE, Surface); // RenderSurface pointer
  79. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  80. URHO3D_PARAM(P_CAMERA, Camera); // Camera pointer
  81. }
  82. /// Render of a view ended. Its screen buffers are still accessible if needed.
  83. URHO3D_EVENT(E_ENDVIEWRENDER, EndViewRender)
  84. {
  85. URHO3D_PARAM(P_VIEW, View); // View pointer
  86. URHO3D_PARAM(P_TEXTURE, Texture); // Texture pointer
  87. URHO3D_PARAM(P_SURFACE, Surface); // RenderSurface pointer
  88. URHO3D_PARAM(P_SCENE, Scene); // Scene pointer
  89. URHO3D_PARAM(P_CAMERA, Camera); // Camera pointer
  90. }
  91. /// Render of all views is finished for the frame.
  92. URHO3D_EVENT(E_ENDALLVIEWSRENDER, EndAllViewsRender)
  93. {
  94. }
  95. /// A render path event has occurred.
  96. URHO3D_EVENT(E_RENDERPATHEVENT, RenderPathEvent)
  97. {
  98. URHO3D_PARAM(P_NAME, Name); // String
  99. }
  100. /// Graphics context has been lost. Some or all (depending on the API) GPU objects have lost their contents.
  101. URHO3D_EVENT(E_DEVICELOST, DeviceLost)
  102. {
  103. }
  104. /// Graphics context has been recreated after being lost. GPU objects in the "data lost" state can be restored now.
  105. URHO3D_EVENT(E_DEVICERESET, DeviceReset)
  106. {
  107. }
  108. }