mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-24 07:05:39 +00:00
542d41c682
Pass a matrix (Eigen::Affine3f) in GuiComponent::render instead of doing glTranslate behind the scenes.
27 lines
611 B
C++
27 lines
611 B
C++
#pragma once
|
|
|
|
#include "../GuiComponent.h"
|
|
|
|
class ScrollableContainer : public GuiComponent
|
|
{
|
|
public:
|
|
ScrollableContainer(Window* window);
|
|
|
|
Eigen::Vector2d getScrollPos() const;
|
|
void setScrollPos(const Eigen::Vector2d& pos);
|
|
void setAutoScroll(int delay, double speed); //Use 0 for speed to disable.
|
|
void resetAutoScrollTimer();
|
|
|
|
void update(int deltaTime) override;
|
|
void render(const Eigen::Affine3f& parentTrans) override;
|
|
|
|
private:
|
|
Eigen::Vector2f getContentSize();
|
|
|
|
Eigen::Vector2d mScrollPos;
|
|
Eigen::Vector2d mScrollDir;
|
|
int mAutoScrollDelay;
|
|
double mAutoScrollSpeed;
|
|
int mAutoScrollTimer;
|
|
};
|