Acorn Arcade forums: Programming: the SDL blues
|
the SDL blues |
|
instantiator (16:19 3/5/2005) davidm (06:59 4/5/2005) instantiator (13:50 4/5/2005) monkeyson2 (16:32 4/5/2005) Gulli (16:33 4/5/2005)
|
|
Lewis Westbury |
Message #64843, posted by instantiator at 16:19, 3/5/2005 |
Member
Posts: 365
|
I'm using C. So I've initialised the SDL correctly and I've got an SDL surface for my 640x480 (for argument/testing/learning's sake) 'screen'.
The next 3 things I do are: 1. fill it with an appropriate backdrop colour 2. load a bitmap 3. blit said bitmap onto the screen
I get: A titlebarred (SDL, I presume) window. Black. No backdrop. No blit.
And here come the questions: If I wanted full screen, no-WIMP behaviour, what should I have done? If SDL thinks its in the WIMP, is the reason I'm not getting the colour-fill or blit because I need to do all the other WIMP stuff first (registering an app, polling, redrawing)? Can SDL under ROS support Hardware Surfaces? as well as Software Surfaces?
Sorry for the plentyness of questions. If anyone can point me to a resource for this, I'd be much obliged, too. |
|
[ Log in to reply ] |
|
David McEwen |
Message #64856, posted by davidm at 06:59, 4/5/2005, in reply to message #64843 |
Member
Posts: 100
|
I recommend visting http://www.libsdl.org as it has docs and tutorials on usage. Alternatively finding a simple SDL app and looking at the code should show you what to do.
To have fullscreen display by default or SDL_FULLSCREEN with the flags passed into SDL_SetVideoMode.
For windowed behaviour you don't need to do any RISC OS specific stuff - the idea is that its platform neutral.
The docs on how RISC OS SDL work are included with the zip. IIRC in fullscreen mode the surfaces you get point directly to the RISC OS screen buffers.
The problem that you are having is that you haven't called SDL_UpdateRect(surface, 0, 0, 0, 0) to force it to update the display.
Hope that answers your questions. |
|
[ Log in to reply ] |
|
Lewis Westbury |
Message #64864, posted by instantiator at 13:50, 4/5/2005, in reply to message #64856 |
Member
Posts: 365
|
Thanks.
I had a wander through the header files and found loads of useful information.
SDL_UpdateRect worked great.
Seeing as I started from scratch, I suppose I ought to write an article or two... TIB interested? |
|
[ Log in to reply ] |
|
Phil Mellor |
Message #64865, posted by monkeyson2 at 16:32, 4/5/2005, in reply to message #64864 |
Please don't let them make me be a monkey butler
Posts: 12380
|
Seeing as I started from scratch, I suppose I ought to write an article or two... TIB interested? Definitely!
Could you email news@iconbar.com with your email address? |
|
[ Log in to reply ] |
|
Gunnlaugur Jonsson |
Message #64866, posted by Gulli at 16:33, 4/5/2005, in reply to message #64864 |
Member
Posts: 138
|
There's an excellent SDL tutorial here:
http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/index |
|
[ Log in to reply ] |
|
|
Acorn Arcade forums: Programming: the SDL blues |