evelight/renderer.cpp
RenderBatch* Renderer::GetBatch(
    DrawType drawType, GLuint textureId, uint verticesOffs, uint indexesOffs)
{
    RenderBatch batch(verticesOffs, indexesOffs, drawType, textureId);
    auto it = std::find(mBatches.begin(), mBatches.end(), batch);

    if (it == mBatches.end()) {
        // std::cout << "new batch" << std::endl;
        RenderBatch batch(verticesOffs, indexesOffs, drawType, textureId);
        mBatches.push_back(batch);
        return &mBatches.back();
    }

    return &(*it);
}
/**
 * Gets a batch having drawType and textureId.
 * If it cannot find one, will create one with given vertices indexes offsets
 */
Gets a batch having drawType and textureId.
If it cannot find one, will create one with given vertices indexes offsets
Gets a batch having drawType and textureId . If it cannot find one will create one with given vertices indexes offsets
RenderBatch* Renderer::GetBatch(
    DrawType drawType, GLuint textureId, uint verticesOffs, uint indexesOffs)
{
    RenderBatch batch(verticesOffs, indexesOffs, drawType, textureId);
    auto it = std::find(mBatches.begin(), mBatches.end(), batch);
    if (it == mBatches.end()) {
        RenderBatch batch(verticesOffs, indexesOffs, drawType, textureId);
        mBatches.push_back(batch);
        return &mBatches.back();
    }
    return &(*it);
}
RenderBatch * Renderer :: GetBatch ( DrawType drawType , GLuint textureId , uint verticesOffs , uint indexesOffs ) { RenderBatch batch ( verticesOffs , indexesOffs , drawType , textureId ) ; auto it = std :: find ( mBatches . begin ( ) , mBatches . end ( ) , batch ) ; if ( it == mBatches . end ( ) ) { RenderBatch batch ( verticesOffs , indexesOffs , drawType , textureId ) ; mBatches . push_back ( batch ) ; return & mBatches . back ( ) ; } return & ( * it ) ; }
Gets a batch having drawType and textureId.
Gets a batch having drawType and textureId .
// std::cout << "new batch" << std::endl;