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

@@ -22,7 +22,7 @@ bool Shape::create_buffers_imp(GLvoid* idx, GLvoid* vertices, int isize, int vsi
use_idx = true;
bool ret = false;
App::I.render_task([&]
App::I->render_task([&]
{
destroy();
@@ -71,7 +71,7 @@ bool Shape::create_buffers(GLvoid* vertices, int vsize)
use_idx = false;
bool ret = false;
App::I.render_task([&]
App::I->render_task([&]
{
destroy();
@@ -124,7 +124,7 @@ void Shape::draw_fill() const
type = GL_POINTS;
if (count[0] == 2)
type = GL_LINES;
App::I.render_task([=]
App::I->render_task([=]
{
#if USE_VBO
glBindVertexArray(arrays[0]);
@@ -160,7 +160,7 @@ void Shape::draw_stroke() const
GLenum type = GL_LINES;
if (count[1] == 1)
type = GL_POINTS;
App::I.render_task([=]
App::I->render_task([=]
{
#if USE_VBO
glBindVertexArray(arrays[1]);
@@ -193,7 +193,7 @@ void Shape::draw_stroke() const
void Shape::destroy()
{
App::I.render_task_async([b1=buffers[0],b2=buffers[1],a1=arrays[0],a2=arrays[1]]
App::I->render_task_async([b1=buffers[0],b2=buffers[1],a1=arrays[0],a2=arrays[1]]
{
if (b1 || b2)
{
@@ -490,7 +490,7 @@ void Plane::update_vertices(const glm::vec4* data, const glm::vec2* uvs, const g
vertices[i].pos.z = q;
}
App::I.render_task([this]
App::I->render_task([this]
{
glBindBuffer(GL_ARRAY_BUFFER, buffers[0]);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
@@ -760,7 +760,7 @@ void Sphere::create_impl(int rings, int sectors, float radius,
}
void LineSegment::update_vertices(const glm::vec4 data[2])
{
App::I.render_task([&]
App::I->render_task([&]
{
static vertex_t vertices[2];
vertices[0] = { data[0], { 0, 0 } }; // A
@@ -772,7 +772,7 @@ void LineSegment::update_vertices(const glm::vec4 data[2])
}
void DynamicShape::update_vertices(vertex_t* vertices, int vcount)
{
App::I.render_task([&]
App::I->render_task([&]
{
count[0] = vcount;
count[1] = vcount;