Plazma sayı 2, sayfa 146

Bu sayfadaki yazılar

Sayfanın metni

Sayfa 146

FillCircle(&myPoint1, i, i * 16);

// Bir tuşa basılana kadar bekle getch();

// Renkleri kaydır while(!kbhit()) { CycleLeft(1); delay(50); } getch(); while(!kbhit()) { CycleRight(0); delay(50); }

// 80x25 karakter ekran moduna geç SetScreen(CHAR03); }

/** * Name : SetScreen * Desc : 0x10 interruptini kullanarak ekran modunu değiştirir. * Input : (int)screenMode */ void SetScreen(int screenMode) { union REGS regs; regs.x.ax = screenMode; int86(INT_VIDEO, &regs, &regs); }

/** * Name : GetColor * Desc : Parametreden gelen sıradaki palet rengini okur. * Input : (unsigned char)color * Output: (RGB) */ RGB GetColor(unsigned char color) { RGB rgbColor; outportb(0x3c7, color); rgbColor.setR(inportb(0x3c9)); rgbColor.setG(inportb(0x3c9)); rgbColor.setB(inportb(0x3c9)); return rgbColor; }

/** * Name : SetColor * Desc : Palet renklerini değiştirir. * Input : (unsigned char)color * (unsigned char)r * (unsigned char)g * (unsigned char)b */ void SetColor(unsigned char color, unsigned char r, unsigned char g, unsigned char b) { outportb(0x3c8, color); outportb(0x3c9, r); outportb(0x3c9, g); outportb(0x3c9, b); }

Klavyeyle gezinmek için ← ve → tuşları.