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

Method createHiddenCursor

src/SFML/Window/Unix/WindowImplX11.cpp:1770–1786  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1768
1769////////////////////////////////////////////////////////////
1770void WindowImplX11::createHiddenCursor()
1771{
1772 // Create the cursor's pixmap (1x1 pixels)
1773 const Pixmap cursorPixmap = XCreatePixmap(m_display.get(), m_window, 1, 1, 1);
1774 GC graphicsContext = XCreateGC(m_display.get(), cursorPixmap, 0, nullptr);
1775 XDrawPoint(m_display.get(), cursorPixmap, graphicsContext, 0, 0);
1776 XFreeGC(m_display.get(), graphicsContext);
1777
1778 // Create the cursor, using the pixmap as both the shape and the mask of the cursor
1779 XColor color;
1780 color.flags = DoRed | DoGreen | DoBlue;
1781 color.red = color.blue = color.green = 0;
1782 m_hiddenCursor = XCreatePixmapCursor(m_display.get(), cursorPixmap, cursorPixmap, &color, &color, 0, 0);
1783
1784 // We don't need the pixmap any longer, free it
1785 XFreePixmap(m_display.get(), cursorPixmap);
1786}
1787
1788
1789////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected