Extract RenderTexture from Canvas
For easyer managment of texures and potential buffers
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include <vector>
|
||||
#include <array>
|
||||
#include "canvas/Canvas.hpp"
|
||||
|
||||
class App
|
||||
@@ -15,7 +15,8 @@ public:
|
||||
private:
|
||||
int pos = 0;
|
||||
int screenWidth, screenHeight;
|
||||
std::vector<Canvas> canvases;
|
||||
Canvas canvas;
|
||||
std::array< RenderTexture2D, 2> canvasTexure = { 0 };
|
||||
float rotation = 0.0f;
|
||||
Rectangle destB;
|
||||
Rectangle destA;
|
||||
|
@@ -3,4 +3,6 @@
|
||||
Color ColorLerp(Color c1, Color c2, float amount);
|
||||
Color ColorAdd(Color c, int add);
|
||||
Vector2 CalculateVector(float rotation, float offSet, float len);
|
||||
float GetRandomFloat();
|
||||
float GetRandomFloat();
|
||||
|
||||
void drawTexureWithRotation(RenderTexture2D& target, Rectangle& dest, float rotation);
|
@@ -9,12 +9,9 @@ public:
|
||||
Canvas() = default;
|
||||
~Canvas() = default;
|
||||
void init(int size);
|
||||
void newGen();
|
||||
void draw(Rectangle dest, float rotation);
|
||||
void deinit();
|
||||
void newGen(RenderTexture2D& target);
|
||||
|
||||
private:
|
||||
BackGround backGround;
|
||||
Tree tree;
|
||||
RenderTexture2D target = {0};
|
||||
};
|
||||
|
Reference in New Issue
Block a user