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

@ -10,6 +10,7 @@
#include <algorithm>
#include <iterator>
#include <iostream>
Widget::Widget()
: mLocation(DiscretePoint(0, 0)),
@ -99,9 +100,9 @@ void Widget::setBounds(unsigned width, unsigned height)
if (width != mSize.mWidth || height != mSize.mHeight)
{
mDirty = true;
mSize.mWidth = width;
mSize.mHeight = height;
}
mSize.mWidth = width;
mSize.mHeight = height;
}
void Widget::setBackgroundColor(const Color& color)
@ -273,9 +274,9 @@ void Widget::addBackground(const PaintEvent* event)
unsigned deltaX = mSize.mWidth - mMargin.mLeft - mMargin.mRight;
unsigned deltaY = mSize.mHeight - mMargin.mTop - mMargin.mBottom;
auto shape = RectangleNode::Create(DiscretePoint(locX, locY), deltaX, deltaY);
shape->setFillColor(mBackgroundColor);
auto shapeLayer = VisualLayer::Create();
shapeLayer->setShape(std::move(shape));
mMyLayers.push_back(std::move(shapeLayer));
auto node = RectangleNode::Create(DiscretePoint(locX, locY), deltaX, deltaY);
node->setFillColor(mBackgroundColor);
auto layer = VisualLayer::Create();
layer->setShapeNode(std::move(node));
mMyLayers.push_back(std::move(layer));
}