console.h

nds stdio support. [詳細]

#include <nds/ndstypes.h>
#include <nds/arm9/background.h>

ソースコードを見る。

構成

struct  ConsoleFont
struct  PrintConsole
 console structure used to store the state of a console render context [詳細]

型定義

typedef bool(* ConsolePrint )(void *con, char c)
typedef struct ConsoleFont ConsoleFont
typedef struct PrintConsole PrintConsole

列挙型

enum  DebugDevice {
  DebugDevice_NULL = 0x0,
  DebugDevice_NOCASH = 0x1,
  DebugDevice_CONSOLE = 0x02
}
 

Console debug devices supported by libnds.

[詳細]

関数

void consoleSetFont (PrintConsole *console, ConsoleFont *font)
 Loads the font into the current console.
void consoleSetWindow (PrintConsole *console, int x, int y, int width, int height)
 Sets the print window.
PrintConsoleconsoleGetDefault (void)
 Gets a pointer to the default console (this should only be used when using a single console, other wise use consoleNew(PrintsConsole* console).
void consoleSelect (PrintConsole *console)
 Make the specified console the render target.
PrintConsoleconsoleInit (PrintConsole *console, int layer, BgType type, BgSize size, int mapBase, int tileBase, bool mainDisplay, bool loadGraphics)
 Initialise the console.
PrintConsoleconsoleDemoInit (void)
 Initialize the console to a default state for prototyping. This function sets the console to use sub display, VRAM_C, and BG0 and enables MODE_0_2D on the sub display. It is intended for use in prototyping applications which need print ability and not actual game use. Print functionality can be utilized with just this call.
void consoleClear (void)
 Clears the screan by iprintf("\x1b[2J");.
void consoleDebugInit (DebugDevice device)
 Initializes debug console output on stderr to the specified device.

説明

nds stdio support.

Provides studio integration for printing to the DS screen as well as debug print functionality provided by stderr.
General usage is to initialize the console by: consoleDemoInit() or to customize the console usage by: consoleInit()
The default instance utilizes the sub display, approximatly 15KiB of vram C starting at tile base 0 and 2KiB of map at map base 30.
Debug printing is performed by initializing the debug console via consoleDebugInit() as follows:
consoleDebugInit(DebugDevice_NOCASH);
fprintf(stderr, "debug message in no$gba window %i", stuff);
OR
consoleDebugInit(DebugDevice_CONSOLE);
fprintf(stderr, "debug message on DS console screen");
The print console must be initialized to use DB_CONSOL

列挙型

Console debug devices supported by libnds.

列挙型の値:
DebugDevice_NULL 

swallows prints to stderr >

DebugDevice_NOCASH 

Directs stderr debug statements to no$gba debug window >

DebugDevice_CONSOLE 

Directs stderr debug statements to DS console window >


関数

void consoleDebugInit ( DebugDevice  device  ) 

Initializes debug console output on stderr to the specified device.

引数:
device The debug device (or devices) to output debug print statements to
PrintConsole * consoleGetDefault ( void   ) 

Gets a pointer to the default console (this should only be used when using a single console, other wise use consoleNew(PrintsConsole* console).

戻り値:
A pointer to the default console
PrintConsole * consoleInit ( PrintConsole console,
int  layer,
BgType  type,
BgSize  size,
int  mapBase,
int  tileBase,
bool  mainDisplay,
bool  loadGraphics 
)

Initialise the console.

引数:
console A pointer to the console initialze data (if null default console will be used)
layer background layer to use
type the type of the background
size the size of the background
mapBase the map base
tileBase the tile graphics base
mainDisplay if true main engine is used, otherwise false
loadGraphics if true the default font graphics will be loaded into the layer
例:
Graphics/Printing/custom_font/source/main.c, Graphics/Printing/print_both_screens/source/template.c, Graphics/Printing/rotscale_text/source/main.c, と input/Touch_Pad/touch_test/source/main.c.
void consoleSelect ( PrintConsole console  ) 

Make the specified console the render target.

引数:
console A pointer to the console struct (must have been initialized with consoleInit(PrintConsole* console)
例:
Graphics/Printing/console_windows/source/main.c, と Graphics/Printing/print_both_screens/source/template.c.
void consoleSetFont ( PrintConsole console,
ConsoleFont font 
)

Loads the font into the current console.

引数:
console pointer to the print console to update
font the font to load
例:
Graphics/Printing/custom_font/source/main.c, と Graphics/Printing/rotscale_text/source/main.c.
void consoleSetWindow ( PrintConsole console,
int  x,
int  y,
int  width,
int  height 
)

Sets the print window.

引数:
console console to set, if NULL will set current console window
x x location of the window
y y location of the window
width width of the window
height height of the window
例:
Graphics/Printing/console_windows/source/main.c.
 全て クラス ファイル 関数 変数 型定義 列挙型 列挙型の値 マクロ定義
libndsに対してMon Apr 26 23:39:50 2010に生成されました。  doxygen 1.6.3