All you have to do to make your script use SDL instead of Hollywood's inbuilt graphics driver is adding the following line to the top of your script:
@REQUIRE "rebelsdl" |
Alternatively, if you are using Hollywood from a console, you can also start your script like this:
Hollywood test.hws -requireplugins rebelsdl |
Once the RebelSDL plugin has been activated for your script, it will reroute all of Hollywood's graphics output through SDL. Note that this will usually be slower than Hollywood's inbuilt graphics driver for scripts that aren't optimized for RebelSDL. To get an optimal performance with SDL, your script needs to use a hardware-accelerated double buffer. See Using a hardware double buffer for details.
RebelSDL accepts the following arguments in its @REQUIRE
call:
EnableVSync:
Flip()
will always block until the next vertical refresh and then flip
the buffers. This will generate perfectly smooth graphics but of course it also means
that you can't draw faster than the monitor's vertical refresh, typically around 60 times
per second. If you want to ignore the monitor's vertical refresh, set this tag to False
and RebelSDL won't throttle double buffer flipping. It will then flip buffers as fast as
the hardware allows. Defaults to True
.
ForceFullRefresh:
False
, RebelSDL will only refresh the parts of the display that have
actually changed. This is quicker but it can lead to some refresh problems depending on the
way your script draws its graphics. That is why this tag defaults to True
, which means that
RebelSDL will always refresh the full display whenever something is drawn. This is slower
but guarantees that there will be no visual artefacts because front and back buffers will
always be completely in sync.
RenderDriver:
direct3d
, opengl
, opengles
, opengles2
, rpi
, and software
.
See Raspberry Pi peculiarities for more information on the rpi driver.
UseAudioAdapter:
False
. Then Hollywood's
inbuilt audio driver will be used even when RebelSDL is active. Normally, however, it's not necessary
to set this tag unless you experience problems with RebelSDL's audio driver. Defaults to True
.
UseBitmapAdapter:
True
, RebelSDL will override Hollywood's inbuilt handler for software
bitmaps. This doesn't have any practical advantages and was only implemented to test the
corresponding Hollywood SDK functionality. Defaults to False
.
UseDesktopFullScreen:
True
. Setting
this tag to True
will also automatically activate autoscaling for your display. Note that
a similar effect can be achieved by using Hollywood's FullScreenScale
display mode but
it's preferrable to use UseDesktopFullScreen
because it is directly tied to SDL.
Defaults to False
.
UseDoubleBufferAdapter:
False
, RebelSDL won't support hardware double buffers. Since hardware
double buffers are one of the most important features of RebelSDL, there's probably no
case where you'd want to disable this feature. It's mostly here for debugging purposes.
Defaults to True
.
UseSoftwareRenderer:
True
to put SDL into pure software
drawing mode. This is probably only of use for testing and debugging purposes because
normally you'd want to use the hardware renderer for the best performance. Defaults to
False
.
UseVideoBitmapAdapter:
False
, RebelSDL won't support hardware brushes. Since hardware brushes
are one of the most important features of RebelSDL, there's probably no case where you'd
want to disable this feature. It's mostly here for debugging purposes. Defaults to
True
.
Here is an example of how to pass arguments to the @REQUIRE
preprocessor command:
@REQUIRE "rebelsdl", {UseDesktopFullScreen = True} |
Alternatively, you can also use the -requiretags
console argument to pass these
arguments. See the Hollywood manual for more information.