Conditional execution of display list

Is there any mechanism in OpenGL that enables conditional execution of display lists? What I mean is (for example):
I define a display list that draws a cube and send it to the server. Then I want to send a boolean flag that tells the server wether to draw or not the display list. I want that the display list definition would not be destroyed (destroying and defining an empty list is a trivial solution
but that is not what I mean). In any case the display list should be called but executed acording to the flag state.
Thanks
Yossi

Why don’t you just perform the check yourself?

if (myBooleanIsTrue)
glCallList(myList);

[This message has been edited by harsman (edited 05-23-2001).]

Thanks Harsman, but I meant something else. I will try to rephrase the question.
Is there any conditional exection of commands in OpenGL?
Can I send to the server something like:
gl…
gl…
glStartConditionCodeOnFlag(glFlagX)
gl…
gl…
glEndConditionCode

And then send to the server:
glSetConditionFlag(glFlagX, TRUE)
Generally: Is there if/else statements in OpenGL?
I guess not, but it would be nice if such mechanism exists.
Thanks
Yossi

There isn’t a “conditional execution statement”… everything in a display list when it is compiled is executed when it is run (at least, those commands that can go in a DL). To do what you describe, just use two display list, and do the check yourself, as mentioned by harsman. I can’t imagine a situation when this wouldn’t be an acceptable way to go about it.

Chris