本文整理汇总了C++中LBASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ LBASSERT函数的具体用法?C++ LBASSERT怎么用?C++ LBASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LBASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LBASSERT
void EventHandler::_dispatch()
{
Display* display = _window->getXDisplay();
LBASSERT( display );
if( !display )
return;
while( XPending( display ))
{
WindowEvent event;
XEvent& xEvent = event.xEvent;
XNextEvent( display, &xEvent );
event.time = _window->getConfig()->getTime();
for( EventHandlers::const_iterator i = _eventHandlers->begin();
i != _eventHandlers->end(); ++i )
{
EventHandler* handler = *i;
handler->_processEvent( event );
}
}
}
示例2: glLightModeli
bool Window::configInitGL( const eq::uint128_t& initID )
{
if( !eq::Window::configInitGL( initID ))
return false;
glLightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, 1 );
glEnable( GL_CULL_FACE ); // OPT - produces sparser images in DB mode
glCullFace( GL_BACK );
LBASSERT( !_state );
_state = new VertexBufferState( getObjectManager( ));
const Config* config = static_cast< const Config* >( getConfig( ));
const InitData& initData = config->getInitData();
if( initData.showLogo( ))
_loadLogo();
if( initData.useGLSL() )
_loadShaders();
return true;
}
示例3: GPUAsyncLoader
GPUCacheManager::GPUCacheManager( constGPUCacheIndexSPtr cacheIndex, RAMPoolSPtr ramPool, const byte bytesNum,
Window* wnd )
:_iteration( 1 )
,_cacheIndex( cacheIndex )
,_gpuLoader( new GPUAsyncLoader( wnd ))
,_nodeIdBeingLoaded( 0 )
,_cachePosBeingLoaded( 0 )
{
LBASSERT( _cacheIndex );
_gpuLoader->start();
const GPULoadRespond respond = _gpuLoader->readLoadRespond();
if( respond.status.value != GPULoadStatus::INITIALIZED )
LBERROR << "Incorrect respond from GPU Async Loader" << std::endl;
_gpuLoader->postCommand( GPUCommand::PAUSE );
_gpuLoader->initialize( ramPool, cacheIndex, bytesNum );
_resize();
LBWARN << " new GPUCacheManager, updating GPU Cache" << std::endl;
_gpuLoader->postCommand( GPUCommand::UPDATE );
_gpuLoader->postCommand( GPUCommand::RESUME );
}
示例4: LBASSERT
uint128_t FullMasterCM::commit( const uint32_t incarnation )
{
LBASSERT( _version != VERSION_NONE );
if( !_object->isDirty( ))
{
Mutex mutex( _slaves );
_updateCommitCount( incarnation );
_obsolete();
return _version;
}
_maxVersion.waitGE( _version.low() + 1 );
Mutex mutex( _slaves );
#if 0
LBLOG( LOG_OBJECTS ) << "commit v" << _version << " " << command
<< std::endl;
#endif
_updateCommitCount( incarnation );
_commit();
_obsolete();
return _version;
}
示例5: while
//===========================================================================
// ICommand handling methods
//===========================================================================
void Server::handleCommands()
{
_running = true;
while( _running ) // set to false in _cmdShutdown()
{
const co::ICommands& commands = _mainThreadQueue.popAll();
LBASSERT( !commands.empty( ));
for( co::ICommandsCIter i = commands.begin(); i != commands.end(); ++i )
{
// We want to avoid a non-const copy of commands, hence the cast...
co::ICommand& command = const_cast< co::ICommand& >( *i );
if( !command( ))
{
LBABORT( "Error handling " << command );
}
if( !_running )
break;
}
}
_mainThreadQueue.flush();
}
示例6: getPipe
bool Window::configInitSystemWindow( const uint128_t& )
{
const Pipe* pipe = getPipe();
WindowSettings settings = getSettings();
const SystemWindow* sysWindow = _sharedContextWindow ?
_sharedContextWindow->getSystemWindow() : 0;
settings.setSharedContextWindow( sysWindow );
SystemWindow* systemWindow =
pipe->getWindowSystem().createWindow( this, settings );
LBASSERT( systemWindow );
if( !systemWindow->configInit( ))
{
LBWARN << "System window initialization failed" << std::endl;
systemWindow->configExit();
delete systemWindow;
return false;
}
setPixelViewport( systemWindow->getPixelViewport( ));
setSystemWindow( systemWindow );
return true;
}
示例7: LBASSERT
bool GLSLShaders::loadShaders(const std::string &vShader,
const std::string &fShader,
const GLEWContext *glewContext)
{
if (_shadersLoaded)
return true;
LBASSERT(glewContext);
_glewContext = glewContext;
_program = glCreateProgramObjectARB();
GLhandleARB vertexShader = _loadShader(vShader, GL_VERTEX_SHADER_ARB);
if (!vertexShader)
return _cleanupOnError();
glAttachObjectARB(_program, vertexShader);
GLhandleARB fragmentShader = _loadShader(fShader, GL_FRAGMENT_SHADER_ARB);
if (!fragmentShader)
return _cleanupOnError(vertexShader);
glAttachObjectARB(_program, fragmentShader);
glLinkProgramARB(_program);
GLint status;
glGetObjectParameterivARB(_program, GL_OBJECT_LINK_STATUS_ARB, &status);
if (status != GL_FALSE)
{
_shadersLoaded = true;
return true;
}
_printLog(_program, "Linking");
return _cleanupOnError(vertexShader, fragmentShader);
}
示例8: setup
bool setup( lunchbox::PluginRegistry& from, const uint32_t name,
const GLEWContext* gl )
{
if( name == info.name )
{
LBASSERT( isGood() && instance );
return true;
}
clear();
if( name <= EQ_COMPRESSOR_NONE )
{
LBASSERT( isGood() && instance );
return true;
}
plugin = from.findPlugin( name );
LBASSERT( plugin );
if( !plugin )
{
LBWARN << "Plugin for downloader 0x" << std::hex << name << std::dec
<< " not found" << std::endl;
return false;
}
if( !gl )
LBWARN << "Can't verify plugin compatibility, no GLEWContext given"
<< std::endl;
else if( !plugin->isCompatible( name, gl ))
{
LBWARN << "Plugin for downloader 0x" << std::hex << name << std::dec
<< " not compatible with OpenGL implementation" << std::endl;
return false;
}
instance = plugin->newDecompressor( name );
info = plugin->findInfo( name );
LBASSERT( isGood( ));
LBASSERT( instance );
LBASSERT( info.name == name );
LBLOG( LOG_PLUGIN ) << "Instantiated downloader " << info << std::endl;
return instance;
}
示例9: setName
bool Client::initLocal( const int argc, char** argv )
{
bool isClient = false;
std::string clientOpts;
if( _impl->name.empty() && argc > 0 && argv )
{
const boost::filesystem::path prog = argv[0];
setName( prog.stem().string( ));
}
for( int i=1; i<argc; ++i )
{
if( std::string( "--eq-client" ) == argv[i] )
{
isClient = true;
if( i < argc-1 && argv[i+1][0] != '-' ) // server-started client
{
clientOpts = argv[++i];
if( !deserialize( clientOpts ))
LBWARN << "Failed to parse client listen port parameters"
<< std::endl;
LBASSERT( !clientOpts.empty( ));
}
}
else if( _isParameterOption( "--eq-layout", argc, argv, i ))
_impl->activeLayouts.push_back( argv[++i] );
else if( _isParameterOption( "--eq-gpufilter" , argc, argv, i ))
_impl->gpuFilter = argv[ ++i ];
else if( _isParameterOption( "--eq-modelunit", argc, argv, i ))
{
std::istringstream unitString( argv[++i] );
unitString >> _impl->modelUnit;
}
}
示例10: LBASSERT
bool MasterConfig::init()
{
LBASSERT( !_objects );
_objects = new ObjectMap( *this, *getApplication( ));
co::Object* initData = getInitData();
if( initData )
LBCHECK( _objects->register_( initData, OBJECTTYPE_INITDATA ));
_objects->setInitData( initData );
LBCHECK( registerObject( _objects ));
if( !eq::Config::init( _objects->getID( )))
{
LBWARN << "Error during initialization: " << getError() << std::endl;
exit();
return false;
}
if( getError( ))
LBWARN << "Error during initialization: " << getError() << std::endl;
_redraw = true;
return true;
}
示例11: LBASSERT
void DataIStream::_read( void* data, uint64_t size )
{
if( !_checkBuffer( ))
{
LBUNREACHABLE;
LBERROR << "No more input data" << std::endl;
return;
}
LBASSERT( _impl->input );
if( size > _impl->inputSize - _impl->position )
{
LBERROR << "Not enough data in input buffer: need " << size
<< " bytes, " << _impl->inputSize - _impl->position << " left "
<< std::endl;
LBUNREACHABLE;
// TODO: Allow reads which are asymmetric to writes by reading from
// multiple blocks here?
return;
}
memcpy( data, _impl->input + _impl->position, size );
_impl->position += size;
}
示例12: GetModuleHandle
bool DSO::open( const std::string& fileName )
{
if( _impl->dso )
{
LBWARN << "DSO already open, close it first" << std::endl;
return false;
}
if( fileName.empty( ))
{
#ifdef _WIN32 //_MSC_VER
_impl->dso = GetModuleHandle( 0 );
LBASSERT( _impl->dso );
#else
_impl->dso = RTLD_DEFAULT;
#endif
}
else
{
#ifdef _WIN32 //_MSC_VER
_impl->dso = LoadLibrary( fileName.c_str() );
#elif defined( RTLD_LOCAL )
_impl->dso = dlopen( fileName.c_str(), RTLD_LAZY | RTLD_LOCAL );
#else
_impl->dso = dlopen( fileName.c_str(), RTLD_LAZY );
#endif
if( !_impl->dso )
{
LBINFO << "Can't open library " << fileName << ": " << LB_DL_ERROR
<< std::endl;
return false;
}
}
return true;
}
示例13: LBASSERT
bool Connection::send( const Connections& connections, Packet& packet,
const void* const* items, const uint64_t* sizes,
const size_t nItems )
{
if( connections.empty( ))
return true;
packet.size -= 8;
const uint64_t headerSize = packet.size;
for( size_t i = 0; i < nItems; ++i )
{
LBASSERT( sizes[i] > 0 );
packet.size += sizes[ i ] + sizeof( uint64_t );
}
bool success = true;
for( Connections::const_iterator i = connections.begin();
i < connections.end(); ++i )
{
ConnectionPtr connection = *i;
connection->lockSend();
if( !connection->send( &packet, headerSize, true ))
success = false;
for( size_t j = 0; j < nItems; ++j )
if( !connection->send( &sizes[j], sizeof(uint64_t), true ) ||
!connection->send( items[j], sizes[j], true ))
{
success = false;
}
connection->unlockSend();
}
return success;
}
示例14: setup
bool setup(const uint32_t name)
{
if (plugin && info.name == name)
return true;
clear();
if (name <= EQ_COMPRESSOR_NONE)
return true;
plugin = pression::PluginRegistry::getInstance().findPlugin(name);
LBASSERTINFO(plugin, "Can't find plugin for decompressor " << name);
if (!plugin)
return false;
instance = plugin->newDecompressor(name);
info = plugin->findInfo(name);
LBASSERT(info.name == name);
LBLOG(LOG_PLUGIN) << "Instantiated " << (instance ? "" : "empty ")
<< "decompressor of type 0x" << std::hex << name
<< std::dec << std::endl;
return true;
}
示例15: getCanvases
void Config::_switchCanvas()
{
const eq::Canvases& canvases = getCanvases();
if( canvases.empty( ))
return;
_frameData.setCurrentViewID( eq::UUID( ));
if( !_currentCanvas )
{
_currentCanvas = canvases.front();
return;
}
eq::CanvasesCIter i = stde::find( canvases, _currentCanvas );
LBASSERT( i != canvases.end( ));
++i;
if( i == canvases.end( ))
_currentCanvas = canvases.front();
else
_currentCanvas = *i;
_switchView(); // activate first view on canvas
}