PDA

View Full Version : Plotting an image 1 (second question coming soon)



amuirwood
08-24-2001, 12:16 AM
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).]

amuirwood
08-24-2001, 12:18 AM
PS Currently the bottom left corner of the image locks to the bottom left corner of the window.

08-24-2001, 10:59 AM
Just use glRasterPos2f to postition your blit...