mirror of
https://github.com/guezoloic/LearnOpenGL.git
synced 2026-01-25 03:34:15 +00:00
feat(shape)!: add shape super class
This commit is contained in:
31
inc/shape.hpp
Normal file
31
inc/shape.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef SHAPE_HPP
|
||||
#define SHAPE_HPP
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#include "camera.hpp"
|
||||
#include "glm/fwd.hpp"
|
||||
|
||||
class Shape
|
||||
{
|
||||
protected:
|
||||
glm::vec3 position;
|
||||
Camera& cameraRef;
|
||||
|
||||
virtual void init() = 0;
|
||||
|
||||
public:
|
||||
Shape(Camera& cameraRef, glm::vec3 position)
|
||||
: position(position), cameraRef(cameraRef)
|
||||
{
|
||||
}
|
||||
|
||||
glm::vec3 getPosition() const { return position; }
|
||||
Camera& getCamera() const { return cameraRef; }
|
||||
|
||||
virtual void render() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user