MCPcopy Create free account
hub / github.com/OGRECave/ogre / _render

Method _render

RenderSystems/GLES2/src/OgreGLES2RenderSystem.cpp:1024–1136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1022 }
1023
1024 void GLES2RenderSystem::_render(const RenderOperation& op)
1025 {
1026 // Call super class
1027 RenderSystem::_render(op);
1028
1029 void* pBufferData = 0;
1030
1031 GLVertexArrayObject* vao = static_cast<GLVertexArrayObject*>(op.vertexData->vertexDeclaration);
1032
1033 bool updateVAO = true;
1034 if(getCapabilities()->hasCapability(RSC_VAO))
1035 {
1036 vao->bind(this);
1037 updateVAO = vao->needsUpdate(op.vertexData->vertexBufferBinding,
1038 op.vertexData->vertexStart);
1039 }
1040
1041 if (updateVAO)
1042 vao->bindToGpu(this, op.vertexData->vertexBufferBinding, op.vertexData->vertexStart);
1043
1044 // We treat index buffer binding inside VAO as volatile, always updating and never relying onto it,
1045 // as one shared vertex buffer could be rendered with several index buffers, from submeshes and/or LODs
1046 if (op.useIndexes)
1047 mStateCacheManager->bindGLBuffer(GL_ELEMENT_ARRAY_BUFFER,
1048 op.indexData->indexBuffer->_getImpl<GLES2HardwareBuffer>()->getGLBufferId());
1049
1050
1051 size_t numberOfInstances = 0;
1052 if (getCapabilities()->hasCapability(RSC_VERTEX_BUFFER_INSTANCE_DATA))
1053 {
1054 numberOfInstances = op.numberOfInstances;
1055 }
1056
1057 // Find the correct type to render
1058 GLint primType;
1059 switch (op.operationType)
1060 {
1061 case RenderOperation::OT_POINT_LIST:
1062 primType = GL_POINTS;
1063 break;
1064 case RenderOperation::OT_LINE_LIST:
1065 primType = GL_LINES;
1066 break;
1067 case RenderOperation::OT_LINE_STRIP:
1068 primType = GL_LINE_STRIP;
1069 break;
1070 default:
1071 case RenderOperation::OT_TRIANGLE_LIST:
1072 primType = GL_TRIANGLES;
1073 break;
1074 case RenderOperation::OT_TRIANGLE_STRIP:
1075 primType = GL_TRIANGLE_STRIP;
1076 break;
1077 case RenderOperation::OT_TRIANGLE_FAN:
1078 primType = GL_TRIANGLE_FAN;
1079 break;
1080 }
1081

Callers 1

updateMethod · 0.45

Calls 8

getCapabilitiesFunction · 0.85
needsUpdateMethod · 0.80
bindToGpuMethod · 0.80
bindMethod · 0.45
bindGLBufferMethod · 0.45
getGLBufferIdMethod · 0.45
getTypeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected