forked from its007Kevin/tetris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
window.h
40 lines (30 loc) · 1.04 KB
/
window.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef __WINDOW_H__
#define __WINDOW_H__
#include <X11/Xlib.h>
#include <iostream>
#include <string>
class Xwindow {
Display *d;
Window w;
int s;
GC gc;
unsigned long colours[10];
int width, height;
public:
Xwindow(int width=500, int height=500); // Constructor; displays the window.
~Xwindow(); // Destructor; destroys the window.
Xwindow(const Xwindow&) = delete;
Xwindow &operator=(const Xwindow&) = delete;
enum {White=0, Black, Red, Green, Blue, Cyan, Yellow, Magenta, Orange, Brown}; // Available colours.
// Draws a rectangle
void fillRectangle(int x, int y, int width, int height, int colour=Black);
// Draws a rectangle with custom RGB
void fillRectangleRGB(int x, int y, int width, int height, int r, int g, int b);
// Draws a string
void drawString(int x, int y, std::string msg, int colour=Black);
// Draws a string
void drawBigString(int x, int y, std::string msg, int colour=Black);
// Prints the first 10000 available fonts
void showAvailableFonts();
};
#endif