forked from karlphillip/GraphicsProgramming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfps_canvas.h
More file actions
30 lines (25 loc) · 730 Bytes
/
fps_canvas.h
File metadata and controls
30 lines (25 loc) · 730 Bytes
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
/* Copyright (C) 2014 Karl Phillip Buhr <karlphillip@gmail.com>
*
* This work is licensed under the Creative Commons Attribution-ShareAlike License.
* To view a copy of this license, visit:
* https://creativecommons.org/licenses/by-sa/2.5/legalcode
*
* Or to read the human-readable summary of the license:
* https://creativecommons.org/licenses/by-sa/2.5/
*/
#pragma once
#include <QFrame>
class FpsCanvas : public QFrame
{
Q_OBJECT
public:
FpsCanvas(QFrame* parent = NULL, const QColor color = Qt::black);
void draw();
void reset();
void paintEvent(QPaintEvent* event);
private:
QColor _color;
int _sq_sz;
int _x, _y;
int _dx, _dy;
};