Results 1 to 5 of 5

Thread: glRasterPos() woes

  1. #1
    Member Contributor
    Join Date
    Jan 2003
    Location
    Wisconsin
    Posts
    56

    glRasterPos() woes

    I'm creating a bitmap-drawing function and I want it to draw just the part of the bitmap that's in my window when it's partially offscreen. It works fine on the top and right sides but not on the left or bottom. If I give glRasterPos() values that are offscreen it simply doesn't draw the bitmap. Is there any way around this?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jun 2003
    Posts
    177

    Re: glRasterPos() woes

    Clamp the raster pos to the edge of the screen, then offset the texture coordinates (or pixel coordinates) to compensate?

  3. #3
    Senior Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    765

    Re: glRasterPos() woes

    Originally posted by Tokage:
    If I give glRasterPos() values that are offscreen it simply doesn't draw the bitmap.
    That's exactly the behaviour specified in OpenGL.
    Originally posted by Tokage:
    Is there any way around this?
    Yes, first setup a valid raster position, that is inside the frustum. Then call glBitmap(0, 0, 0, 0, offset_x, offset_y, NULL);
    This will offset the raster position is screen coordinates. If that offset leads the position outside the screen, the bitmap rasterization will NOT be discarded (though it may be partially clipped obviously).

    It's explained better in the OpenGL FAQs. Check out the FAQs section at www.opengl.org

  4. #4
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: glRasterPos() woes


  5. #5
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: glRasterPos() woes

    glWindowPos will set the raster position in window coordinated, and keep it valid if it's outside view viewport.

Similar Threads

  1. glRasterPos() & glPixelZoom()
    By devdept in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-15-2010, 03:39 AM
  2. about glRasterPos and wglUseFontOutline
    By leegang in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 03-29-2003, 08:09 AM
  3. glRasterPos
    By mightyMo in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 08-06-2001, 07:38 AM
  4. glRasterPos problem
    By Kilam Malik in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 11-30-2000, 02:18 AM
  5. glRasterPos odd behavior
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 06-01-2000, 02:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean