LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-10-2004, 11:14 AM   #1
MadCactus
Member
 
Registered: Jul 2003
Distribution: Slackware 9.1
Posts: 195

Rep: Reputation: 30
SDL_Flip() Vs SDL_UpdateRects()


Hi,

I thought that with SDL double-buffering was only available with a HW surface, which is only available full-screen (right?).

I'm using a SW (presumably single-buffered since I haven't requested double-buffering) screen surface, and SDL_UpdateRects() does not seem to work like I expected.

With SDL_UpdateRects() the areas requested are updated, but not drawn unless the window receives a VIDEOEXPOSE event... Spooky. However SDL_Flip(screen) (which should just act like SDL_UpdateRect(screen, 0, 0, 0, 0)) updates and draws everything ok. This however is a bit more expensive than i'd like.

The only thing I can think of is that SDL_Flip() creates and handles its own VIDEOEXPOSE event, while SDL_UpdateRects() doesn't.

So should I send a VIDEOEXPOSE event after calling SDL_UpdateRects(), or am I going wrong somewhere?
 
Old 10-10-2004, 04:26 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
I read somewhere (I don't remember exactly where) that:

- HW surface isn't necessarily faster then SW surface. (except for 3D I assume)

- SDL_UpdateRects() works on SW surface(?) (I'm not very sure about this one)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration