Phyzix
Loading...
Searching...
No Matches
Graphics.h
1//
2// Created by shams on 8/7/24.
3//
4
5#ifndef PHYZIX_GRAPHICSOBJECT_H
6#define PHYZIX_GRAPHICSOBJECT_H
7
8
9#include <functional>
10#include "Drawable.h"
11
12class Graphics: public Drawable {
13public:
14 // Constructor takes a callable to implement the draw method
15 Graphics( void (*drawFunction)())
16 : drawFunction(drawFunction) {}
17
18 // Override the draw method from the base class
19 void draw() const override {
20 drawFunction();
21 }
22
23private:
24 void (*drawFunction)();
25};
26
27
28#endif //PHYZIX_GRAPHICSOBJECT_H
Definition Drawable.h:11
Definition Graphics.h:12