Skip to main content
gamedev.net
🔒 Locked

Display List Problem

Started by Mike00 Aug 29, 2000 at 2:30 AM 6 replies 550+ views
Original Post
Mike00
Mike00
Here''s the code: //global GLuint laser; // GLvoid BuildList() { laser=glGenLists(1); glNewList(laser,GL_COMPILE); glLineWidth(1); glColor3f(1.0f,0.0f,0.0f); glBindTexture(GL_TEXTURE_2D, texture[4]); glBegin(GL_LINES); glVertex3f(0.0f,0.0f,0.0f); glVertex3f(0.0f,0.25f,0.0f); glEnd(); glEndList(); } void lasers(){ glLoadIdentity(); glTranslatef(rightlaserx,rightlasery,yourshipz); glCallList(laser); } int DrawGLScene(GLvoid) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); lasers(); return TRUE; } The laser doesn''t show up. Any ideas? Thanks!
sebastian
sebastian
you have not specified any tex coords. maybe thats the problem.
--->Back to coding!<---
Mike00
Mike00
Hmm, no, that''s not the problem. It works fine when I take away the display list and just have this:

glLoadIdentity();
glTranslatef(rightlaserx,rightlasery,yourshipz);
glLineWidth(1);
glColor3f(1.0f,0.0f,0.0f);
glBindTexture(GL_TEXTURE_2D, texture[4]);
glBegin(GL_LINES);
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(0.0f,0.25f,0.0f);
glEnd();

a2k
a2k
did you call your buildlist function in your intialization code?

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
baskuenen
baskuenen
What happens when you use GL_COMPILE_AND_EXECUTE instead of GL_COMPILE?

Mike00
Mike00
Ahh that''s what I forgot, thanks!
lunasol
lunasol
Hi
why does it work with GL_COMPILE_AND_EXECUTE instead of GL_COMPILE?

11eclipse1.jpg (1712 octets)lunasol
a2k
a2k
yeah, i''ve never used GL_COMPILE_AND_EXECUTE. what''s the diff?
why does it work? what''s wrong with GL_COMPILE?

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.