SignedDistanceFieldText.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (c) 2008-2023 the Urho3D project
  2. // License: MIT
  3. #pragma once
  4. #include "Sample.h"
  5. namespace Urho3D
  6. {
  7. class Node;
  8. class Scene;
  9. }
  10. /// Signed distance field text example.
  11. /// This sample demonstrates:
  12. /// - Creating a 3D scene with static content
  13. /// - Creating a 3D text use SDF Font
  14. /// - Displaying the scene using the Renderer subsystem
  15. /// - Handling keyboard and mouse input to move a freelook camera
  16. class SignedDistanceFieldText : public Sample
  17. {
  18. URHO3D_OBJECT(SignedDistanceFieldText, Sample);
  19. public:
  20. /// Construct.
  21. explicit SignedDistanceFieldText(Context* context);
  22. /// Setup after engine initialization and before running the main loop.
  23. void Start() override;
  24. private:
  25. /// Construct the scene content.
  26. void CreateScene();
  27. /// Construct an instruction text to the UI.
  28. void CreateInstructions();
  29. /// Set up a viewport for displaying the scene.
  30. void SetupViewport();
  31. /// Read input and moves the camera.
  32. void MoveCamera(float timeStep);
  33. /// Subscribe to application-wide logic update events.
  34. void SubscribeToEvents();
  35. /// Handle the logic update event.
  36. void HandleUpdate(StringHash eventType, VariantMap& eventData);
  37. };