Get software texture back.
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 4m44s
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 4m44s
This commit is contained in:
8
main.cpp
8
main.cpp
@@ -11,6 +11,8 @@ using J3ML::LinearAlgebra::Vector2;
|
||||
using namespace JGL;
|
||||
|
||||
Texture* image;
|
||||
Texture* reloaded_image;
|
||||
|
||||
//The Re3D style base projection.
|
||||
std::vector<GLfloat> perspective(float fov, float aspect, float nearPlane, float farPlane) {
|
||||
std::vector<float> result(16);
|
||||
@@ -89,6 +91,10 @@ public:
|
||||
glDepthFunc(GL_LESS);
|
||||
glDepthMask(GL_TRUE);
|
||||
image = new Texture("assets/sprites/Re3D.png", TextureFilteringMode::BILINEAR);
|
||||
|
||||
auto* software_texture = new SoftwareTexture(image->GetSoftwareTexture());
|
||||
reloaded_image = new Texture(software_texture, TextureFilteringMode::BILINEAR, TextureWrappingMode::CLAMP_TO_EDGE);
|
||||
delete software_texture;
|
||||
}
|
||||
|
||||
Vector3 textAngle = {0,0,0};
|
||||
@@ -111,7 +117,7 @@ public:
|
||||
J2D::Begin();
|
||||
J2D::FillQuad(Color4(Colors::Red), {500, 52}, {500, 152}, {600, 152}, {600, 52});
|
||||
J2D::FillRect(Colors::Blue, {0,52}, {100,100});
|
||||
J2D::DrawSprite(*image, {200, 252}, {0.5, 0.5}, {2, 1});
|
||||
J2D::DrawSprite(*reloaded_image, {200, 252}, {0.5, 0.5}, {2, 1});
|
||||
J2D::FillRect(Colors::Pinks::HotPink, {68, 120}, {32, 32});
|
||||
J2D::FillGradientRect(Colors::Red, Colors::Blue, Gradient::DiagonalBottomLeft, {100,52}, {100,100});
|
||||
J2D::FillRoundedRect(Colors::Red, {200, 52}, {100, 100}, 8, 8);
|
||||
|
Reference in New Issue
Block a user