Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Plotting an image 1 (second question coming soon)

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2001
    Posts
    9

    Plotting an image 1 (second question coming soon)

    In VC++ 6.0, using an MFC application, I am plotting the contents of an array on the screen. My first problem is how can I force the image to plot so that the top left corner of the image is locked to the top left corner of the window - even when the window is resized. My gl initialisation looks like this:

    GLvoid CChildView::ReSizeScene(GLsizei w, GLsizei h)
    {

    GLfloat Entf;
    //Range Var

    Entf = (float)imageHeight;
    if(h == 0)
    {
    h = 1;
    }

    glViewport(0, 0, w, h);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();

    //Clipping volume (left, right, bottom, top, near, far)
    if(w <= h)
    {
    glOrtho(0, Entf, 0, Entf*h/w, 0, 1) ;
    }
    else
    {
    glOrtho(0, Entf*w/h, 0, Entf, 0, 1) ;
    }

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    }

    I am a meer novice at all this so please answer in plain english..!

    [This message has been edited by amuirwood (edited 08-24-2001).]

  2. #2
    Junior Member Newbie
    Join Date
    Aug 2001
    Posts
    9

    Re: Plotting an image 1 (second question coming soon)

    PS Currently the bottom left corner of the image locks to the bottom left corner of the window.

  3. #3
    Guest

    Re: Plotting an image 1 (second question coming soon)

    Just use glRasterPos2f to postition your blit...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •