MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / gpu_RenderPolygon

Function gpu_RenderPolygon

renderer/HardwareOpenGL.cpp:1499–1524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1497}
1498
1499void gpu_RenderPolygon(PosColorUVVertex *vData, uint32_t nv) {
1500 dglVertexPointer(3, GL_FLOAT, sizeof(*vData), &vData->pos);
1501 dglColorPointer(4, GL_FLOAT, sizeof(*vData), &vData->color);
1502 oglClientActiveTextureARB(GL_TEXTURE0_ARB + 0);
1503 dglTexCoordPointer(4, GL_FLOAT, sizeof(*vData), &vData->uv);
1504
1505 if (gpu_state.cur_texture_quality == 0) {
1506 // force disable textures
1507 dglDisableClientState(GL_TEXTURE_COORD_ARRAY);
1508 }
1509
1510 oglClientActiveTextureARB(GL_TEXTURE0_ARB + 1);
1511 dglDisableClientState(GL_TEXTURE_COORD_ARRAY);
1512
1513 // draw the data in the arrays
1514 dglDrawArrays(GL_POLYGON, 0, nv);
1515
1516 if (gpu_state.cur_texture_quality == 0) {
1517 // re-enable textures
1518 oglClientActiveTextureARB(GL_TEXTURE0_ARB + 0);
1519 dglEnableClientState(GL_TEXTURE_COORD_ARRAY);
1520 }
1521
1522 OpenGL_polys_drawn++;
1523 OpenGL_verts_processed += nv;
1524}
1525
1526void gpu_RenderPolygonUV2(PosColorUV2Vertex *vData, uint32_t nv) {
1527 dglVertexPointer(3, GL_FLOAT, sizeof(*vData), &vData->pos);

Callers 2

rend_DrawPolygon2DFunction · 0.85
rend_DrawPolygon3DFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected