55 lines
1,020 B
C++
55 lines
1,020 B
C++
|
|
#ifndef PLATFORM_UNIX_X11DISPLAY_H
|
|
#define PLATFORM_UNIX_X11DISPLAY_H
|
|
|
|
#include <Spectre/Display/DisplayDescription.h> // Prevents conflict with X.h defining "None"
|
|
#include <X11/Xlib.h>
|
|
#include <X11/Xutil.h>
|
|
#include <X11/Xos.h>
|
|
#include <Platform/PlatformDisplay.h>
|
|
|
|
namespace sp {
|
|
|
|
class X11Display : public PlatformDisplay
|
|
{
|
|
public :
|
|
X11Display();
|
|
|
|
virtual bool create(DisplayDescription description);
|
|
|
|
virtual void destroy();
|
|
|
|
virtual bool isValid();
|
|
|
|
virtual void* getHandle() const;
|
|
|
|
virtual void setSize(unsigned int width, unsigned int height);
|
|
|
|
virtual Vector2u getSize() const;
|
|
|
|
virtual void setPosition(unsigned int x, unsigned int y);
|
|
|
|
virtual void setCaption(const std::string& caption);
|
|
|
|
virtual void setIcon(const std::string& icon);
|
|
|
|
virtual void showCursor(bool value);
|
|
|
|
void processEvent(const ::XEvent& event);
|
|
|
|
protected :
|
|
|
|
::Display* m_disp;
|
|
|
|
::Window m_win;
|
|
|
|
int m_screen;
|
|
|
|
//GC m_GC;
|
|
|
|
Vector2u m_size;
|
|
};
|
|
|
|
} // namespace sp
|
|
|
|
#endif /* PLATFORM_UNIX_X11DISPLAY_H */
|