MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / AndroidWindow

Class AndroidWindow

framework/platform/android/android_window.h:33–75  ·  view source on GitHub ↗

* @brief Wrapper for a ANativeWindow, handles the window behaviour (including headless mode on Android) * This class should not be responsible for destroying the underlying data it points to */

Source from the content-addressed store, hash-verified

31 * This class should not be responsible for destroying the underlying data it points to
32 */
33class AndroidWindow : public Window
34{
35 public:
36 /**
37 * @brief Constructor
38 * @param platform The platform this window is created for
39 * @param window A reference to the location of the Android native window
40 * @param properties Window configuration
41 */
42 AndroidWindow(AndroidPlatform *platform, ANativeWindow *&window, const Window::Properties &properties);
43
44 virtual ~AndroidWindow() = default;
45
46 /**
47 * @brief Creates a Vulkan surface to the native window
48 * If headless, this will return VK_NULL_HANDLE
49 */
50 virtual VkSurfaceKHR create_surface(vkb::core::InstanceC &instance) override;
51
52 /**
53 * @brief Creates a Vulkan surface to the native window
54 * If headless, this will return nullptr
55 */
56 virtual VkSurfaceKHR create_surface(VkInstance instance, VkPhysicalDevice physical_device) override;
57
58 virtual void process_events() override;
59
60 virtual bool should_close() override;
61
62 virtual void close() override;
63
64 virtual float get_dpi_factor() const override;
65
66 std::vector<const char *> get_required_surface_extensions() const override;
67
68 private:
69 AndroidPlatform *platform;
70
71 // Handle to the android window
72 ANativeWindow *&handle;
73
74 bool finish_called{false};
75};
76} // namespace vkb

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected