Simple question about SetClipRect!

high,

im working on a top down RPG. anyway, i recently discovered the wonderfull
function called SetClipRect. this thing rocks!! now all i need is one call
to this function, and it will automatically clip anything outside of my game
screen! that saves me a lot of code…(i have an 800x600 screen, and the
game screen takes up 600x600 pixels. the 200x600 pixels on the right edge of
the screen will make up the players status bar. my question is this: since
the ClipRect wont blit anything unless its coordinates fall into the game
screen, how the hell do i draw my status bar? i mean, if i try to draw to
the right edge of the screen, obviously the ClipRect will stop it from being
drawn. so then how do i draw my players name/health etc ? do i have to
re-set the SDL_Rect associated with the SetClipRect each frame??? or is
there something that im not understanding about how it works? i was thinking
of making a blank surface with CreateRGBSurface, then blitting to that, but
where would i blit this blank surface? im just confused… thanks for any
help!!!_________________________________________________________________
Lose those love handles! MSN Fitness shows you two moves to slim your waist.
http://fitness.msn.com/articles/feeds/article.aspx?dept=exercise&article=et_pv_030104_lovehandles

[…clipping…]

so then how do i draw my players
name/health etc ? do i have to re-set the SDL_Rect associated with
the SetClipRect each frame???

Yep, that’s it.

Of course, if you’re rendering into your own shadow surface (good idea
if you want alpha blending when there are no h/w alpha blits), you
could split the shadow surface in two; one for the game screen, and
one for the status bar. Then you wouldn’t need to use
SDL_SetClipRect() at all.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Thursday 22 April 2004 07.23, Graveyard Filla wrote:

Ok, I have some menus done in SDL for a game and the game itself is done in
opengl. Is there an easy way to switch back from one to the other? Right
now it only works because the menu is called before the opengl stuff is, but
I’d like to be able to go back to the menu again.

Thanks,

Matt