Results 1 to 6 of 6

Thread: OpenGl Quickie

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Hmm, I've managed to sort of fix the problem. But now I have a new problem... The image is, how to put it, not garbled but..... well. check the attachment Its better but not really practical.

    To compare result is what the program looks like and Picture.png is what it should look like... Any ideas as to what I'm doing wrong? Here's my render code:

    Code:
    procedure Image.Draw(X,Y: Int64);
    var
        VxR: array [1..2] of LongInt;
        VyR: array [1..2] of LongInt;
        
        PxR: array [1..2] of Int64;
        PyR: array [1..2] of Int64;
        
    begin
        VxR[1] := 0;
        VxR[2] := Surface.W;
        VyR[1] := 0;
        VyR[2] := Surface.H;
        
        PxR[1] := X;
        PxR[2] := X + Surface.W;
        PyR[1] := Y;
        PyR[2] := Y + Surface.H;
    
        glBindTexture( GL_TEXTURE_2D, texture );
    
        glBegin( GL_QUADS );
    
        glTexCoord2i( VxR[1], VyR[2] );
        glVertex3f( PxR[1], PyR[2], 0. );
    
        glTexCoord2i( VxR[2], VyR[2] );
        glVertex3f( PxR[2], PyR[2], 0. );
    
        glTexCoord2i( VxR[2], VyR[1] );
        glVertex3f( PxR[2], PyR[1], 0. );
    
         glTexCoord2i( VxR[1], VyR[1] );
        glVertex3f( PxR[1], PyR[1], 0. );
        glEnd();
    end;
    Note that these images were originally PNG before PGD converted them to jpg....

    Edit: Almost forgot to mention: I am expecting it to go off the edge of the screen... I have a different scale procedure.
    Attached Images Attached Images
    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
  •