Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Eber Kain

Display List problem i think

This topic is 6227 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Why can i do this, and it work. glDisable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); gluOrtho2D(0,width,0,height); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(loc.cur.x,-loc.cur.y+height,0); draw_cursor(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glEnable(GL_DEPTH_TEST); and this not work? loc.enter_2d = glGenLists(2); loc.exit_2d = loc.enter_2d + 1; glNewList(loc.enter_2d, GL_COMPILE); glDisable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); gluOrtho2D(0,800,0,600); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glEndList(); glNewList(loc.exit_2d, GL_COMPILE); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glEnable(GL_DEPTH_TEST); glEndList(); glCallList(loc.enter_2d); glTranslatef(loc.cur.x,-loc.cur.y+height,0); draw_cursor(); glCallList(loc.exit_2d);

Share this post


Link to post
Share on other sites
Advertisement
And those functions are

glColorPointer()
glFlush()
glNormalPointer()
glDeleteLists()
glGenLists()
glPixelStore()
glDisableClientState()
glGet*()
glReadPixels()
glEdgeFlagPointer()
glIndexPointer()
glRenderMode()
glEnableClientState()
glInterleavedArrays()
glSelectBuffer()
glFeedbackBuffer()
glIsEnabled()
glTexCoordPointer()

None of which are included in my code.

Share this post


Link to post
Share on other sites
Wouldn''t it be a lot easier to just make 1 or 2 functions doing the same?

Just don''t understand what you can make out of putting mode switches in a display list...

(If there is something good.....TELL ME!!!!)

Take Care!

- -- ---[XaOs]--- -- -

[ project fy ]

Share this post


Link to post
Share on other sites
I''ve heard that mode switches are a good use of Display Lists because it only has to check the validity of the mode once (as opposed to each enable/disable/etc call). Is there a way to glGet the current attribute settings? I know you can push and pop, but how about storing and loading (a la glLoadMatrix)? That''d be pretty handy, I would think, for this particular usage.

Share this post


Link to post
Share on other sites
glLoadMatrix would be fine, just remember that the display list will not change if you change the matrix its loading.

That might be my problem, must look closer now that i think about that.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!