Correct resize and safer pointers

This commit is contained in:
Corentin 2021-07-07 15:57:26 +09:00
commit 3b2be83590
9 changed files with 193 additions and 81 deletions

View file

@ -7,24 +7,28 @@ using namespace std;
int main()
{
cout << "Example Staring" << endl;
try
{
cout << "Starting example 1" << endl;
{
uui::GlApplication app;
// uui::GlApplication app2; // exception : application already created
auto window_1 = app.create_window(800, 600, "OpenGl!");
window_1.lock()->create_component(0, 1, 0.5f, 50);
auto window = app.create_window(800, 600, "OpenGl!");
auto comp = window->create_component(0, 100, 0.5f, 50);
comp->set_background_color(0.8f, 0.1f, 0.5f);
app.run();
}
cout << "\nStarting example 2" << endl;
{
uui::GlApplication app;
auto window_1 = app.create_window(800, 600, "OpenGl!");
window_1.lock()->create_component(0.25f, 0.25f, 0.5f, 0.5f);
window_1.lock()->create_component(0.75f, 0.75f, 0.25f, 0.25f);
auto comp = window_1->create_component(0.25f, 0.25f, 0.5f, 0.5f);
comp->set_background_color(0.8f, 0.1f, 0.5f);
comp = window_1->create_component(0.75f, 0.75f, 0.25f, 0.25f);
comp->set_background_color(0.2f, 0.1f, 0.5f);
auto window_2 = app.create_window(600, 600, "OpenGL 2!");
window_2.lock()->create_component(0, 0.5f, 100, 0.5f);
comp = window_2->create_component(0, 0.5f, 100, 0.5f);
comp->set_background_color(0.2f, 0.5f, 0.3f);
app.run();
}
}