Main Page | Modules | Related Pages

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.

All functions, except for hel_WinInitEx, 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_WinDeInit u8  WinNo  ) 
 

Set region of an existing window.

The hel_WinSetRegion function sets the region of an existing window.

Parameters:
WinNo Window-Number
Example:
  // DeInit Window 0
  hel_WinDeInit(0);

See also:
hel_WinInit

void hel_WinHide u8  WinNo  ) 
 

Hide an existing window.

The hel_WinHide function hides an existing window.

Parameters:
WinNo Window-Number
Example:
  hel_WinHide
  (
    0 // WinNo
  );

See also:
hel_WinInit, hel_WinHide, hel_WinSetVisible

void hel_WinInit u8  WinNo,
u8  Left,
u8  Top,
u8  Right,
u8  Bottom,
u8  InsideFlags,
u8  OutsideFlags
 

Initializes a new Window.

The hel_WinInit function initializes a new window.

Please refer to hel_WinInitEx for details.

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

void hel_WinInitEx u8  WinNo,
u8  Left,
u8  Top,
u8  Right,
u8  Bottom,
u8  InsideFlags,
u8  OutsideFlags,
u8  SkipOutsideFlags
 

Initializes a new Window.

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

Parameters:
WinNo Number of Window to initialize, this can be 0, 1 and 2. See notes!
Left Left screen-coordinate of window, specified in pixels.
Top Top screen-coordinate of window, specified in pixels.
Right Right screen-coordinate of window, specified in pixels.
Bottom Bottom screen-coordinate of window, specified in pixels.
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
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
SkipOutsideFlags Since the OutsideFlags are shared for Window 0 and 1, you might don't want to override them when you init 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:
  • WIN_BG0 : Enable BG Layer 0
  • WIN_BG1 : Enable BG Layer 1
  • WIN_BG2 : Enable BG Layer 2
  • WIN_BG3 : Enable BG Layer 3
  • WIN_OBJ : Enable OBJ Layer
  • WIN_FX : Enable SpecialFX processing
  • WIN_ALL : Enable all BG Layers and OBJ Layer (cannot be combined)
  • WIN_NONE : Disable all BG Layers and OBJ Layer (cannot be combined)
Example:
  hel_WinInitEx
  (
    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_WinDeInit

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:
WinNo Window-Number
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:
WinNo Window-Number
OutsideFlags Please refer to hel_WinInit
Example:
  hel_WinSetOutsideFlags
  (
    0,          // WinNo
    WIN_ALL     // InsideFlags
  );

See also:
hel_WinInit, 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:
WinNo Window-Number
Left Left screen-coordinate of window, specified in pixels.
Top Top screen-coordinate of window, specified in pixels.
Right Right screen-coordinate of window, specified in pixels.
Bottom Bottom screen-coordinate of window, specified in pixels.
Example:
  hel_WinSetRegion
  (
    0,    // WinNo
    0,    // Left
    16,   // Top
    240,  // Right
    144   // Bottom
  );

See also:
hel_WinInit, hel_WinDeInit

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:
WinNo Window-Number
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:
WinNo Window-Number
Example:
  hel_WinShow
  (
    0 // WinNo
  );

See also:
hel_WinInit, hel_WinHide, hel_WinSetVisible

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 Sun Oct 9 20:21:01 2005 by DoxyGen 1.4.4