triangle?

This commit is contained in:
2026-02-10 23:51:27 -06:00
parent 1f22a661cd
commit 0244f463c4
11 changed files with 83 additions and 49 deletions

View File

@@ -24,6 +24,8 @@ TestTriangle::~TestTriangle() {
#endif
*/
wm->releaseWindow(window);
delete rt;
}
}
@@ -32,12 +34,14 @@ void TestTriangle::onLoad() {
WindowModule* wm; { wm = (WindowModule*) moduleInstances[WindowModule()]; }
if(!wm) {
std::cout << "No WindowModule for ImguiModule!\n";
std::cout << "No WindowModule TestTriangle!\n";
std::abort();
}
window = wm->aquireWindow();
window->getRenderer()->clearColor = { 0.2, 0.2, 0.4, 0.7 };
rt = window->getRenderer()->createRenderTarget(
vertices,
9 * sizeof(float),
@@ -53,7 +57,10 @@ void TestTriangle::onLoad() {
void TestTriangle::run() {
window->getRenderer()->draw(*rt);
window->getRenderer()->render();
window->getRenderer()->draw(rt);
window->swapBuffers();
window->pollEvents();
}

View File

@@ -51,10 +51,12 @@ class TestTriangle : public Archimedes::Module {
};
unsigned int indices[3] = {
1, // left
2, // right
3 // top
0, // left
1, // right
2 // top
};
unsigned int vao, vbo, ibo, shaderProgram;
};
#ifdef TESTTRIANGLE_DYNAMIC