void CQMesh::onDestory() { auto loader = CQResLoader::shareLoader(); for each (auto subMesh in meshes_) { loader->unloadMesh(subMesh); }
void ProxyEntity::handleDestroyTimeout() { unloadMesh(); }
MainWindow::MainWindow(QWidget * parent, FormBar * bar): QMainWindow(parent), m_formbar(bar) { setMenuBar(new QMenuBar(this)); QMenu *fileMenu = menuBar() -> addMenu(tr("&File")); QAction *openAct = new QAction(tr("&Open"), this); openAct->setShortcuts(QKeySequence::Open); openAct->setStatusTip(tr("Open")); connect(openAct, SIGNAL(triggered()), this, SLOT(openFile())); // Quit action QAction *quitAct = new QAction(tr("&Quit"), this); quitAct->setShortcuts(QKeySequence::Quit); quitAct->setStatusTip(tr("Quit")); connect(quitAct, SIGNAL(triggered()), this, SLOT(close())); fileMenu->addAction(openAct); fileMenu->addAction(quitAct); QGLFormat glFormat; std::cout << glFormat.openGLVersionFlags() << std::endl; std::cout << (QGLFormat::OpenGL_Version_3_0 <= glFormat.openGLVersionFlags()) << std::endl; if(QGLFormat::OpenGL_Version_3_3 & glFormat.openGLVersionFlags()) { glFormat.setVersion( 3,3 ); } else { glFormat.setVersion( 2, 1 ); } std::cout << "GL Version: " << glFormat.majorVersion() << " " << glFormat.minorVersion() << std::endl; glFormat.setProfile( QGLFormat::CompatibilityProfile ); glFormat.setSampleBuffers( true ); m_glwidget = new GLWidget(glFormat,this); connect(this,SIGNAL(meshLoaded(std::shared_ptr<const MeshPackage>)), m_glwidget,SLOT(receiveMesh(std::shared_ptr<const MeshPackage>))); connect(this,SIGNAL(formLoaded(const FormPackage &)) , m_glwidget,SLOT(receiveForm(const FormPackage &))); setCentralWidget(m_glwidget); QDockWidget * dock = new QDockWidget(tr("Form Chooser"),this); if(!m_formbar) { m_formbar = new FormBar(this); } dock->setWidget(m_formbar); addDockWidget(Qt::LeftDockWidgetArea, dock); connect(this,SIGNAL(loadingNewMesh()) , m_glwidget,SLOT(unloadMesh())); connect(this,SIGNAL(formLoaded(const FormPackage &)) , m_formbar,SLOT(receiveForm(const FormPackage &))); connect(this,SIGNAL(particlesLoaded(std::shared_ptr<VertexBufferObject>)) , m_glwidget,SLOT(receiveParticles(std::shared_ptr<VertexBufferObject>))); connect( m_formbar, SIGNAL(enableForm(const QString &)), m_glwidget, SLOT(enableForm(const QString &))); connect( m_formbar, SIGNAL(disableForm(const QString &)), m_glwidget, SLOT(disableForm(const QString &))); connect( m_formbar, SIGNAL(clearForms(void)), m_glwidget, SLOT(clearForms(void))); }