gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > What's wrong with my display list? (using glOrtho)

#173128 - gusano - Tue Mar 23, 2010 6:35 pm

I'm trying to render a quad using a display list, but I'm seeing nothing... if I do:

Code:

glBegin();
glTexCoord2f(u1, v1); glVertex3v16(x1,y1,z1);
glTexCoord2f(u2, v2); glVertex3v16(x2,y2,z2)
glTexCoord2f(u3, v3); glVertex3v16(x3,y3,z3)
glTexCoord2f(u4, v4); glVertex3v16(x4,y4,z4)
glEnd();


it works...

but if I use my display list:

Code:

      u32 quad1[] =
      {
         17,
         FIFO_COMMAND_PACK(FIFO_BEGIN, FIFO_TEX_COORD, FIFO_VERTEX16, FIFO_VERTEX16),
         GL_QUAD,
         TEXTURE_PACK(floattot16(u0), floattot16(v0)),
         VERTEX_PACK(x1, y1), VERTEX_PACK(z1,0),
         FIFO_COMMAND_PACK(FIFO_TEX_COORD, FIFO_VERTEX16, FIFO_VERTEX16, FIFO_TEX_COORD),
         TEXTURE_PACK(floattot16(u1), floattot16(v1)),
         VERTEX_PACK(x2, y2), VERTEX_PACK(z2,0),
         TEXTURE_PACK(floattot16(u2), floattot16(v2)),
         FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_VERTEX16, FIFO_TEX_COORD, FIFO_NOP),
         VERTEX_PACK(x3, y3), VERTEX_PACK(z3,0),
         TEXTURE_PACK(floattot16(u3), floattot16(v3)),
         FIFO_COMMAND_PACK(FIFO_VERTEX16, FIFO_VERTEX16, FIFO_NOP, FIFO_NOP),
         VERTEX_PACK(x4, y4), VERTEX_PACK(z4,0)
      };


nothing is drawn... what could be wrong?


EDIT: the tex coords are floats which is why im using floattot16... and the xyz's are already v16's...

EDIT 2: I've gotten a display list to work with a perspective projection, but not an orthographic projection... is this a known issue?

#173143 - DiscoStew - Wed Mar 24, 2010 2:40 am

Don't you only need one FIFO_VERTEX16 per pair of VERTEX_PACK?
_________________
DS - It's all about DiscoStew

#173157 - gusano - Wed Mar 24, 2010 3:33 pm

You're right DiscoStew... only one FIFO_VERTEX16 is needed... but it still doesn't work... have you tried calling a display list using a projection created with glOrthof32() ? I tried changing the DisplayList example that comes with devkitpro to use an orthographic projection and I didn't see anything... is building a display list for approximately 10-40 quads that much faster than doing glBegin(GL_QUADS) ... glEnd() ?

#173159 - sverx - Wed Mar 24, 2010 3:42 pm

gusano wrote:
I tried changing the DisplayList example that comes with devkitpro to use an orthographic projection and I didn't see anything.


The same with Textured_Quad, I did that one year ago, then I gave up trying orthographic projection.

Does somebody have a working example with orthographic projection?