forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
let matrix be handled by qt scenegraph or by the opengl engine, remov…
…ed engine class from scenegraph, get context from m_waveformRenderer, various cleanups
- Loading branch information
m0dB
authored and
m0dB
committed
Oct 19, 2024
1 parent
bf7ed15
commit 1e57aae
Showing
57 changed files
with
487 additions
and
466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include "examplenode.h" | ||
|
||
#include <QColor> | ||
#include <QMatrix4x4> | ||
#include <QVector2D> | ||
|
||
#include "rendergraph/geometry.h" | ||
#include "rendergraph/material/rgbmaterial.h" | ||
#include "rendergraph/material/texturematerial.h" | ||
#include "rendergraph/material/unicolormaterial.h" | ||
#include "rendergraph/vertexupdaters/rgbvertexupdater.h" | ||
#include "rendergraph/vertexupdaters/texturedvertexupdater.h" | ||
#include "rendergraph/vertexupdaters/vertexupdater.h" | ||
|
||
using namespace rendergraph; | ||
|
||
ExampleNode::ExampleNode(rendergraph::Context* pContext) { | ||
{ | ||
TreeNode::appendChildNode(std::make_unique<GeometryNode>()); | ||
auto pNode = static_cast<GeometryNode*>(TreeNode::lastChild()); | ||
pNode->initForRectangles<TextureMaterial>(1); | ||
auto& material = dynamic_cast<TextureMaterial&>(pNode->material()); | ||
material.setTexture(std::make_unique<Texture>( | ||
pContext, QImage(":/example/images/test.png"))); | ||
TexturedVertexUpdater vertexUpdater{ | ||
pNode->geometry().vertexDataAs<Geometry::TexturedPoint2D>()}; | ||
vertexUpdater.addRectangle({0, 0}, {100, 100}, {0.f, 0.f}, {1.f, 1.f}); | ||
} | ||
{ | ||
TreeNode::appendChildNode(std::make_unique<GeometryNode>()); | ||
auto pNode = static_cast<GeometryNode*>(TreeNode::lastChild()); | ||
pNode->initForRectangles<rendergraph::UniColorMaterial>(2); | ||
pNode->material().setUniform(1, QColor(255, 127, 0)); | ||
pNode->geometry().setDrawingMode(Geometry::DrawingMode::Triangles); | ||
rendergraph::VertexUpdater vertexUpdater{ | ||
pNode->geometry() | ||
.vertexDataAs<rendergraph::Geometry::Point2D>()}; | ||
vertexUpdater.addRectangle({100, 100}, {160, 160}); | ||
vertexUpdater.addRectangle({200, 160}, {240, 190}); | ||
} | ||
{ | ||
TreeNode::appendChildNode(std::make_unique<GeometryNode>()); | ||
auto pNode = static_cast<GeometryNode*>(TreeNode::lastChild()); | ||
pNode->initForRectangles<rendergraph::RGBMaterial>(2); | ||
pNode->geometry().setDrawingMode(Geometry::DrawingMode::Triangles); | ||
rendergraph::RGBVertexUpdater vertexUpdater{ | ||
pNode->geometry().vertexDataAs<Geometry::RGBColoredPoint2D>()}; | ||
vertexUpdater.addRectangle({300, 100}, {340, 140}, {1.f, 0.f, 0.5f}); | ||
vertexUpdater.addRectangleHGradient( | ||
{340, 100}, {440, 130}, {0.f, 1.f, 0.5f}, {0.5f, 0.f, 1.f}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "rendergraph/geometrynode.h" | ||
#include "rendergraph/node.h" | ||
#include "rendergraph/texture.h" | ||
|
||
namespace rendergraph { | ||
class ExampleNode; | ||
} // namespace rendergraph | ||
|
||
class rendergraph::ExampleNode : public rendergraph::Node { | ||
public: | ||
ExampleNode(rendergraph::Context* pContext); | ||
}; |
Oops, something went wrong.