X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=gl_backend.c;h=fe474eac5b9183511ede900565a56e51e2236354;hb=da5398503836b26289ad12f270f28a74f78a37d9;hp=3a15f7a586edd39a78aa1d8ecb529742ac5434f3;hpb=dda9525d00cbd81ad257870fbcb60079e11e367f;p=xonotic%2Fdarkplaces.git diff --git a/gl_backend.c b/gl_backend.c index 3a15f7a5..fe474eac 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -91,6 +91,7 @@ note: here's strip order for a terrain row: |\ |\ |\ |\ | | \| \| \| \| A--B--C--D--E +clockwise A0B, 01B, B1C, 12C, C2D, 23D, D3E, 34E @@ -100,6 +101,42 @@ A0B, 01B, B1C, 12C, C2D, 23D, D3E, 34E *elements++ = i; *elements++ = i + 1; *elements++ = i + row + 1; + + +for (y = 0;y < rows - 1;y++) +{ + for (x = 0;x < columns - 1;x++) + { + i = y * rows + x; + *elements++ = i + columns; + *elements++ = i; + *elements++ = i + columns + 1; + *elements++ = i; + *elements++ = i + 1; + *elements++ = i + columns + 1; + } +} + +alternative: +0--1--2--3--4 +| /| /|\ | /| +|/ |/ | \|/ | +A--B--C--D--E +counterclockwise + +for (y = 0;y < rows - 1;y++) +{ + for (x = 0;x < columns - 1;x++) + { + i = y * rows + x; + *elements++ = i; + *elements++ = i + columns; + *elements++ = i + columns + 1; + *elements++ = i + columns; + *elements++ = i + columns + 1; + *elements++ = i + 1; + } +} */ int polygonelements[768]; @@ -121,7 +158,7 @@ void GL_Backend_FreeArrays(void) static void gl_backend_start(void) { - Con_Printf("OpenGL Backend started\n"); + Con_DPrintf("OpenGL Backend started\n"); if (qglDrawRangeElements != NULL) { CHECKGLERROR @@ -129,7 +166,7 @@ static void gl_backend_start(void) CHECKGLERROR qglGetIntegerv(GL_MAX_ELEMENTS_INDICES, &gl_maxdrawrangeelementsindices); CHECKGLERROR - Con_Printf("glDrawRangeElements detected (max vertices %i, max indices %i)\n", gl_maxdrawrangeelementsvertices, gl_maxdrawrangeelementsindices); + Con_DPrintf("glDrawRangeElements detected (max vertices %i, max indices %i)\n", gl_maxdrawrangeelementsvertices, gl_maxdrawrangeelementsindices); } backendunits = min(MAX_TEXTUREUNITS, gl_textureunits); @@ -144,7 +181,7 @@ static void gl_backend_shutdown(void) backendunits = 0; backendactive = false; - Con_Printf("OpenGL Backend shutting down\n"); + Con_DPrintf("OpenGL Backend shutting down\n"); GL_Backend_FreeArrays(); }