aclib #18 - aclライブラリ入門(2)

(0) もくじ

(1) xorを使った模様(grd_xor)

#include <acl.c>
void aMain()
{
    AWindow *win = aOpenWin(256, 256, "grd_xor", 1);
    int x, y;
    for (y = 0; y < 256; y++) {
        for (x = 0; x < 256; x++)
            aSetPix(win, x, y, (x ^ y) * 0x10101);
    }
    aWait(-1);
}

(2) xorlines

#include <acl.c>
void aMain()
{
    AWindow *w = aOpenWin(256, 256, "xorlines", 1);
    int x;
    aSetMode(w, AMODE_XOR);
    for (x = 0; x < 256; x++) {
        aDrawLine(w, x, 0, 255, 255, 0xffff00);
        aDrawLine(w, 0, 0, x,   255, 0xffff00);
    }
    aWait(-1);
}

つづく・・・

こめんと欄


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