Skip to main content
GameDev.net gamedev.net
🔒 Locked

SDL problem......

Started by hemant Mar 8, 2004 at 9:01 PM 2 replies 300+ views
Original Post
hemant
hemant
Hi..All... My problem...is i just want to redraw a part of main SDL_Surface..So basically i have blitted some 15 images to the screen(main SDL_Surface) now when user clicks on a particular image i want to swap the location of image with an empty location(where no image is blitted)..So for that purpose i want to refresh or Update only that portion of the screen..where this swap is taking place... i have tried SDL_UpdateRect() ,SDL_UpdateRects() and SDL_Flip()..but as when i try to catch the error if Blitting or updatinig is unsuccessful i get no errors....But still nothing is redrawn on my screen..it remains the same.... How to do?????
KingJeihova9
KingJeihova9
According to the documentations over at libsdl.org here is a brief description of the SDL_UpdateRect() function.

SDL_UpdateRect — Makes sure the given area is updated on the given screen.

So it basically updates a section of a surface. This is the function you should use. If it doesn''t work then you''re doing something wrong obviously.



(My Wisdom) + (My Courage) + (My Will) > God''s Power - (ytilaerlariv) = [My] laissez faire [for] Liberatis
(My Wisdom) + (My Courage) + (My Will) > God's Power - (ytilaerlariv) = [My] laissez faire [for] Liberatis
monkey_32606
monkey_32606
Just to make sure ...

You are flipping the screen right?
(most common mistake but probably a stupid question)
Quote: Michael TanczosCut that shit out. You shouldn't be spying on other people.. especially your parents. If your dad wanted to look at horses having sex with transexual eskimo midgets, that's his business and not yours.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.