* aclib #2
-(by [[K]], 2020.09.08)

** (1) ライブラリが提供する型
|AInt8|8bit符号付き整数値を保持できる型|
|AInt16|16bit符号付き整数値を保持できる型|
|AInt32|32bit符号付き整数値を保持できる型|
|AInt64|64bit符号付き整数値を保持できる型|
|AInt|ポインタのビット幅と同じかそれ以上の整数型|
|AInt8, AInt8a|8bit符号付き整数値を保持できる型|
|AInt16, AInt16a|16bit符号付き整数値を保持できる型|
|AInt32, AInt32a|32bit符号付き整数値を保持できる型|
|AInt64, AInt64a|64bit符号付き整数値を保持できる型|
|AInt, AInta|ポインタのビット幅と同じかそれ以上の整数型|
|va_list|stdarg系マクロのための型|
|AWindow *|ウィンドウハンドル|
-AInt系の型は、保持できることを保証しているだけなので、実際はそれよりも大きいビット数である可能性はありうる(環境依存)。したがって正確なサイズはsizeofしなければわからない。
-末尾にaがついている方はarray用という意味。aが付かないほうは、CPUの都合を優先してサイズを大きめにとる(たとえば、x86ではAInt16はshortではなくintにする)。
-一方で、AInt16aでは、ちゃんとshortになる。aは中規模・大規模array用なので、CPUの都合よりもサイズを切り詰めることのほうを優先する。

