Stipple pattern mis-alignment problem

I am using openGL to render geometry shapes such as stipple filled polygons. The problem I am runing into is that the stipple-filled pattern becomes mis-aligned AFTER Win32’s ScrollWindow(). I am using an offscreen DIB method to buffer openGL rendering. When scrolling occurs, I only redraw the invalidated area caused by scrolling. The problem appears that the stipple pattern no longer matches the previous one and therefore leave a small gap between them.

The similar problem can exist with GDI, but it can be solved by calling WIN32’s SetBrushOrgEx() to change brush(stipple pattern)'s origin after scrolling.

However, I am not aware there is a way to reset stipple pattern’s origin in openGL. I think both GDI and openGL needs to know the origin of the stipple pattern. There must be an openGL way to deal with this problem.

Anyway knows?



One way to workaround the problem is to always set scroll increment (or shift delta) to be a multiplier of 32 since a stipple pattern in openGL is defined as a bitmap of 32x32 pixels.

shifting 32 pixels will always align stipple pattern.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.