We now initialize/destroy the display in Xlib::init/shutdown that is called in UnixApplication::init/shutdown and therefore is valid through the whole lifetime. So no need for classes to keep references.
22 lines
383 B
C++
22 lines
383 B
C++
|
|
#ifndef SPECTRE_PLATFORM_UNIX_XLIB_H
|
|
#define SPECTRE_PLATFORM_UNIX_XLIB_H
|
|
|
|
#include <string>
|
|
#include <X11/Xlib.h>
|
|
|
|
// Wrapper for some Xlib functions.
|
|
|
|
namespace sp { namespace Xlib {
|
|
|
|
void init();
|
|
|
|
void shutdown();
|
|
|
|
::Display* getDisplay();
|
|
|
|
::Atom getAtom(const std::string& name, bool onlyIfExists = false);
|
|
|
|
} } // namespace sp::xlib
|
|
|
|
#endif /* SPECTRE_PLATFORM_UNIX_XLIB_H */
|