Init Project
This commit is contained in:
parent
ad9c952b90
commit
0ca3c9cc64
7 changed files with 4141 additions and 0 deletions
43
src/main.cpp
Normal file
43
src/main.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
//
|
||||
// Created by n0ffie on 08/04/25.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <cigus.hpp>
|
||||
|
||||
class NewView : public cigus::UI::View {
|
||||
public:
|
||||
void body() override {
|
||||
std::cout << "Hello World!" << std::endl;
|
||||
Rectangle();
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
namespace UI = cigus::UI;
|
||||
sf::RenderWindow window(sf::VideoMode({800, 600}), "Hello World!");
|
||||
window.setFramerateLimit(60);
|
||||
|
||||
UI::Renderer renderer(cigus::Ref<UI::View>(new NewView()));
|
||||
|
||||
while (window.isOpen()) {
|
||||
|
||||
while (const std::optional event = window.pollEvent())
|
||||
{
|
||||
if (event->is<sf::Event::Closed>())
|
||||
{
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
window.clear();
|
||||
renderer.render(window, sf::RenderStates());
|
||||
window.display();
|
||||
}
|
||||
renderer.destroy();
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue