显示器的实现
前面提到CHIP8的显示器是64x32黑白像素的显示器,所以我们在QT中定义一个OpenGL的Wedgit显示到窗口中,同时把keymap和游戏循环设置在主窗体的timmer循环中。...();
void timeout_sc();
signals:
void draw_pixel(int row, int col, float color);
void repaint_screen...()));
connect(this, SIGNAL(repaint_screen()), glwindow, SLOT(repaint()));
connect(this, SIGNAL...(draw_pixel(int, int, float)), glwindow,
SLOT(paint_pixel(int, int, float))); // 链接绘制函数和OpenGL...) {
repaint_screen();
cpu.draw_flag = false;
}
if (timediff_ms(&clock_now, &clock_prev