3.1 Activating RebelSDL

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:
By default, RebelSDL's hardware double buffer is sync'ed with the monitor's vertical refresh. This means that 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:
If this tag is set to 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:
This tag allows you to select a different render driver than the default one. This is mostly useful for testing purposes. For example, it is possible to force RebelSDL to use OpenGL on Windows instead of the default Direct3D driver with this tag. Possible values for this tag are direct3d, opengl, opengles, opengles2, rpi, and software. See Raspberry Pi peculiarities for more information on the rpi driver.

UseAudioAdapter:
By default, RebelSDL will replace Hollywood's inbuilt audio driver with a custom audio driver that uses SDL to play audio. If you don't want that, set this tag to 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:
If this is set to 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:
SDL offers a special display mode that automatically scales windows opened by SDL to the dimensions of the desktop. The window will then occupy all screen space without changing the monitor's resolution. You can activate this mode by setting this tag to 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:
If this is set to 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:
By default, SDL will try to use the GPU to draw graphics whenever and wherever possible. If you don't want this, you can set this tag to 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:
If this is set to 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.


Show TOC