Results 1 to 3 of 3

Thread: glBitmap(w, h, Xorig, Yorig, Xmove, Ymove, Image); Yorig doesn't work.

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2003
    Posts
    4

    glBitmap(w, h, Xorig, Yorig, Xmove, Ymove, Image); Yorig doesn't work.

    Hi, I've been puzzled with this function for some time now. I call
    glBitmap(16, 16, 0, 0, 17,0, hourglass);
    glBitmap(16, 16, 0, 33, 17,0, hourglass);
    glBitmap(16, 16, 0, 0, 17, hourglass);

    and the output looks like this: X X
    X
    where X is the hourglass.
    X
    I expected it to look like this:X X

    Why Yorig=33 behaves like -33?
    I don't rotate or translate anywhere in my
    code. I do have an orthographic projection of
    glOrtho(0, w,0, h, -1.0, 1.0);
    and I give glBitmap a valid raster position as well.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: glBitmap(w, h, Xorig, Yorig, Xmove, Ymove, Image); Yorig doesn't work.

    Code :
    void glBitmap(
      GLsizei width,
      GLsizei height,
      GLfloat xorig,
      GLfloat yorig,
      GLfloat xmove,
      GLfloat ymove,
      const GLubyte *bitmap
    );
    xorig and yorig are where the origin of your bitmap is stored. You are setting the origin at 0, 33 for a 16x16 bitmap. The origin of the image is measured from the lower-left of the bitmap, so you are setting your origin up above the image by 17 pixels. So... when the bitmap is drawn with the origin at the current raster position, the bitmap is drawn below the raster position.

    I think what you actually want to be using is glRasterPos to position your bitmaps.
    Deiussum
    Software Engineer and OpenGL enthusiast

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2003
    Posts
    4

    Re: glBitmap(w, h, Xorig, Yorig, Xmove, Ymove, Image); Yorig doesn't work.

    Thanks for the clarification.

Similar Threads

  1. second UBO doesn't work
    By mlkn_mlkn in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 05-11-2015, 12:34 PM
  2. GPU_MAX_HEAP_SIZE doesn't work
    By luizdrumond in forum OpenCL
    Replies: 0
    Last Post: 04-14-2013, 04:33 PM
  3. ext doesn't work although supported
    By famous in forum OpenGL: GLSL
    Replies: 1
    Last Post: 05-17-2010, 03:18 AM
  4. It doesn't work...
    By GunCraP in forum OpenGL: User Software
    Replies: 0
    Last Post: 01-03-2003, 01:46 AM
  5. Why doesn't this work
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-11-2002, 02:25 AM

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