More stuff done at Project Ultra
- Added renderspace - Revision System (to not always update pRenderspace - added some test scene
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <pd/lithium/lithium.hpp>
|
||||
#include <pd/ultra/flags.hpp>
|
||||
|
||||
namespace PD {
|
||||
namespace Ultra {
|
||||
class ElementBase {
|
||||
class Canvas;
|
||||
class PD_API ElementBase {
|
||||
public:
|
||||
ElementBase() {}
|
||||
~ElementBase() {}
|
||||
@@ -14,8 +16,22 @@ class ElementBase {
|
||||
* Reset Function (for PD::Pool::FastReset)
|
||||
*/
|
||||
virtual void Reset() {}
|
||||
void Update(Canvas& c);
|
||||
|
||||
private:
|
||||
void SetAlignment(UltraAlignment a) { pAlignment = a; }
|
||||
void SetPosition(const PD::fvec2& pos) { pPos = pos; }
|
||||
void SetPosition(float x, float y) { pPos = PD::fvec2(x, y); }
|
||||
void SetSize(const PD::fvec2& size) { pSize = size; }
|
||||
void SetSize(float w, float h) { pSize = PD::fvec2(w, h); }
|
||||
|
||||
protected:
|
||||
bool RevisionUpdate(PD::u32 req);
|
||||
PD::u32 pCanvasRev = 0;
|
||||
PD::Li::Rect pRenderspace;
|
||||
UltraAlignment pAlignment = 0;
|
||||
PD::fvec2 pPos;
|
||||
PD::fvec2 pSize;
|
||||
ElementBase* pParent = nullptr;
|
||||
};
|
||||
} // namespace Ultra
|
||||
} // namespace PD
|
||||
Reference in New Issue
Block a user