First opengl/x11/window integration.

This commit is contained in:
James Grogan 2022-11-14 13:07:11 +00:00
parent 7c6a92f4ec
commit cea3d2c39f
30 changed files with 254 additions and 72 deletions

View file

@ -6,9 +6,16 @@ Point::Point(double x, double y)
{
}
Point::Point(const DiscretePoint& point)
: mX(point.GetX()),
mY(point.GetY())
{
}
Point::Point(const Point& reference, double offSetX, double offSetY)
: mX(reference.getX() + offSetX),
mY(reference.getX() + offSetY)
mY(reference.getY() + offSetY)
{
}

View file

@ -1,5 +1,7 @@
#pragma once
#include "DiscretePoint.h"
#include <memory>
#include <cmath>
@ -9,6 +11,8 @@ public:
Point(double x, double y);
Point(const DiscretePoint& point);
Point(const Point& reference, double offSetX, double offSetY);
~Point();

View file

@ -7,6 +7,14 @@ Rectangle::Rectangle(const Point& bottomLeft, const Point& topRight)
mWidth = mBottomLeft.getDeltaX(topRight);
}
Rectangle::Rectangle(const Point& bottomLeft, double width, double height)
: mBottomLeft(bottomLeft),
mHeight(height),
mWidth(width)
{
}
Rectangle Rectangle::getBounds() const
{
return Rectangle(mBottomLeft, Point(mBottomLeft, mWidth, mHeight));

View file

@ -11,6 +11,7 @@ class Rectangle : public AbstractGeometricItem
public:
Rectangle(const Point& bottomLeft, const Point& topRight);
Rectangle(const Point& bottomLeft, double width, double height);
double getHeight() const;