Results 1 to 6 of 6

Thread: GlQuad - strange behaviour

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45

    GlQuad - strange behaviour

    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

    Here is the quad code:
    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
    Code:
    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:
    Weird Gl Quad.png

    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
    Last edited by code_glitch; 08-10-2011 at 01:29 PM. Reason: Typo. Cold hands...
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

Bookmarks

Posting Permissions

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