love.graphics: move more platform-independent code out of the opengl backend

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-07-22 23:34:39 -03:00
parent b568e267eb
commit 864147c38c
22 changed files with 368 additions and 316 deletions
+10 -3
View File
@@ -1048,15 +1048,21 @@ void ParticleSystem::update(float dt)
prevPosition = position;
}
bool ParticleSystem::prepareDraw(Graphics *gfx)
void ParticleSystem::draw(Graphics *gfx, const Matrix4 &m)
{
uint32 pCount = getCount();
if (pCount == 0 || texture.get() == nullptr || pMem == nullptr || buffer == nullptr)
return false;
return;
gfx->flushStreamDraws();
if (Shader::isDefaultActive())
Shader::attachDefault(Shader::STANDARD_DEFAULT);
if (Shader::current && texture.get())
Shader::current->checkMainTexture(texture);
const Vector2 *positions = texture->getQuad()->getVertexPositions();
const Vector2 *texcoords = texture->getQuad()->getVertexTexCoords();
@@ -1098,7 +1104,8 @@ bool ParticleSystem::prepareDraw(Graphics *gfx)
buffer->unmap();
return true;
Graphics::TempTransform transform(gfx, m);
drawInternal();
}
bool ParticleSystem::getConstant(const char *in, AreaSpreadDistribution &out)