MCPcopy Create free account
hub / github.com/SFML/SFML / createFromPixels

Method createFromPixels

src/SFML/Window/Cursor.cpp:79–95  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

77
78////////////////////////////////////////////////////////////
79std::optional<Cursor> Cursor::createFromPixels(const std::uint8_t* pixels, Vector2u size, Vector2u hotspot)
80{
81 if ((pixels == nullptr) || (size.x == 0) || (size.y == 0))
82 {
83 err() << "Failed to create cursor from pixels (invalid arguments)" << std::endl;
84 return std::nullopt;
85 }
86
87 Cursor cursor;
88 if (!cursor.m_impl->loadFromPixels(pixels, size, hotspot))
89 {
90 // Error message generated in called function.
91 return std::nullopt;
92 }
93
94 return cursor;
95}
96
97
98////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

loadFromPixelsMethod · 0.45

Tested by

no test coverage detected