** (2)ライブラリが提供する関数・マクロ
-グラフィック系
|AWindow *aOpenWin(int xsiz, int ysiz, const char *t, int autoClose)|ウィンドウを開く、指定した大きさはウィンドウの大きさではなく描画可能域の大きさである|
|AWindow *aOpenWin(AInt16 xsiz, AInt16 ysiz, const char *t, AInt8 autoClose)|ウィンドウを開く、指定した大きさはウィンドウの大きさではなく描画可能域の大きさである|
|void aCloseWin(AWindow *w)|ウィンドウを閉じる|
|void aSetPix0(AWindow *w, int x, int y, AInt32 c)|ウィンドウに1ピクセルの点を打つ(必ず画面内)|
|void aSetPix(AWindow *w, int x, int y, AInt32 c)|ウィンドウに1ピクセルの点を打つ|
|void aFillRect0(AWindow *w, int sx, int sy, int x0, int y0, AInt32 c)|ウィンドウに塗りつぶした長方形を描画する(必ず画面内)|
|void aFillRect(AWindow *w, int sx, int sy, int x0, int y0, AInt32 c)|ウィンドウに塗りつぶした長方形を描画する|
|void aDrawRect0(AWindow *w, int sx, int sy, int x0, int y0, AInt32 c)|ウィンドウに枠だけの長方形を描画する(必ず画面内)|
|void aDrawRect(AWindow *w, int sx, int sy, int x0, int y0, AInt32 c)|ウィンドウに枠だけの長方形を描画する|
|void aFillOval0(AWindow *w, int sx, int sy, int x0, int y0, AInt32 c)|ウィンドウに塗りつぶした楕円形を描画する(必ず画面内)|
|void aFillOval(AWindow *w, int sx, int sy, int x0, int y0, AInt32 c)|ウィンドウに塗りつぶした楕円形を描画する|
|void aSetPix0(AWindow *w, AInt16 x, AInt16 y, AInt32 c)|ウィンドウに1ピクセルの点を打つ(必ず画面内)|
|void aSetPix(AWindow *w, AInt32 x, AInt32 y, AInt32 c)|ウィンドウに1ピクセルの点を打つ|
|void aFillRect0(AWindow *w, AInt16 sx, AInt16 sy, AInt16 x0, AInt16 y0, AInt32 c)|ウィンドウに塗りつぶした長方形を描画する(必ず画面内)|
|void aFillRect(AWindow *w, AInt32 sx, AInt32 sy, AInt32 x0, AInt32 y0, AInt32 c)|ウィンドウに塗りつぶした長方形を描画する|
|void aDrawRect0(AWindow *w, AInt16 sx, AInt16 sy, AInt16 x0, AInt16 y0, AInt32 c)|ウィンドウに枠だけの長方形を描画する(必ず画面内)|
|void aDrawRect(AWindow *w, AInt32 sx, AInt32 sy, AInt32 x0, AInt32 y0, AInt32 c)|ウィンドウに枠だけの長方形を描画する|
|void aFillOval0(AWindow *w, AInt16 sx, AInt16 sy, AInt16 x0, AInt16 y0, AInt32 c)|ウィンドウに塗りつぶした楕円形を描画する(必ず画面内)|
|void aFillOval(AWindow *w, AInt32 sx, AInt32 sy, AInt32 x0, AInt32 y0, AInt32 c)|ウィンドウに塗りつぶした楕円形を描画する|
|void aDrawOval(AWindow *w, int sx, int sy, int x0, int y0, AInt32 c)|ウィンドウに枠だけの楕円形を描画する|
|void aDrawLine0(AWindow *w, int x0, int y0, int x1, int y1, AInt32 c)|ウィンドウに直線を描画する(必ず画面内)|
|void aDrawLine(AWindow *w, int x0, int y0, int x1, int y1, AInt32 c)|ウィンドウに直線を描画する|
|void aDrawStr0(AWindow *w, int x, int y, AInt32 c, AInt32 b, const char *s)|文字列の描画|
|void aDrawStr(AWindow *w, int x, int y, AInt32 c, AInt32 b, const char *s)|文字列の描画|
|void aFill(AWindow *w, int x, int y, int c)|塗りつぶし|
|void aFlushAll0(AWindow *w)|描画内容を画面に反映させる|
|void aFlushAll(AWindow *w)|描画内容を画面に反映させる|
|void aLeapFlushAll0(AWindow *w, AInt32 msec)|描画内容を画面に反映させる|
|void aLeapFlushAll(AWindow *w, AInt32 msec)|描画内容を画面に反映させる|
---aSetPix0()は画面内への描画のみを想定している。デバッグモードならチェックするが、画面外の場合は問答無用で強制エラー終了する。描画モード設定は無視され、常にSETで描画する。描画ルーチンはコンパクトだし高速である。
---aSetPix()は画面外になるかもしれないことも想定していて、デバッグモードでなくてもチェックし、画面外の場合は単に描画しない。エラーにもならない。また描画の際にはSET/OR/AND/XORの設定も反映される。
---aFillRect0()、aFillRect()についても同様の仕様になっている。
---aDrawRect0()、aDrawRect()についても同様の仕様になっている。
---aFillOval0()、aFillOval()についても同様の仕様になっている。
---aDrawOval0()は提供されない(楕円の描画処理は高負荷なので、ちょっとチェックが減ってもほとんど速度に影響しないため)。
---aDrawLine0()、aDrawLine()についても同様の仕様になっている。
---aDrawStr0()、aDrawStr()についても同様の仕様になっている。

-入力系

-メモリ管理系
|void *aMalloc(AInt sz)|NULLを返すことはないmalloc|
|void *aMalloc0(AInt sz)|メモリがなければNULLを返すことを許されるmalloc|
|void aFree(void *p, AInt sz)|free|
|void aFree0(void *p, AInt sz)|NULLを渡さないことが保証されているfree|

-stdarg系
|va_arg|
|va_copy|
|va_end|
|va_start|
-雑関数群
|int aGetMsb(AInt i)|
|int aPopCnt(AInt i)|

** (3) 有効な-Dオプション
|-DADEBUG|デバッグモード|
|-DANOUSE_ATERRMSG|aSetAtErrExitMsg()を無視する代わりにバイナリをコンパクトにする|
|-DANOUSE_FASTMALLOC|高性能mallocを使わない代わりにコンパクトにする|



トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS