Comments (19)
Confirming that SDL_UpdateRect does not seem to work :( Changing status to
accepted.
Original comment by [email protected]
on 23 Jun 2009 at 6:49
- Changed state: Accepted
from sdl-wii.
I set SDL_UpdateRects() to call the flip, is this sufficient?
Original comment by [email protected]
on 1 Jul 2009 at 7:50
from sdl-wii.
nevermind, that was a bad idea.
Original comment by [email protected]
on 1 Jul 2009 at 8:16
from sdl-wii.
dborth: I actually changed all UpdateRects to Flips. But, the point is,
UpdateRects
updates only PARTS of the screen, and Flip updates the entire screen. And
imagine
flipping 1024 times in a frame.
Original comment by [email protected]
on 2 Jul 2009 at 5:51
from sdl-wii.
yes but with this implementation we're never going to let you update the screen
directly, it has to work a bit different. it should only be drawn only once per
frame, which I believe is what UpdateRects is supposed to be for, kind of
the "equivalent" of the Flip() function, if you're using UpdateRect calls
instead?
Original comment by [email protected]
on 2 Jul 2009 at 6:04
from sdl-wii.
With SuperTux it does update the screen tile by title using SDL_UpdateRect().
Basically I just changed this to SDL_Flip() which seems to work fine. I'm
really not
sure of the performance hit is though.
I think the simplest is to just flip instead. It's probably what needs to
happen to
blit the GX texture to the screen anyway. The other option is to dynamically
create
a GX texture per UpdateRect request which is probably much slower than doing a
straight flip.
Original comment by [email protected]
on 2 Jul 2009 at 5:34
from sdl-wii.
It is sometimes a big perfomance hit, especially if you do 50 updaterects/frame
in
comparison to 50 flips/frame which makes it 50 frames. Can't you just set up a
thread that every 1/60th of a second (or 1/50th on PAL) flips? This is a
workaround
but a good one.
Original comment by [email protected]
on 3 Jul 2009 at 2:01
from sdl-wii.
Well that's what I was thinking to do in UpdateRects(), but I guess maybe I
can't do
it there
Original comment by [email protected]
on 3 Jul 2009 at 4:00
from sdl-wii.
How about the following for implementing UpdateRects.
First spawn a thread during SetVideoMode that will take the current texture
memory
and copy to the screen. Then when UpdateRects is called copy the specified
pixels
into texture memory. Now text time the tread executes our display will be
updated
with the correct image. FlipHWSurface can then just call UpdateRects with a
rectangle
that specifies the entire screen.
Attached is a patch that actually implements this idea as well as includes
support
for 32bit surfaces as well. It seemed to work reasonable well in my initial
testing.with my port of ONScripter
Original comment by [email protected]
on 12 Jul 2009 at 5:21
Attachments:
from sdl-wii.
The patch looks great, but it's a bit problematic in terms of performance.
After a
few changes, Super Mario War will run at about 90% speed on this patch. I'm not
sure
if it has to do with the video thread or the new conversion code (and switching
from
RGBA8 from 565), or something else...
Original comment by [email protected]
on 15 Jul 2009 at 4:50
from sdl-wii.
Can't we just update the rect in texturemem and flip whole buffer to the
screen.
Maybe not optimal but it would not affect the performance of anything else and
would
be faster that a complete blit as we'd only update the texturemem specified by
the rect.
Original comment by [email protected]
on 15 Jul 2009 at 7:02
from sdl-wii.
The patch I posted does just update the specified rectangle in the texture
memory and
then use a thread to continually blit the current texture to the screen. I can
modify
it so that 8 or 16bit surfaces use RGB565 while 24/32bit ones use RGBA8 and see
if
that helps the performance any.
Original comment by [email protected]
on 16 Jul 2009 at 5:53
from sdl-wii.
I've updated the previous patch to improve performance somewhat.
* 8 and 16bit surfaces use RGB565, 24 and 32bit use RGBA8
* removed memcpy's from UpdateRect functions
* inlined both Set_RGBA8Pixel and Set_RGB565Pixel
Together with the increase of thread priority I am now able to get decent movie
playback using some code I'm working on to play movies using SDL YUVOverlays
Original comment by [email protected]
on 16 Jul 2009 at 2:20
Attachments:
from sdl-wii.
great, I will test this patch out when I get a chance.
Original comment by [email protected]
on 16 Jul 2009 at 3:05
from sdl-wii.
Thanks for help, I may start finishing my ports now! :D
Original comment by [email protected]
on 16 Jul 2009 at 3:07
from sdl-wii.
ok, I've committed this patch (with a few small changes). there's still a
slight
performance decrease noticeable on Super Mario War, when compiled with this
patch
vs. without it.
Original comment by [email protected]
on 23 Jul 2009 at 6:26
- Changed state: Fixed
from sdl-wii.
hmm actually I spoke too soon. Something's wonky still, on dosbox the bottom
part of
the screen is partly cropped. also the performance hit is even more noticeable
there. I'm going to roll back until we work out the bugs.
Original comment by [email protected]
on 23 Jul 2009 at 7:08
- Changed state: Started
from sdl-wii.
ok, I've combined the submitted patch with the current codebase, UpdateRect is
now
supported.
Original comment by [email protected]
on 4 Aug 2009 at 7:20
- Changed state: Fixed
from sdl-wii.
Original comment by [email protected]
on 4 Aug 2009 at 8:53
- Changed state: Completed
from sdl-wii.
Related Issues (20)
- Undefined references to KEYBOARD functions HOT 1
- Keyboard has to be reconnected again to work :-( HOT 3
- Put SDL in portlibs directory? HOT 1
- Crash when unloading OGG music file HOT 2
- Wont compile HOT 2
- SMPEG Linking Errors When Using SDL_Mixer HOT 2
- Library does not work properly with libogc 1.8.7 HOT 1
- LIBPNG VERSION HOT 4
- SDL_Delay HOT 1
- SDL_image does not compile HOT 2
- Mouse emulation not working. HOT 3
- configure script fails due to devkitPPC unitptr_t conflict HOT 10
- Stereo for sound effects is reversed. HOT 1
- Mouse sensitivity HOT 2
- 640 X 512 screen resolution
- Font redering HOT 3
- Wireless USB Keyboard not working
- Gamecube controller support HOT 2
- SDL_CondWaitTimeout makes an incorrect timespec HOT 5
- SDL_KillThread is not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdl-wii.