X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fmainwin.cpp;h=e083446b34ffbfeb67c0ed54eafc13a3f6bd1e46;hb=2c98ddddf1eeb20fe90c3e9759ac77ec96dcbc97;hp=dba74e7bad8f946a59ad2b17ff7df4f3a366763e;hpb=94e1e961b57f253b760298ab0bae96a7de6d20fa;p=virtualjaguar diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index dba74e7..e083446 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -31,7 +31,7 @@ //#include "charwindow.h" //#include "ttedit.h" -MainWin::MainWin() +MainWin::MainWin(): running(true) { // The way BSNES controls things is by setting a timer with a zero // timeout, sleeping if not emulating anything. Seems there has to be a @@ -41,12 +41,23 @@ MainWin::MainWin() // methods, can we do something similar or should we just use the built-in // QOpenGL? + // We're going to try to use the built-in OpenGL support and see how it goes. + // We'll make the VJ core modular so that it doesn't matter what GUI is in + // use, we can drop it in anywhere and use it as-is. + // ((TTEdit *)qApp)->charWnd = new CharWindow(this); videoWidget = new GLWidget(this); setCentralWidget(videoWidget); setWindowIcon(QIcon(":/res/vj.xpm")); setWindowTitle("Virtual Jaguar v2.0.0"); + QMenu * menu = menuBar()->addMenu(tr("&File")); + QToolBar * toolbar = addToolBar(tr("x1")); + /*QAction */ action = new QAction(tr("Toggle"), this); + action->setStatusTip(tr("Toggle running state")); + action->setCheckable(true); + toolbar->addAction(action); + connect(action, SIGNAL(triggered()), this, SLOT(ToggleRunState())); #if 0 // createActions(); newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this); @@ -124,6 +135,9 @@ void MainWin::Open(void) void MainWin::Timer(void) { + if (!running) + return; + // Random hash & trash // We try to simulate an untuned tank circuit here... :-) for(int x=0; xrasterWidth; x++) @@ -138,6 +152,11 @@ void MainWin::Timer(void) videoWidget->updateGL(); } +void MainWin::ToggleRunState(void) +{ + running = !running; +} + void MainWin::ReadSettings(void) { QSettings settings("Underground Software", "Virtual Jaguar");