code_glitch
08-10-2011, 01:22 PM
Hey all, long time no gl fail, but this one is beyond me so I figured I'd ask some more knowledgeable people on the Gl topic, I checked my gl code over and over again but no luck... Go help us all if I'm doing something crucial wrong when rendering a quad :o
Here is the quad code:
procedure Image.RenderQuad(TextureArrayX: tRealArray1x2; TextureArrayY: tRealArray1x2; ScreenArrayX: tInt64Array1x2; ScreenArrayY: tInt64Array1x2);
begin
glBegin(GL_QUADS);
glTexCoord2f(TextureArrayX[1], TextureArrayY[1]);
glVertex3f(ScreenArrayX[1], ScreenArrayY[1], 0);
writeln('TX [',TextureArrayX[1], '.', TextureArrayY[1],'] SX [',ScreenArrayX[1],'.',ScreenArrayY[1],']');
glTexCoord2f(TextureArrayX[2], TextureArrayY[1]);
glVertex3f(ScreenArrayX[2], ScreenArrayY[1], 0);
writeln('TX [',TextureArrayX[2], '.', TextureArrayY[1],'] SX [',ScreenArrayX[2],'.',ScreenArrayY[1],']');
glTexCoord2f(TextureArrayX[1], TextureArrayY[2]);
glVertex3f(ScreenArrayX[1], ScreenArrayY[2], 0);
writeln('TX [',TextureArrayX[1], '.', TextureArrayY[2],'] SX [',ScreenArrayX[1],'.',ScreenArrayY[2],']');
glTexCoord2f(TextureArrayX[2], TextureArrayY[2]);
glVertex3f(ScreenArrayX[2], ScreenArrayY[2], 0);
writeln('TX [',TextureArrayX[2], '.', TextureArrayY[2],'] SX [',ScreenArrayX[2],'.',ScreenArrayY[2],']');
readln();
glEnd;
end;
where the values written to the screen are
TX [ 0.00000000000000E+000. 0.00000000000000E+000] SX [125.125]
TX [ 1.00000000000000E+000. 0.00000000000000E+000] SX [225.125]
TX [ 0.00000000000000E+000. 1.00000000000000E+000] SX [125.225]
TX [ 1.00000000000000E+000. 1.00000000000000E+000] SX [225.225]
Note that I am using a scale factor of 2 on noth the X and Y - all of this seems to work normally, but now for the screen shot where everything escapes me:
620
Why does it have that slice missing out of it? I cant for the life of me figure this one out - what I did come to a conclusion of though was that it was either something very simple and idiotic or something beyond what I was looking for...
Thanks,
code
Here is the quad code:
procedure Image.RenderQuad(TextureArrayX: tRealArray1x2; TextureArrayY: tRealArray1x2; ScreenArrayX: tInt64Array1x2; ScreenArrayY: tInt64Array1x2);
begin
glBegin(GL_QUADS);
glTexCoord2f(TextureArrayX[1], TextureArrayY[1]);
glVertex3f(ScreenArrayX[1], ScreenArrayY[1], 0);
writeln('TX [',TextureArrayX[1], '.', TextureArrayY[1],'] SX [',ScreenArrayX[1],'.',ScreenArrayY[1],']');
glTexCoord2f(TextureArrayX[2], TextureArrayY[1]);
glVertex3f(ScreenArrayX[2], ScreenArrayY[1], 0);
writeln('TX [',TextureArrayX[2], '.', TextureArrayY[1],'] SX [',ScreenArrayX[2],'.',ScreenArrayY[1],']');
glTexCoord2f(TextureArrayX[1], TextureArrayY[2]);
glVertex3f(ScreenArrayX[1], ScreenArrayY[2], 0);
writeln('TX [',TextureArrayX[1], '.', TextureArrayY[2],'] SX [',ScreenArrayX[1],'.',ScreenArrayY[2],']');
glTexCoord2f(TextureArrayX[2], TextureArrayY[2]);
glVertex3f(ScreenArrayX[2], ScreenArrayY[2], 0);
writeln('TX [',TextureArrayX[2], '.', TextureArrayY[2],'] SX [',ScreenArrayX[2],'.',ScreenArrayY[2],']');
readln();
glEnd;
end;
where the values written to the screen are
TX [ 0.00000000000000E+000. 0.00000000000000E+000] SX [125.125]
TX [ 1.00000000000000E+000. 0.00000000000000E+000] SX [225.125]
TX [ 0.00000000000000E+000. 1.00000000000000E+000] SX [125.225]
TX [ 1.00000000000000E+000. 1.00000000000000E+000] SX [225.225]
Note that I am using a scale factor of 2 on noth the X and Y - all of this seems to work normally, but now for the screen shot where everything escapes me:
620
Why does it have that slice missing out of it? I cant for the life of me figure this one out - what I did come to a conclusion of though was that it was either something very simple and idiotic or something beyond what I was looking for...
Thanks,
code