Re: OpenGL - One of eight simple box drawings disappears ...

Paul <[email protected]> Mon, 24 Mar 2025 13:09:23 -0400
Newsgroups alt.comp.os.windows-xp,alt.windows7.general,comp.os.ms-windows.programmer.win32
Organization A noiseless patient Spider
Message-ID <[email protected]>
On Mon, 3/24/2025 7:28 AM, R.Wieser wrote:
> Hello all,
> 
> I'm drawing some stuff using OpenGL32, and have run into something I can't 
> explain.
> 
> I'm drawing a line and two rectangles with "markers" (a small box) on each 
> corner.  For some reason *one* of those markers disappears.
> 
> The code:
> - - - - - - - - - - -
> 
> glPushAttrib GL_CURRENT_BIT or GL_ENABLE_BIT
> glColor3ubv
> 
> glBegin,GL_LINES
> ...
> glEnd
> 
> glDisable GL_CULL_FACE
> 
> DrawMarker
> DrawMarker
> DrawMarker
> DrawMarker
> 
> glBegin,GL_QUADS
> ...
> glEnd
> 
> DrawMarker  <-- this one disappears
> DrawMarker
> DrawMarker
> DrawMarker
> 
> glBegin,GL_QUADS
> ...
> glEnd
> 
> glPopAttrib
> 
> - - - - - - - - - - -
> -- DrawMarker
> 
> glPushAttrib GL_CURRENT_BIT
> glColor3ubv
> glBegin GL_QUADS
> ...
> glEnd
> glPopAttrib
> - - - - - - - - - - -
> 
> The interesting thing is that if I either, in the DrawMarker part, not push 
> the attributes or not set the color all markers are visible again.
> 
> If I make the above change for just the disappearing marker it appears, but 
> than the next marker disappears.
> 
> In the DrawMarker code I've followed both the glPushAttib and glColor3ubv 
> with glGetError, but those returned Zero for all markers.
> 
> I have no idea what is happening.  Does anyone know ?
> 
> Regards,
> Rudy Wieser

Have you considered feeding the source into an AI, and
asking whether your style of using Pushes and Pops is correct ?

It is either that, or find some sample code on the web, with
similar intended function, and see what style they use.

Maybe after your GLBegin GLend, you need to restore the
grapical context, so the current cursor location is restored.
It could be, the DrawMarker is being drawn off-screen somewhere.

   Paul