Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2010
    Posts
    472

    SDL Area Update?

    Alrighty... I feel like I'm missing something somewhere, but I can't seem to pinpoint it.

    Assumably, the only surfaces that can be 'flipped' are the ones that have had SetVideoMode functionality assigned to it. I say this because I've attempted to make it possible to turn a different surface (Aside from the main screen) into a flippable element (In an attempt to update -only- that part of the screen), and it doesn't seem to do anything at all.

    Of course, the goal being to just update a particular element of the screen, without needing to re-draw the entire screen - or, better yet, make a 'mini-screen inside the main screen'. Is this a possibility, or am I pretty well restricted to working with one major background?

    Thanks!

    Edit:
    I'm thinking there's a way to do it through the use of SDL_UpdateRect, but I'm not fully understanding how that works at the moment. Any tips, or light to be shed on that topic?
    Last edited by PDI247; 12-14-2010 at 04:51 AM.
    "It's most impressive when it's least expected."

  2. #2
    Join Date
    Jun 2003
    Location
    Trier, Germany
    Posts
    1,350
    usually, you should not have to worry about this kind of overdraw nowadays. even the cheapest graphics cards are capable of performing thousands of full screen updates every second, so there is really no need for pulling stunts with SDL_UpdateRect().
    fact is, the most expensive part of both SDL_Flip() and SDL_UpdateRect() is the waiting for vsync which can easily take an order of magnitude longer than a whole screen redraw.

  3. #3
    Join Date
    Jul 2010
    Posts
    472
    Alrighty. so to clarify, it's generally a better idea to just run with a full-screen update, instead of only a portion?

    Thanks!
    "It's most impressive when it's least expected."

  4. #4
    Join Date
    Jun 2003
    Location
    Trier, Germany
    Posts
    1,350
    Quote Originally Posted by PDI247 View Post
    so to clarify, it's generally a better idea to just run with a full-screen update, instead of only a portion?
    that's the idea.

Posting Permissions

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