OpenGL on Windows 2000 clips window - solutions?

OpenGL on Windows 2000 clips window - solutions?

Post by Frans Boum » Tue, 07 Nov 2000 04:00:00




> I am compiling publicly available OpenGL test programs with Visual
> Studio 6 sp4, and on Windows 2000, when I maximise the window the
> OpenGL image is clipped along the right and lower borders. Strips
> about 20 to 150 pixels wide in these regions are painted black and
> display nothing. The width of the strips may change if I stop the
> program and restart it. I verified this problem on three different
> computers with different graphic hardware, so it seems common. The
> same programs run without problems under Windows 98 and NT 4.0.

> I have seen at least another programmer reporting the same problem
> with Windows 2000 somewhere on the WWW, but I can't recall where. It
> seems to be a bug in Windows 2000 sp1 (I am not positive if it was
> present also in the original version, but I think so).

    Perhaps win2k doesn't sent the expected messages when the window is
    maximized. check which messages you receive when you maximize the
    window and if you react as expected. What seems to be the problem
    is that when the window is maximized, the viewport isn't reinitialized.

    maximizing a window is just enlarging the canvas, not zooming in.

        FB

 
 
 

OpenGL on Windows 2000 clips window - solutions?

Post by Lucian Wisch » Tue, 07 Nov 2000 04:00:00



Quote:>Studio 6 sp4, and on Windows 2000, when I maximise the window the
>OpenGL image is clipped along the right and lower borders. Strips
>about 20 to 150 pixels wide in these regions are painted black and

Lots of people say: "maximise your window, then create the gl context,
then restore it to its normal size". I guess that if gl is asked to create
a context for a smaller window, sometimes it thinks it can get away with
less.

--
Lucian Wischik, Queens' College, Cambridge CB3 9ET. www.wischik.com/lu

 
 
 

OpenGL on Windows 2000 clips window - solutions?

Post by Frans Boum » Tue, 07 Nov 2000 04:00:00





> >    Perhaps win2k doesn't sent the expected messages when the window is
> >    maximized. check which messages you receive when you maximize the
> >    window and if you react as expected. What seems to be the problem
> >    is that when the window is maximized, the viewport isn't reinitialized.

> >    maximizing a window is just enlarging the canvas, not zooming in.

> Thank you for the reply. However, this may not be the source of the
> problem. The canvas does enlarge as expected, but strips of it are
> blackened out along the right and bottom margins. If I run one of the
> programs that allow the user to move objects around the window by
> dragging them with the mouse, for instance, the objects move all
> right, but the are cut off in correspondence of these strips. The
> width of the strips can vary from one run to the next, and even when
> maximising and restoring the same windows several times in succession.
> It looks like a memory buffer or screen buffer is allocated with a
> size too small to contain the whole scene.

    I think this definitely sounds like a glViewPort who isn't resized
    as expected. Do you have a resize function in your program that
    resizes the glViewPort of the window, when you receive a WM_SIZE message?
    if so, in the de*, break in that routine, check if the viewport is actually
    resized when you maximize your window.

        FB

 
 
 

OpenGL on Windows 2000 clips window - solutions?

Post by Frans Boum » Tue, 07 Nov 2000 04:00:00





> >    I think this definitely sounds like a glViewPort who isn't resized
> >    as expected. Do you have a resize function in your program that
> >    resizes the glViewPort of the window, when you receive a WM_SIZE message?
> >    if so, in the de*, break in that routine, check if the viewport is actually
> >    resized when you maximize your window.

[snip code]

Quote:> The last three lines of CGLObj::OnSize() have been added by myself to
> read the Vieweport size. It is always the same as cx, cy (even when
> the image is clipped), so it seems to be resized properly.

    the code seems ok.

Quote:> I can add that C examples work fine, the problem is only with MFC
> examples taken from the WWW. I have about a dozen of them coming from
> different sites and authors, and they all show the clipping problem.
> The thing that puzzles me most is that the clipped area often changes
> between different runs of the same program, and this does not seem to
> be related to the original size and position of the window. I am
> attaching a screen capture showing the clipping problem.

    if you have HalfLife: get the sourcecode of my modelviewer from
    www.planethalflife.com/workshop (check the files section)

    it's an MFC mdi program that views halflife models using opengl.
    it works fine on win2k and it uses a generic opengl class as replacement
    for CView. If it DOES work, perhaps you can use it to find the error
    in your own code. The code you pasted seems ok to me so I can't point
    you to a solution :(

        FB

 
 
 

OpenGL on Windows 2000 clips window - solutions?

Post by ZZ » Wed, 08 Nov 2000 09:02:12


yes very nice

--
lets hear it 4 billy bollux and his AMAZING bouuuncing balls
zed zeek - big bollucked king of the world , messiah , and all round nice guy.
GET IT HERE http://members.xoom.com/myBollux  FREE BOLLUX


 
 
 

OpenGL on Windows 2000 clips window - solutions?

Post by John Smit » Wed, 08 Nov 2000 14:43:12


I am seeing this too, although not quite the same. I have a sizing
routine that maintains the aspect ratio. Everything is fine while
displaying in portrait. If the page is landscape, it looks fine until
I resize the client width to about 1000 pixels on a 1200x1600
screen. Then each incremental increase just widens a black stripe
on the right side. The image is properly drawn until the black
stripe is met, which rules out improper viewport sizing. No
where near MAX_VIEWPORT (16384,16384).


Quote:> I am compiling publicly available OpenGL test programs with Visual
> Studio 6 sp4, and on Windows 2000, when I maximise the window the
> OpenGL image is clipped along the right and lower borders. Strips
> about 20 to 150 pixels wide in these regions are painted black and
> display nothing. The width of the strips may change if I stop the
> program and restart it. I verified this problem on three different
> computers with different graphic hardware, so it seems common. The
> same programs run without problems under Windows 98 and NT 4.0.

> I have seen at least another programmer reporting the same problem
> with Windows 2000 somewhere on the WWW, but I can't recall where. It
> seems to be a bug in Windows 2000 sp1 (I am not positive if it was
> present also in the original version, but I think so).

> Is the bug acknowledged by Microsoft? By now hundreds of programmers
> should have found it. Is there a solution or workaround?

> TIA

 
 
 

OpenGL on Windows 2000 clips window - solutions?

Post by John Smit » Wed, 08 Nov 2000 16:41:56


http://support.microsoft.com/support/kb/articles/Q272/2/21.ASP

Yup - its a bug.


> I am seeing this too, although not quite the same. I have a sizing
> routine that maintains the aspect ratio. Everything is fine while
> displaying in portrait. If the page is landscape, it looks fine until
> I resize the client width to about 1000 pixels on a 1200x1600
> screen. Then each incremental increase just widens a black stripe
> on the right side. The image is properly drawn until the black
> stripe is met, which rules out improper viewport sizing. No
> where near MAX_VIEWPORT (16384,16384).



> > I am compiling publicly available OpenGL test programs with Visual
> > Studio 6 sp4, and on Windows 2000, when I maximise the window the
> > OpenGL image is clipped along the right and lower borders. Strips
> > about 20 to 150 pixels wide in these regions are painted black and
> > display nothing. The width of the strips may change if I stop the
> > program and restart it. I verified this problem on three different
> > computers with different graphic hardware, so it seems common. The
> > same programs run without problems under Windows 98 and NT 4.0.

> > I have seen at least another programmer reporting the same problem
> > with Windows 2000 somewhere on the WWW, but I can't recall where. It
> > seems to be a bug in Windows 2000 sp1 (I am not positive if it was
> > present also in the original version, but I think so).

> > Is the bug acknowledged by Microsoft? By now hundreds of programmers
> > should have found it. Is there a solution or workaround?

> > TIA

 
 
 

OpenGL on Windows 2000 clips window - solutions?

Post by John Smit » Wed, 08 Nov 2000 16:46:03


Oops, wrong url

http://support.microsoft.com/support/kb/articles/q272/2/22.asp

This one is referenced in the above article. Discusses a work around
 http://support.microsoft.com/support/kb/articles/Q272/2/21.ASP

> Yup - its a bug.



> > I am seeing this too, although not quite the same. I have a sizing
> > routine that maintains the aspect ratio. Everything is fine while
> > displaying in portrait. If the page is landscape, it looks fine until
> > I resize the client width to about 1000 pixels on a 1200x1600
> > screen. Then each incremental increase just widens a black stripe
> > on the right side. The image is properly drawn until the black
> > stripe is met, which rules out improper viewport sizing. No
> > where near MAX_VIEWPORT (16384,16384).



> > > I am compiling publicly available OpenGL test programs with Visual
> > > Studio 6 sp4, and on Windows 2000, when I maximise the window the
> > > OpenGL image is clipped along the right and lower borders. Strips
> > > about 20 to 150 pixels wide in these regions are painted black and
> > > display nothing. The width of the strips may change if I stop the
> > > program and restart it. I verified this problem on three different
> > > computers with different graphic hardware, so it seems common. The
> > > same programs run without problems under Windows 98 and NT 4.0.

> > > I have seen at least another programmer reporting the same problem
> > > with Windows 2000 somewhere on the WWW, but I can't recall where. It
> > > seems to be a bug in Windows 2000 sp1 (I am not positive if it was
> > > present also in the original version, but I think so).

> > > Is the bug acknowledged by Microsoft? By now hundreds of programmers
> > > should have found it. Is there a solution or workaround?

> > > TIA