App::I static singleton to pointer

This commit is contained in:
2019-07-11 18:08:17 +02:00
parent 92dd00d910
commit b89274e7a6
33 changed files with 417 additions and 412 deletions

View File

@@ -34,7 +34,7 @@ void ActionStroke::undo()
glm::vec2 box_sz = zw(m_box[i]) - xy(m_box[i]);
if (box_sz.x > 0 && box_sz.y > 0 && box_sz.x <= m_canvas->m_layers[m_layer_idx]->w && box_sz.y <= m_canvas->m_layers[m_layer_idx]->h)
{
App::I.render_task([&]
App::I->render_task([&]
{
m_canvas->m_layers[m_layer_idx]->m_rtt[i].bindTexture();
glTexSubImage2D(GL_TEXTURE_2D, 0, (int)m_box[i].x, (int)m_box[i].y, (int)box_sz.x, (int)box_sz.y, GL_RGBA, GL_UNSIGNED_BYTE, m_image[i].get());
@@ -77,7 +77,7 @@ Action* ActionStroke::get_redo()
if (box_sz.x > 0 && box_sz.y > 0 && box_sz.x <= layer->w && box_sz.y <= layer->h)
{
action->m_image[i] = std::make_unique<uint8_t[]>(box_sz.x * box_sz.y * 4);
App::I.render_task([&]
App::I->render_task([&]
{
layer->m_rtt[i].bindFramebuffer();
glReadPixels(box_or.x, box_or.y, box_sz.x, box_sz.y, GL_RGBA, GL_UNSIGNED_BYTE, action->m_image[i].get());