Results 1 to 7 of 7

Thread: OpenGl and selective drawing

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

    OpenGl and selective drawing

    Now, this is one I may or may not have the answer to but can't get it right. I have a large gl texture which loads an image. From this, I calculate the the positions of sprites/tiles on it. That all seems to work no problem. The problem is when I need to draw a part of that image in opengl.

    I remember SDL has a Sdl_Rect you can use with sdl_blitsurface but I am avoiding that for major performance issues. I think it has something to do with the:
    Code:
            glTexCoord2i( VxR[1], VyR[2] );
    (ignore variables, directly from source) and I have to adjust the first decimal as a percentage (ie. 0.4758532875328947238947238947 yada yada) but how accurate is this? Since my code tries to support 'tilesets' of up to 90,000 tiles... (In case someone runs out although I doubt it).

    Or if the above is all wrong how would you go about doing this Really lost again

    Edit: and everything I try says it has to be a longing - that cannot support the decimal point.
    Edit2: ah baka-mistake - use gltexcoord2f!!!!! that solves the integer issue but how does it all work waaaa.
    Last edited by code_glitch; 13-02-2011 at 11:44 AM.
    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
  •