Window Functions

Description. More...

Functions


Detailed Description

Description.

The Window Feature can be used to split the screen into different regions. BG0-3, OBJ Layers and Special Effects can be separately enabled and/or disabled in each of these regions.

Most functions get replaced with macros when you switch to release-mode. The Window Attributes are shadowed and need to be transmitted to hardware during Vertical Blank. This method avoids screen tearing!


Function Documentation

void hel_WinCreate ( u8  WinNo,
u8  Left,
u8  Top,
u8  Right,
u8  Bottom,
u8  InsideFlags,
u8  OutsideFlags 
)

Create a new Window.

The hel_WinCreate function creates a new window.

Please refer to hel_WinCreateEx for details.

Note:
hel_WinInit just calls hel_WinCreateEx with SkipOutsideFlags set to FALSE.

void hel_WinCreateEx ( u8  WinNo,
u8  Left,
u8  Top,
u8  Right,
u8  Bottom,
u8  InsideFlags,
u8  OutsideFlags,
u8  SkipOutsideFlags 
)

Create a new Window.

The hel_WinCreateEx function initializes a new window. Windows can be used, for example, to split the screen into different regions.

Parameters:
[in] WinNo Number of Window to initialize, this can be 0, 1 and 2. See notes!
[in] Left Left screen-coordinate of window, specified in pixels.
[in] Top Top screen-coordinate of window, specified in pixels.
[in] Right Right screen-coordinate of window, specified in pixels.
[in] Bottom Bottom screen-coordinate of window, specified in pixels.
[in] InsideFlags The InsideFlags can be used to separately enable and/or disable BG0-3, OBJ layers as well as SpecialFX for the inner-region. The following values can be used and combined for the InsideFlags (See notes!):
  • WIN_BG0
  • WIN_BG1
  • WIN_BG2
  • WIN_BG3
  • WIN_OBJ
  • WIN_FX
  • WIN_ALL
  • WIN_NONE
[in] OutsideFlags The OutsideFlags can be used to separately enable and/or disable BG0-3, OBJ layers as well as SpecialFX for the outer-region. Please note that window 0 and 1 share the OutsideFlags. You can only use the OutsideFlags for window 0 and 1 together. The following values can be used and combined for the InsideFlags (See notes!):
  • WIN_BG0
  • WIN_BG1
  • WIN_BG2
  • WIN_BG3
  • WIN_OBJ
  • WIN_FX
  • WIN_ALL
  • WIN_NONE
[in] SkipOutsideFlags Since the OutsideFlags are shared for Window 0 and 1, you might don't want to override them when you create another window. When you set SkipOutsideFlags to TRUE, they will not be set! This parameter has no impact on Window 2.
Note:
Window 2, the Object Window, is specified by Objects (Sprites) which are having the Object-Mode set to OBJ_MODE_OBJWINDOW. Any pixels of these Objects with the palette index 0, are used as Object Window Region. The Object itself is not displayed! For more about Objects, please refer to the Object Documentation and read: hel_ObjCreate
OutsideFlags have to be specified always for Window 2 and SkipOutsideFlags have to be FALSE.
Parameters: Example:
  hel_WinCreateEx
  (
    0,                            // WinNo
    0,                            // Left
    16,                           // Top
    240,                          // Right
    144,                          // Bottom
    WIN_BG0 | WIN_BG 1 | WIN_FX,  // InsideFlags
    WIN_NONE,                     // OutsideFlags
    FALSE                         // SkipOutsideFlags
  );

See also:
hel_WinSetRegion, hel_WinDelete

void hel_WinDelete ( u8  WinNo  ) 

Delete an existing window.

The hel_WinDelete function deletes the window specified by WinNo.

Parameters:
[in] WinNo Window-Number
See also:
hel_WinCreate, hel_WinCreateEx

void hel_WinHide ( u8  WinNo  ) 

Hide an existing window.

The hel_WinHide function hides an existing window.

Parameters:
[in] WinNo Window-Number
See also:
hel_WinInit, hel_WinHide, hel_WinSetVisible

void hel_WinInit ( void   ) 

Initialize the Window-System.

Call this function before using any other function from the Window-System Module. If you don't initialize the Window-System, the program behaviour is undefined.

See also:
hel_WinCreate, hel_WinQuit

void hel_WinQuit ( void   ) 

Uninitialize the Window-System.

The hel_WinQuit function uninitializes Window-System and deactivates window processing. It deactivates the window attributes in the display control register and transmits default window attributes to the hardware.

See also:
hel_WinInit

void hel_WinSetInsideFlags ( u8  WinNo,
u8  InsideFlags 
)

Set inside flags of an existing window.

The hel_WinSetInsideFlags function sets the InsideFlags of an existing window.

Parameters:
[in] WinNo Window-Number
[in] InsideFlags Please refer to hel_WinInit
Example:
  hel_WinSetInsideFlags
  (
    0,                  // WinNo
    WIN_BG2 | WIN_FX    // InsideFlags
  );

See also:
hel_WinInit, hel_WinSetOutsideFlags

void hel_WinSetOutsideFlags ( u8  WinNo,
u8  OutsideFlags 
)

Set inside flags of an existing window.

The hel_WinSetInsideFlags function sets the InsideFlags of an existing window.

Parameters:
[in] WinNo Window-Number
[in] OutsideFlags Please refer to hel_WinCreateEx
Example:
  hel_WinSetOutsideFlags
  (
    0,          // WinNo
    WIN_ALL     // InsideFlags
  );

See also:
hel_WinCreateEx, hel_WinSetInsideFlags

void hel_WinSetRegion ( u8  WinNo,
u8  Left,
u8  Top,
u8  Right,
u8  Bottom 
)

Set region of an existing window.

The hel_WinSetRegion function sets the region of an existing window.

Parameters:
[in] WinNo Window-Number
[in] Left Left screen-coordinate of window, specified in pixels.
[in] Top Top screen-coordinate of window, specified in pixels.
[in] Right Right screen-coordinate of window, specified in pixels.
[in] Bottom Bottom screen-coordinate of window, specified in pixels.
See also:
hel_WinInit, hel_WinDelete

void hel_WinSetVisible ( u8  WinNo,
u8  Value 
)

Set visibility of an existing window.

The hel_WinSetVisible function either shows or hides the Window specified by WinNo.

Parameters:
[in] WinNo Window-Number
[in] Value TRUE to show, FALSE to hide
Example:
  hel_WinSetVisible
  (
    0,      // WinNo
    FALSE   // Value
  );

See also:
hel_WinInit, hel_WinShow, hel_WinHide

void hel_WinShow ( u8  WinNo  ) 

Show an existing window.

The hel_WinShow function shows an existing window, which was made invisible from a previous call to hel_WinHide.

Parameters:
[in] WinNo Window-Number
See also:
hel_WinInit, hel_WinHide, hel_WinSetVisible

HEL_INLINE void hel_WinTransmit ( void   ) 

Transmit Window Attributes to Vram.

The hel_WinTransmit function must be called during VBlank to transmit the shadowed window attributes to hardware.


Generated on Fri Aug 17 12:12:39 2007 for HEL Library by  doxygen 1.5.3