DGLE_RESULT DGLE_API CRender::Unbind(E_ENGINE_OBJECT_TYPE eType) { switch (eType) { case EOT_UNKNOWN: Unbind(EOT_MATERIAL); Unbind(EOT_TEXTURE); Unbind(EOT_MESH); Unbind(EOT_LIGHT); break; case EOT_TEXTURE: _pRender3D->UnbindTextures(); break; case EOT_MESH: case EOT_MODEL: _pCoreRenderer->DrawBuffer(NULL); break; case EOT_LIGHT: _pRender3D->UnbindLights(); break; case EOT_MATERIAL: _pRender3D->UnbindMaterial(); break; default: return E_INVALIDARG; } return S_OK; }
LLDBDebugger::~LLDBDebugger() { Unbind(wxEVT_TIMER, &LLDBDebugger::OnTimer, this, m_timer->GetId()); Unbind(wxEVT_LLDB_STARTED, &LLDBDebugger::OnStarted, this); Unbind(wxEVT_LLDB_EXITED, &LLDBDebugger::OnTerminated, this); wxDELETE( m_timer ); }
LLDBConnector::~LLDBConnector() { StopDebugServer(); Unbind(wxEVT_LLDB_EXITED, &LLDBConnector::OnLLDBExited, this); Unbind(wxEVT_LLDB_STARTED, &LLDBConnector::OnLLDBStarted, this); Cleanup(); }
void CMakePlugin::UnPlug() { wxASSERT(m_mgr); Notebook* notebook = m_mgr->GetWorkspacePaneNotebook(); wxASSERT(notebook); int pos = notebook->GetPageIndex("CMake Help"); if(pos != wxNOT_FOUND) { CMakeHelpTab* helpTab = dynamic_cast<CMakeHelpTab*>(notebook->GetPage(pos)); if(helpTab) { helpTab->Stop(); } notebook->RemovePage(pos); } // Unbind events wxTheApp->Unbind(wxEVT_COMMAND_MENU_SELECTED, &CMakePlugin::OnSettings, this, XRCID("cmake_settings")); EventNotifier::Get()->Unbind(wxEVT_SHOW_WORKSPACE_TAB, &CMakePlugin::OnToggleHelpTab, this); EventNotifier::Get()->Unbind(wxEVT_CONTEXT_MENU_PROJECT, &CMakePlugin::OnProjectContextMenu, this); EventNotifier::Get()->Unbind(wxEVT_CONTEXT_MENU_WORKSPACE, &CMakePlugin::OnWorkspaceContextMenu, this); EventNotifier::Get()->Unbind(wxEVT_PROJ_FILE_ADDED, &CMakePlugin::OnFileAdded, this); EventNotifier::Get()->Unbind(wxEVT_PROJ_FILE_REMOVED, &CMakePlugin::OnFileRemoved, this); Unbind(wxEVT_ASYNC_PROCESS_OUTPUT, &CMakePlugin::OnCMakeOutput, this); Unbind(wxEVT_ASYNC_PROCESS_TERMINATED, &CMakePlugin::OnCMakeTerminated, this); }
HRESULT DGLE2_API CRender::Unbind(E_ENG_OBJ_TYPE eType) { switch (eType) { case EOT_UNKNOWN: Unbind(EOT_MATERIAL); Unbind(EOT_TEXTURE); Unbind(EOT_MESH); break; case EOT_TEXTURE: for (int i = _iMaxTexUnits - 1; i >= 0; --i) _pCoreRenderer->BindTexture(NULL, i); break; case EOT_MESH: case EOT_MODEL: _pCoreRenderer->DrawBuffer(NULL); break; case EOT_MATERIAL: //ToDo break; default: return E_INVALIDARG; } return S_OK; }
wxCustomStatusBar::~wxCustomStatusBar() { Unbind(wxEVT_PAINT, &wxCustomStatusBar::OnPaint, this); Unbind(wxEVT_ERASE_BACKGROUND, &wxCustomStatusBar::OnEraseBackround, this); Unbind(wxEVT_LEFT_DOWN, &wxCustomStatusBar::OnLeftDown, this); Unbind(wxEVT_MOTION, &wxCustomStatusBar::OnMouseMotion, this); }
// -------------------------------------------------------------------------------- // guJamendoPanel::~guJamendoPanel() { Unbind( wxEVT_MENU, &guJamendoPanel::OnDownloadAlbum, this, ID_JAMENDO_DOWNLOAD_TORRENT_ALBUM ); Unbind( wxEVT_MENU, &guJamendoPanel::OnDownloadTrackAlbum, this, ID_JAMENDO_DOWNLOAD_TORRENT_TRACK_ALBUM ); Unbind( wxEVT_MENU, &guJamendoPanel::OnDownloadAlbum, this, ID_JAMENDO_DOWNLOAD_DIRECT_ALBUM ); Unbind( wxEVT_MENU, &guJamendoPanel::OnDownloadTrackAlbum, this, ID_JAMENDO_DOWNLOAD_DIRECT_TRACK_ALBUM ); }
void FarPlugin::KeyConfig() { //int res = Info.MacroControl(&MainGuid, MCTL_SAVEALL, 0, NULL); // BindAll(); ShowMessage("", "Hotkeys binded", FMSG_MB_OK); return; #if 0 FarDialog& dlg = Dialogs()["KeysDialog"]; dlg.ResetControls(); bool bind = Binded("F5") && Binded("F6") && Binded("ShiftF5") && Binded("ShiftF6"); bool altShift = bind && Binded("AltShiftF5") && Binded("AltShiftF6"); bool ctrlShift = bind && Binded("CtrlShiftF5") && Binded("CtrlShiftF6"); bool ctrlAlt = bind && Binded("CtrlAltF5") && Binded("CtrlAltF6"); if(!altShift && !ctrlShift && !ctrlAlt) altShift = true; dlg["BindToF5"]("Selected") = bind; dlg["AltShiftF5"]("Selected") = altShift; dlg["CtrlShiftF5"]("Selected") = ctrlShift; dlg["CtrlAltF5"]("Selected") = ctrlAlt; if(dlg.Execute() == -1) return; if(dlg["BindToF5"]("Selected") == bind && dlg["AltShiftF5"]("Selected") == altShift && dlg["CtrlShiftF5"]("Selected") == ctrlShift && dlg["CtrlAltF5"]("Selected") == ctrlAlt) return; // MacroCommand(MCMD_SAVEALL); // XXX Unbind("KEY_F5"); Unbind("ShiftF5"); Unbind("KEY_F5"); Unbind("ShiftF6"); Unbind("AltShiftF5"); Unbind("AltShiftF6"); Unbind("CtrlShiftF5"); Unbind("CtrlShiftF6"); Unbind("CtrlAltF5"); Unbind("CtrlAltF6"); if(dlg["BindToF5"]("Selected")) { Bind("F5", "Plugin.Call(\"16990c75-cb7a-43df-8d7e-d6bf3683c3f1\", 0)", "", 0); Bind("F6", "Plugin.Call(\"16990c75-cb7a-43df-8d7e-d6bf3683c3f1\", 1)", "", 0); Bind("ShiftF5", "Plugin.Call(\"16990c75-cb7a-43df-8d7e-d6bf3683c3f1\", 0)", "", 0); Bind("ShiftF6", "Plugin.Call(\"16990c75-cb7a-43df-8d7e-d6bf3683c3f1\", 1)", "", 0); /* String key; if(dlg["AltShiftF5"]("Selected")) key = "AltShift"; else if(dlg["CtrlShiftF5"]("Selected")) key = "CtrlShift"; else if(dlg["CtrlAltF5"]("Selected")) key = "CtrlAlt"; Bind(key + "F5", "F5"); Bind(key + "F6", "F6"); */ } // MacroCommand(MCMD_LOADALL); // XXX #endif }
CtrlDataList::~CtrlDataList() { //Unbind Unbind(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, &CtrlDataList::onItemContextMenu, this); Unbind(wxEVT_DATAVIEW_SELECTION_CHANGED, &CtrlDataList::onSelectionChanger, this); //Destruction du menu. delete _menu; }
void FarPlugin::KeyConfig() { //int res = Info.MacroControl(&MainGuid, MCTL_SAVEALL, 0, nullptr); // //BindAll(); //ShowMessage(L"", L"Hotkeys binded", FMSG_MB_OK); //return; FarDialog & dlg = plugin->Dialogs()[L"KeysDialog"]; dlg.ResetControls(); bool bind = Bound(L"F5") && Bound(L"F6") && Bound(L"ShiftF5") && Bound(L"ShiftF6"); bool altShift = bind && Bound(L"AltShiftF5") && Bound(L"AltShiftF6"); bool ctrlShift = bind && Bound(L"CtrlShiftF5") && Bound(L"CtrlShiftF6"); bool ctrlAlt = bind && Bound(L"CtrlAltF5") && Bound(L"CtrlAltF6"); if (!altShift && !ctrlShift && !ctrlAlt) altShift = true; dlg[L"BindToF5"](L"Selected") = bind; dlg[L"AltShiftF5"](L"Selected") = altShift; dlg[L"CtrlShiftF5"](L"Selected") = ctrlShift; dlg[L"CtrlAltF5"](L"Selected") = ctrlAlt; if (dlg.Execute() == -1) return; if (dlg[L"BindToF5"](L"Selected") == bind && dlg[L"AltShiftF5"](L"Selected") == altShift && dlg[L"CtrlShiftF5"](L"Selected") == ctrlShift && dlg[L"CtrlAltF5"](L"Selected") == ctrlAlt) return; Unbind(L"F5"); Unbind(L"ShiftF5"); Unbind(L"F6"); Unbind(L"ShiftF6"); Unbind(L"AltShiftF5"); Unbind(L"AltShiftF6"); Unbind(L"CtrlShiftF5"); Unbind(L"CtrlShiftF6"); Unbind(L"CtrlAltF5"); Unbind(L"CtrlAltF6"); if (dlg[L"BindToF5"](L"Selected")) { BindAll(); String key; if (dlg[L"AltShiftF5"](L"Selected")) key = L"AltShift"; else if (dlg[L"CtrlShiftF5"](L"Selected")) key = L"CtrlShift"; else if (dlg[L"CtrlAltF5"](L"Selected")) key = L"CtrlAlt"; Bind(key + L"F5", L"Keys(\"F5\")", L"FileCopyEx3 - Standard copy dialog", 0); Bind(key + L"F6", L"Keys(\"F6\")", L"FileCopyEx3 - Standard move dialog", 0); } }
TerminalEmulator::~TerminalEmulator() { Unbind(wxEVT_ASYNC_PROCESS_OUTPUT, &TerminalEmulator::OnProcessOutput, this); Unbind(wxEVT_ASYNC_PROCESS_TERMINATED, &TerminalEmulator::OnProcessTerminated, this); std::for_each(m_myProcesses.begin(), m_myProcesses.end(), [&](wxProcess* proc) { MyProcess* myproc = dynamic_cast<MyProcess*>(proc); myproc->m_parent = NULL; }); }
LLDBConnector::~LLDBConnector() { StopDebugServer(); Unbind(wxEVT_LLDB_EXITED, &LLDBConnector::OnLLDBExited, this); Unbind(wxEVT_LLDB_STARTED, &LLDBConnector::OnLLDBStarted, this); Unbind(wxEVT_ASYNC_PROCESS_OUTPUT, &LLDBConnector::OnProcessOutput, this); Unbind(wxEVT_ASYNC_PROCESS_TERMINATED, &LLDBConnector::OnProcessTerminated, this); Cleanup(); }
FrameNotification::~FrameNotification() { //Unbind Unbind(wxEVT_TIMER, &FrameNotification::onTimeout, this); _staticTextTitle->Unbind(wxEVT_LEFT_DOWN, &FrameNotification::onLeftDown, this); _staticLine->Unbind(wxEVT_LEFT_DOWN, &FrameNotification::onLeftDown, this); _staticTextMessage->Unbind(wxEVT_LEFT_DOWN, &FrameNotification::onLeftDown, this); if(_staticBitmap) _staticBitmap->Unbind(wxEVT_LEFT_DOWN, &FrameNotification::onLeftDown, this); Unbind(wxEVT_LEFT_DOWN, &FrameNotification::onLeftDown, this); }
// -------------------------------------------------------------------------------- // guSplashFrame::~guSplashFrame() { if( m_Bitmap ) { delete m_Bitmap; } // Unbind Events Unbind( wxEVT_ERASE_BACKGROUND, &guSplashFrame::OnEraseBackground, this ); Unbind( wxEVT_LEFT_DOWN, &guSplashFrame::OnSplashClick, this ); Unbind( wxEVT_TIMER, &guSplashFrame::OnTimeout, this ); }
void CppCheckPlugin::UnPlug() { m_tabHelper.reset(NULL); Unbind(wxEVT_ASYNC_PROCESS_OUTPUT, &CppCheckPlugin::OnCppCheckReadData, this); Unbind(wxEVT_ASYNC_PROCESS_TERMINATED, &CppCheckPlugin::OnCppCheckTerminated, this); m_mgr->GetTheApp()->Disconnect(XRCID("cppcheck_settings_item"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(CppCheckPlugin::OnSettingsItem), NULL, (wxEvtHandler*)this); m_mgr->GetTheApp()->Disconnect(XRCID("cppcheck_settings_item_project"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(CppCheckPlugin::OnSettingsItemProject), NULL, (wxEvtHandler*)this); m_mgr->GetTheApp()->Disconnect(XRCID("cppcheck_editor_item"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(CppCheckPlugin::OnCheckFileEditorItem), NULL, (wxEvtHandler*)this); m_mgr->GetTheApp()->Disconnect(XRCID("cppcheck_fileexplorer_item"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(CppCheckPlugin::OnCheckFileExplorerItem), NULL, (wxEvtHandler*)this); m_mgr->GetTheApp()->Disconnect(XRCID("cppcheck_workspace_item"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(CppCheckPlugin::OnCheckWorkspaceItem), NULL, (wxEvtHandler*)this); m_mgr->GetTheApp()->Disconnect(XRCID("cppcheck_project_item"), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(CppCheckPlugin::OnCheckProjectItem), NULL, (wxEvtHandler*)this); EventNotifier::Get()->Unbind(wxEVT_CONTEXT_MENU_EDITOR, &CppCheckPlugin::OnEditorContextMenu, this); EventNotifier::Get()->Disconnect( wxEVT_WORKSPACE_CLOSED, wxCommandEventHandler(CppCheckPlugin::OnWorkspaceClosed), NULL, this); // before this plugin is un-plugged we must remove the tab we added for(size_t i = 0; i < m_mgr->GetOutputPaneNotebook()->GetPageCount(); i++) { if(m_view == m_mgr->GetOutputPaneNotebook()->GetPage(i)) { m_mgr->GetOutputPaneNotebook()->RemovePage(i); break; } } m_view->Destroy(); // terminate the cppcheck daemon wxDELETE(m_cppcheckProcess); }
void NodeJSSocket::Destroy() { Unbind(wxEVT_ASYNC_SOCKET_CONNECTED, &NodeJSSocket::OnSocketConnected, this); Unbind(wxEVT_ASYNC_SOCKET_ERROR, &NodeJSSocket::OnSocketError, this); Unbind(wxEVT_ASYNC_SOCKET_CONNECTION_LOST, &NodeJSSocket::OnSocketConnectionLost, this); Unbind(wxEVT_ASYNC_SOCKET_INPUT, &NodeJSSocket::OnSocketInput, this); Unbind(wxEVT_ASYNC_SOCKET_CONNECT_ERROR, &NodeJSSocket::OnSocketInput, this); m_socket.Disconnect(); m_firstTimeConnected = true; m_connected = false; CL_DEBUG("CodeLite >>>> Cleaning up socket with Node.js"); }
ErrorType SoundSource::LoadResource(const String &name, const SoundData &soundData, SoundCollection *collection) { // Check for existing sound with matching checksum Checksum checksum(soundData.GetSamples().GetData(), soundData.GetSamples().GetElementCount()); Bind(collection, collection->GetIDByChecksum(checksum)); if (-1 < mID) return kErrorNone; // No sound was found, generate new buffer UInt openALID; alGenBuffers(1, &openALID); if (!openALID) return Error::Throw(kErrorOpenALGenBuffersFailure, String("[%s(\"%s\", %p)]", FastFunctionName, name.GetCString(), &soundData)); SoundResource soundResource; soundResource.SetName(name); soundResource.SetChecksum(checksum); soundResource.GetProperties()->SetFormat(soundData.GetProperties().GetFormat()); soundResource.GetProperties()->SetFrequency(soundData.GetProperties().GetFrequency()); soundResource.GetProperties()->SetSampleCount(soundData.GetProperties().GetSampleCount()); soundResource.SetOpenALBufferID(openALID); soundResource.SetActive(true); mID = collection->AddResource(soundResource, this); mCollection = collection; { alBufferData(GetResource().GetOpenALBufferID(), GetResource().GetProperties().GetFormat(), soundData.GetSamples().GetData(), soundData.GetSamples().GetElementCount(), GetResource().GetProperties().GetFrequency()); ALint alErr = alGetError(); switch (alErr) { case AL_OUT_OF_MEMORY: Unbind(); return Error::Throw(kErrorOutOfMemory, String("[%s(\"%s\", %p)]", FastFunctionName, name.GetCString(), &soundData)); case AL_INVALID_ENUM: case AL_INVALID_VALUE: Unbind(); return Error::Throw(kErrorInvalidValue, String("[%s(\"%s\", %p)]", FastFunctionName, name.GetCString(), &soundData)); } } return kErrorNone; }
WinManAction::~WinManAction() { Unbind(wxEVT_COMMAND_MENU_SELECTED, &WinManAction::onAdd, this, wxID_ADD); Unbind(wxEVT_COMMAND_MENU_SELECTED, &WinManAction::onPreferences, this, wxID_PREFERENCES); Unbind(wxEVT_COMMAND_MENU_SELECTED, &WinManAction::onFind, this, wxID_FIND); Unbind(wxEVT_COMMAND_MENU_SELECTED, &WinManAction::onDelete, this, wxID_DELETE); Unbind(wxEVT_COMMAND_MENU_SELECTED, &WinManAction::onChangeShortcut, this, ID_CHANGE_SHORTCUT); Unbind(wxEVT_BUTTON, &WinManAction::onDelete, this, wxID_DELETE); Unbind(wxEVT_BUTTON, &WinManAction::onPreferences, this, wxID_PREFERENCES); Unbind(wxEVT_BUTTON, &WinManAction::onAdd, this, wxID_ADD); Unbind(wxEVT_DATAVIEW_ITEM_EDITING_STARTED, &WinManAction::onItemEditingStarted, this); Unbind(wxEVT_DATAVIEW_ITEM_EDITING_DONE, &WinManAction::onItemEditingDone, this); }
// -------------------------------------------------------------------------------- // guAlListBox::~guAlListBox() { guConfig * Config = ( guConfig * ) guConfig::Get(); Config->UnRegisterObject( this ); Config->WriteNum( wxT( "AlbumsOrder" ), m_AlbumsOrder, m_ConfigPath ); if( m_Items ) delete m_Items; Unbind( wxEVT_MENU, &guAlListBox::OnSearchLinkClicked, this, ID_LINKS_BASE, ID_LINKS_BASE + guLINKS_MAXCOUNT ); Unbind( wxEVT_MENU, &guAlListBox::OnCommandClicked, this, ID_COMMANDS_BASE, ID_COMMANDS_BASE + guCOMMANDS_MAXCOUNT ); Unbind( wxEVT_MENU, &guAlListBox::OnOrderSelected, this, ID_ALBUM_ORDER_NAME, ID_ALBUM_ORDER_ARTIST_YEAR_REVERSE ); Unbind( guConfigUpdatedEvent, &guAlListBox::OnConfigUpdated, this, ID_CONFIG_UPDATED ); }
/* ============ idMoveable::Killed ============ */ void idMoveable::Killed( idEntity *inflictor, idEntity *attacker, int damage, const idVec3 &dir, int location ) { if( unbindOnDeath ) { Unbind(); } if( brokenModel != "" ) { SetModel( brokenModel ); } if( explode ) { if( brokenModel == "" ) { PostEventMS( &EV_Remove, 1000 ); } } if( renderEntity.gui[ 0 ] ) { renderEntity.gui[ 0 ] = NULL; } ActivateTargets( this ); fl.takedamage = false; }
FGFDMExec::~FGFDMExec() { try { Unbind(); DeAllocate(); if (IdFDM == 0) { // Meaning this is no child FDM if(Root != 0) { if(StandAlone) delete Root; Root = 0; } if(FDMctr != 0) { delete FDMctr; FDMctr = 0; } } } catch ( string msg ) { cout << "Caught error: " << msg << endl; } for (unsigned int i=1; i<ChildFDMList.size(); i++) delete ChildFDMList[i]->exec; ChildFDMList.clear(); PropertyCatalog.clear(); if (FDMctr > 0) (*FDMctr)--; Debug(1); }
void WebTools::UnPlug() { EventNotifier::Get()->Unbind(wxEVT_CONTEXT_MENU_EDITOR, &WebTools::OnEditorContextMenu, this); EventNotifier::Get()->Unbind(wxEVT_FILE_LOADED, &WebTools::OnFileLoaded, this); EventNotifier::Get()->Unbind(wxEVT_FILE_SAVED, &WebTools::OnFileSaved, this); EventNotifier::Get()->Unbind(wxEVT_CL_THEME_CHANGED, &WebTools::OnThemeChanged, this); EventNotifier::Get()->Unbind(wxEVT_CC_CODE_COMPLETE, &WebTools::OnCodeComplete, this); EventNotifier::Get()->Unbind(wxEVT_CC_CODE_COMPLETE_LANG_KEYWORD, &WebTools::OnCodeComplete, this); EventNotifier::Get()->Unbind( wxEVT_CC_CODE_COMPLETE_FUNCTION_CALLTIP, &WebTools::OnCodeCompleteFunctionCalltip, this); EventNotifier::Get()->Unbind(wxEVT_WORKSPACE_CLOSED, &WebTools::OnWorkspaceClosed, this); EventNotifier::Get()->Unbind(wxEVT_WORKSPACE_LOADED, &WebTools::OnWorkspaceLoaded, this); EventNotifier::Get()->Unbind(wxEVT_ACTIVE_EDITOR_CHANGED, &WebTools::OnEditorChanged, this); EventNotifier::Get()->Unbind(wxEVT_NODEJS_DEBUGGER_STARTED, &WebTools::OnNodeJSDebuggerStarted, this); EventNotifier::Get()->Unbind(wxEVT_NODEJS_DEBUGGER_STOPPED, &WebTools::OnNodeJSDebuggerStopped, this); wxTheApp->Unbind(wxEVT_MENU, &WebTools::OnCommentLine, this, XRCID("comment_line")); wxTheApp->Unbind(wxEVT_MENU, &WebTools::OnCommentSelection, this, XRCID("comment_selection")); // Disconnect the timer events Unbind(wxEVT_TIMER, &WebTools::OnTimer, this, m_timer->GetId()); m_timer->Stop(); wxDELETE(m_timer); m_jsColourThread->Stop(); wxDELETE(m_jsColourThread); m_jsCodeComplete.Reset(NULL); }
void Texture::InitData(const uint8* data) { // if(id == 0) { glGenTextures(1, &id); } Bind(); if(mode == GL_TEXTURE_2D_MULTISAMPLE) { glTexImage2DMultisample(mode, msaa, (uint)internalFormat, size.x, size.y, false); } else { glTexImage2D(mode, 0, (uint)internalFormat, size.x, size.y, 0, (uint)format, (uint)dataType, data); } glTexParameteri(mode, GL_TEXTURE_MAG_FILTER, (uint)scaleFilter); glTexParameteri(mode, GL_TEXTURE_MIN_FILTER, (uint)scaleFilter); glTexParameteri(mode, GL_TEXTURE_WRAP_S, (uint)wrapMode); glTexParameteri(mode, GL_TEXTURE_WRAP_T, (uint)wrapMode); Unbind(); }
/* ================================================================================================ idRenderProgManager::KillAllShaders() ================================================================================================ */ void idRenderProgManager::KillAllShaders() { Unbind(); for( int i = 0; i < vertexShaders.Num(); i++ ) { if( vertexShaders[i].progId != INVALID_PROGID ) { glDeleteShader( vertexShaders[i].progId ); vertexShaders[i].progId = INVALID_PROGID; } } for( int i = 0; i < fragmentShaders.Num(); i++ ) { if( fragmentShaders[i].progId != INVALID_PROGID ) { glDeleteShader( fragmentShaders[i].progId ); fragmentShaders[i].progId = INVALID_PROGID; } } for( int i = 0; i < glslPrograms.Num(); ++i ) { if( glslPrograms[i].progId != INVALID_PROGID ) { glDeleteProgram( glslPrograms[i].progId ); glslPrograms[i].progId = INVALID_PROGID; } } }
void TextureBase::Unload(){ if (textureId!=0){ Unbind(); glDeleteTextures(1, &textureId); textureId = 0; } }
// (use sym . prg) -> any // (use (sym ..) . prg) -> any any doUse(any x) { any y; x = cdr(x); if (isSym(y = car(x))) { bindFrame f; Bind(y,f); x = prog(cdr(x)); Unbind(f); } else { struct { // bindFrame struct bindFrame *link; int i, cnt; struct {any sym; any val;} bnd[length(y)]; } f; f.link = Env.bind, Env.bind = (bindFrame*)&f; f.i = f.cnt = 0; do { f.bnd[f.cnt].sym = car(y); f.bnd[f.cnt].val = val(car(y)); ++f.cnt; } while (isCell(y = cdr(y))); x = prog(cdr(x)); while (--f.cnt >= 0) val(f.bnd[f.cnt].sym) = f.bnd[f.cnt].val; Env.bind = f.link; } return x; }
void FindLine() { int iCur; int iProc; int wInit; DebugStop("Find Line Start"); Lookdown(); iCur = iSight; wInit = wLD; iProc = start_process(Move(1000,1000)); while (iSight == iCur && !fBlocked && !fStalled && !fBall) { printf("FindLine: %d\n", iSight); defer(); Lookdown(); } printf("I:%d, B:%d S:%d\n", iSight, fBlocked, fStalled); kill_process(iProc); SetMotors(0,0); if (fBlocked || fStalled) Unbind(); }
void DumpBall() { DebugStop("Dump Ball"); while (1) { Lookdown(); if (iSight == iMe) { DebugStop("Dumping"); fBallRelease = 1; Gate(0); Hard(-70); msleep(1000L); if (fBlocked) Unbind(); Move(-200,-200); Move(50, 50); Hard(-90); fBallRelease = 0; fBall = 0; break; } Move(300, 300); if (fBlocked) { if (rgfBlock[3]) Hard(-10); else Hard(10); } } }
//////////////////////////////////////////////////////////// /// Bind the socket to a specific port //////////////////////////////////////////////////////////// bool SocketUDP::Bind(unsigned short Port) { // Check if the socket is already bound to the specified port if (myPort != Port) { // If the socket was previously bound to another port, we need to unbind it first Unbind(); if (Port != 0) { // Build an address with the specified port sockaddr_in Addr; Addr.sin_family = AF_INET; Addr.sin_port = htons(Port); Addr.sin_addr.s_addr = INADDR_ANY; memset(Addr.sin_zero, 0, sizeof(Addr.sin_zero)); // Bind the socket to the port if (bind(mySocket, reinterpret_cast<sockaddr*>(&Addr), sizeof(Addr)) == -1) { std::cerr << "Failed to bind the socket to port " << Port << std::endl; myPort = 0; return false; } } // Save the new port myPort = Port; } return true; }
void FHardwareTexture::UnbindAll() { for(int texunit = 0; texunit < 16; texunit++) { Unbind(texunit); } }