On Aug 22, 5:52=A0pm, Wolfgang Draxinger <wdraxin...@[EMAIL PROTECTED]
>
wrote:
> Knockr wrote:
> > Thanks for your reply.
>
> > my code for the same would look as follows
>
> > void ChangeSize(int w, int h)
> > {
> > =A0 =A0 =A0 =A0// Set View****t to window dimensions
> > =A0 =A0 =A0 =A0glView****t(0, 0, w, h);
>
> > =A0 =A0 =A0 win_h =3D w;
> > =A0 =A0 =A0 win_w =3D h;
>
> > =A0 =A0 =A0 =A0// Reset coordinate system
> > =A0 =A0 =A0 =A0glMatrixMode(GL_PROJECTION);
> > =A0 =A0 =A0 =A0glLoadIdentity();
> > =A0 =A0 =A0 =A0glOrtho(0, win_w, 0, win_h, -1.0, 1.0);
>
> > =A0 =A0 =A0 =A0glMatrixMode(GL_MODELVIEW);
> > =A0 =A0 =A0 =A0glLoadIdentity();
> > =A0 =A0 =A0 =A0glutPostRedisplay();
> > }
>
> Here's some advice: Don't do it that way. glView****t and setting
> the matrices are very cheap calls. The best practice to do the
> whole setup just right before the rendering. So your display()
> function would look like
>
> void display()
> {
> =A0 =A0 =A0 =A0 glView****t(0, 0, win_w, win_h);
>
> =A0 =A0 =A0 =A0 glMatrixMode(GL_PROJECTION);
> =A0 =A0 =A0 =A0 glLoadIdentity();
> =A0 =A0 =A0 =A0 glOrtho(0, win_w, 0, win_h, -1.0, 1.0);
>
> =A0 =A0 =A0 =A0 glMatrixMode(GL_MODELVIEW);
> =A0 =A0 =A0 =A0 glLoadIdentity();
>
> =A0 =A0 =A0 =A0 /* render that stuff */
>
> }
>
> the reshape function would simplify to something like
>
> void ChangeSize(int w, int h)
> {
> =A0 =A0 =A0 =A0 win_w =3D w;
> =A0 =A0 =A0 =A0 win_h =3D h;
> =A0 =A0 =A0 =A0 glutPostRedisplay();
>
> }
> > the extra ****tion of the displaying window look as black when
> > CLAMP_TO_EDGE parameter. Otherwise the something like repeat
> > effect. but the texture never rendered full view****t
>
> Well, did you try GL_GLAMP (just CLAMP, nothing more)? Normally,
> if there's no border supplied, GL_CLAMP_TO_BORDER should exhibit
> the same behavior as GL_CLAMP, but some drivers might break
> that.
>
> Oh, and something I totally missed before: You actually _made_
> some mistake: TEXTURE_RECTANGLE textures are addressed in
> absolute pixels, not in relative [0, 1]^n coordinates, so you've
> to write:
>
> glEnable(GL_TEXTURE_RECTANGLE_ARB);
> glBindTexture(GL_TEXTURE_RECTANGLE_ARB, TextureImage[i]->texID);
>
> GLint tex_w =3D TextureImage[i]->sizeX;
> GLint tex_w =3D TextureImage[i]->sizeY;
>
> glBegin(GL_QUADS);
> glTexCoord2i(0, 0);
> glVertex2f(0.0, 0.0);
>
> glTexCoord2i(tex_w, 0);
> glVertex2f(win_w, 0.0);
>
> glTexCoord2i(tex_w, tex_h);
> glVertex2f(win_w, win_h);
>
> glTexCoord2i(0, tex_h);
> glVertex2f(0.0, win_h);
> glEnd();
>
> Wolfgang Draxinger
> --
> E-Mail address works, Jabber: hexar...@[EMAIL PROTECTED]
ICQ: 134682867
Hello,
Thanks for your reply.
my first try was to map the texture using the original size of the
image. but it shows the same behavior.
I also tried CLAMP and CLAMP_TO_BORDER but I could not make a full
screen rendering. I dont know what really happened. the texture size
is 800x600. If the window size is reduced I can see only a ****tion of
the image. What I need is to fit the texture to the window. :(
I'm a newbie with OpenGL. I could not understand what really went
wrong.
Thanks again for your reply.


|