Re: [GtkGLExt] How to show text?



Nerius Landys wrote:
> There is one annoying thing with the way these two examples work.  The
> "origin" of the text image is the upper left corner of the text area.
> (Or is it the lower left corner?  I can't remember now.)  If the
> origin point is outside the widget viewport, the entire text won't get
> rendered.  So for example If you render the text "abcdefg" and the
> letter 'a' is just barely outside the widget to the left, the entire
> string won't get rendered (it "disappears").  If you figure out a
> clean way to address this issue I'd like to know about it.
> 

It's not a problem with glDrawPixels, it's because raster position is
invalid (subequent glDrawPixels are ignored) when glRasterPos is called
with the location outside the window. Solutions are to replace

  glRasterPos2i(xMove, yMove);

with

  glRasterPos2i(0, 0);
  glBitmap (0, 0, 0, 0, xMove, yMove, NULL);

or even glWindowPos(xMove, yMove) (see ARB_window_pos or OpenGL spec
since 1.4).

See http://www.opengl.org/resources/faq/technical/clipping.htm#0070

Michalis


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]