APTR handle = OpenDisplay(STRPTR title, int x, int y, int width, int height, ULONG flags, struct hwTagList *tags);
Your implementation has to return a handle that is used to refer to this display
later or NULL
in case an error has occurred.
The flags
parameter can be a combination of the following individual flags:
HWDISPFLAGS_BORDERLESS:
HWDISPFLAGS_SIZEABLE:
HWDISPFLAGS_FIXED:
HWDISPFLAGS_NOHIDE:
HWDISPFLAGS_NOCLOSE:
HWDISPFLAGS_AUTOSCALE:
HWDISPFLAGS_LAYERSCALE:
HWDISPFLAGS_LAYERS:
HWDISPFLAGS_DOUBLEBUFFER:
HWDISPFLAGS_HARDWAREDB:
HWDISPFLAGS_FULLSCREEN:
x
and y
parameters in that case.
HWDISPFLAGS_DISABLEBLANKER:
HWDISPFLAGS_ALWAYSONTOP:
HWDISPFLAGS_SCALEFACTOR:
HWDISPATTR_SCALEFACTOR
using hw_GetDisplayAttr().
Note that an enabled scale factor mode doesn't necessarily mean that the scale
factor is different from 1.0. Scale factor mode can be enabled and the scale
factor can still be 1.0 in which case your display should behave as if no scale
factor mode was active. (V9.0)
HWDISPFLAG_TRAPRMB:
TrapRMB
option to True
. (V9.0)
HWDISPFLAG_KEEPPROPORTIONS:
KeepProportions
option to True
. (V9.0)
Additionally, Hollywood will pass a tag list to OpenDisplay()
. This tag list
can contain the following tags:
HWDISPTAG_BUFFERWIDTH:
HWPLUG_CAPS_DOUBLEBUFFER
. Custom double buffers
don't have to draw into the back buffer first because double buffer frames are
usually updated multiple times per second so there's no need to cache an
additional back buffer for refreshing the window when parts of it have to
be redrawn.
HWDISPTAG_BUFFERHEIGHT:
HWDISPTAG_OPTIMIZEDREFRESH:
ULONG
. Your
plugin can write True
to this pointer if it wants Hollywood to enable
optimized refresh for this display. Optimized refresh should be enabled
on systems where it's more efficient to refresh the complete display instead
of several smaller parts. By default, Hollywood prefers to refresh just
the parts of the display that actually need refreshing. On some backends,
however, this is quite slow if several smaller parts have to be updated.
It is often faster to refresh the complete display on these systems. This
is especially true for backends that are double buffer based because
refreshing a single tile on double buffer based backends means doing a
complete buffer flip which doesn't look so nice and is quite slow. That's
why it is wise to enable this option on some systems. By default, optimized
refresh is disabled.
HWDISPTAG_SINGLEREFRESHFX:
ULONG
. Your
plugin can write True
to this pointer if it wants Hollywood to enable single
refresh transition effect drawing for this display. This option is related
to the HWDISPTAG_OPTIMIZEDREFRESH
tag (see above). If you set the pointer
that you are passed here to True
, Hollywood will draw one transition effect
frame in exactly one video frame. If it is set to False
(which is also the
default), Hollywood might emit more than one video frame for a single
transition effect frame. This is especially so for transition effect frames
that consist of many small parts that need to be updated. If HWDISPTAG_SINGLEREFRESHFX
is not set to True
, Hollywood will prefer to draw many small parts instead
of the complete frame all at once. On some systems, however, drawing many
small bits totally kills the performance. In that case you need to set this tag
to True
. See above in HWDISPTAG_OPTIMIZEDREFRESH
for additional information.
HWDISPTAG_LUASTATE:
lua_State
.
HWDISPTAG_MONITOR:
HWDISPTAG_SCREENWIDTH:
HWDISPFLAGS_FULLSCREEN
has been set, this tag contains the desired
pixel width for the full screen mode. This is not necessarily the same
as the display width since the user might explicitly choose a full
screen resolution that is larger than the display, e.g. an 800x600
screen mode for a 640x480 display.
HWDISPTAG_SCREENHEIGHT:
HWDISPFLAGS_FULLSCREEN
has been set. See above for details.
HWDISPTAG_SCREENDEPTH:
HWDISPFLAGS_FULLSCREEN
has been
set. On most systems you may choose to ignore this since most modern
systems all operate in 32-bit true colour mode.
HWDISPTAG_SCALEWIDTH:
HWDISPFLAGS_AUTOSCALE
or HWDISPFLAGS_LAYERSCALE
is active, this
tag contains the current scale width.
HWDISPTAG_SCALEHEIGHT:
HWDISPFLAGS_AUTOSCALE
or HWDISPFLAGS_LAYERSCALE
is active, this
tag contains the current scale height.
HWDISPTAG_SCALEMODE:
HWDISPFLAGS_AUTOSCALE
or HWDISPFLAGS_LAYERSCALE
is active, this
tag contains the current scale mode. Currently, only 0 and 1 are
defined here. 0 means hard scaling with no interpolation whereas 1
means anti-alias interpolated scaling.
HWDISPTAG_DEPTH:
HWDISPTAG_PALETTE:
pData
member of this
tag will be set to a ULONG
array containing the display's palette.
The individual colors will be stored as RGB values in the palette array.
(V9.0)
HWDISPTAG_PALETTEMODE:
pData
member of this
tag will be set to a pointer to an int
. Your display adapter can
write the value True
to this int
to signal that it supports genuine
palette mode. A genuine palette mode is a screen mode which is palette-based
so that changing a single pen will automatically change all pixels that
use that pen. A genuine palette display allows Hollywood to use several
optimizations because screen pixels can be changed by just changing
color registers, i.e. without copying any actual pixel data. If you
enable genuine palette mode, you must also set HWSDAFLAGS_PALETTE
and one or both of HWSDAFLAGS_PENDRAW
and HWSDAFLAGS_SETPALETTE
using hw_SetDisplayAdapter().
See hw_SetDisplayAdapter for details. (V9.0)
HWDISPTAG_MENU:
pData
member of this tag to a struct hwMenuTreeInfo
pointer which contains all nodes and leaves of the menu bar.
See SetMenuBar for a description of this structure.
Whenever the user selects a menu item, you need to post an HWEVT_MENUITEM
event to Hollywood's event queue. See hw_PostEvent for details.
Note that this tag will only ever be set if your display adapter
has signalled that it supports menus by setting the HWSDAFLAGS_MENUADAPTER
when calling hw_SetDisplayAdapter().
See hw_SetDisplayAdapter for details. (V9.0)
HWDISPTAG_XPOSITION:
pData
member of this tag is set to a pointer to an int
that
contains the display's x position. This is identical to the x position
passed to your OpenDisplay()
implementation. However, if your implementation
decides to open the display at a position different to the requested
one, you should write the actual x position of your display to the int
pointer passed in the pData
member of the tag so that Hollywood can
get to know the display's real x position. (V9.1)
HWDISPTAG_YPOSITION:
pData
member of this tag is set to a pointer to an int
that
contains the display's y position. This is identical to the y position
passed to your OpenDisplay()
implementation. However, if your implementation
decides to open the display at a position different to the requested
one, you should write the actual y position of your display to the int
pointer passed in the pData
member of the tag so that Hollywood can
get to know the display's real y position. (V9.1)
HWDISPTAG_FLAGS:
pData
member of this tag is set to a pointer to a ULONG
that
contains the display flags. This is identical to the display flags
passed to your OpenDisplay()
implementation. However, if your implementation
decides to modify the requested display flags in any way (e.g. adding
or removing flags), you should write the actual display flags to the
ULONG
pointer passed in the pData
member of the tag so that Hollywood
can get to know the display's real flags. (V9.1)
HWDISPTAG_USERTAGS:
pData
will point to a struct hwUserTagList
containing
a list of user tags passed by the Hollywood script. User tags are a way of
passing additional information from Hollywood scripts to plugin functions.
See User tags for details. (V10.0)
Please note that Hollywood supports multiple displays so OpenDisplay()
can be called several times. Hollywood also supports multiple full
screen displays if they are to appear on different monitors. Be prepared
to deal with these cases.
NULL
in case of an error