本文整理汇总了C++中DALI_ASSERT_ALWAYS函数的典型用法代码示例。如果您正苦于以下问题:C++ DALI_ASSERT_ALWAYS函数的具体用法?C++ DALI_ASSERT_ALWAYS怎么用?C++ DALI_ASSERT_ALWAYS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DALI_ASSERT_ALWAYS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DALI_ASSERT_ALWAYS
// Given a parameter s (NOT x), return the Y value. Checks that the
// segment index is valid. For bezier splines, the last segment is
// only used to specify the end point, so is not valid.
const float Spline::GetY(unsigned int segmentIndex, float s) const
{
DALI_ASSERT_ALWAYS( segmentIndex+1 < mKnots.size() && segmentIndex < mKnots.size() && "segmentIndex out of bounds");
DALI_ASSERT_ALWAYS( mOutTangents.size() == mKnots.size() && "Spline not fully initialized" );
DALI_ASSERT_ALWAYS( mInTangents.size() == mKnots.size() && "Spline not fully initialized" );
float yValue=0.0f;
if(s < 0.0f || s > 1.0f)
{
yValue = 0.0f;
}
else if(s < Math::MACHINE_EPSILON_1)
{
yValue = mKnots[segmentIndex].y;
}
else if( (1.0 - s) < Math::MACHINE_EPSILON_1)
{
yValue = mKnots[segmentIndex+1].y;
}
else
{
Vector4 sVect(s*s*s, s*s, s, 1);
Vector4 cVect;
cVect.x = mKnots[segmentIndex].y;
cVect.y = mOutTangents[segmentIndex].y;
cVect.z = mInTangents[segmentIndex+1].y;
cVect.w = mKnots[segmentIndex+1].y;
yValue = sVect.Dot4(mBasis * cVect);
}
return yValue;
}
示例2: DALI_ASSERT_ALWAYS
void ScrollViewEffect::Detach(Toolkit::ScrollView& scrollView)
{
DALI_ASSERT_ALWAYS( (mScrollViewImpl) && "Already detached from ScrollView" );
DALI_ASSERT_ALWAYS( (&GetImpl(scrollView) == mScrollViewImpl) && "Effect attached to a different ScrollView");
OnDetach(scrollView);
mScrollViewImpl = NULL;
}
示例3: find
void AnimationPlaylist::AnimationDestroyed( Animation& animation )
{
std::set< Animation* >::iterator iter = find( mAnimations.begin(), mAnimations.end(), &animation );
DALI_ASSERT_ALWAYS( iter != mAnimations.end() && "Animation not found" );
mAnimations.erase( iter );
}
示例4: Bind
bool FrameBufferTexture::Prepare()
{
// bind texture
Bind(GL_TEXTURE_2D, GL_TEXTURE0);
if( 0 != mId )
{
// bind frame buffer
mContext.BindFramebuffer(GL_FRAMEBUFFER, mFrameBufferName);
// bind render buffer
mContext.BindRenderbuffer(GL_RENDERBUFFER, mRenderBufferName);
// attach texture to the color attachment point
mContext.FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mId, 0);
// attach render buffer to the depth buffer attachment point
mContext.FramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, mRenderBufferName);
int status = mContext.CheckFramebufferStatus(GL_FRAMEBUFFER);
if ( GL_FRAMEBUFFER_COMPLETE != status )
{
DALI_LOG_ERROR( "status (0x%x), glError (0x%x)\n", status, mContext.GetError() );
DALI_ASSERT_ALWAYS( false && "Frame buffer is not complete!" );
}
return true;
}
// Texture could not be bound
return false;
}
示例5: mAdaptor
Adaptor::Adaptor(Dali::Adaptor& adaptor, RenderSurface* surface, const DeviceLayout& baseLayout)
: mAdaptor(adaptor),
mState(READY),
mCore(NULL),
mUpdateRenderController(NULL),
mVSyncMonitor(NULL),
mGLES( NULL ),
mEglFactory( NULL ),
mSurface( surface ),
mPlatformAbstraction( NULL ),
mEventHandler( NULL ),
mCallbackManager( NULL ),
mNotificationOnIdleInstalled( false ),
mNotificationTrigger(NULL),
mGestureManager(NULL),
mHDpi( 0 ),
mVDpi( 0 ),
mDaliFeedbackPlugin(NULL),
mFeedbackController(NULL),
mObservers(),
mDragAndDropDetector(),
mDeferredRotationObserver(NULL),
mBaseLayout(baseLayout),
mEnvironmentOptions(),
mPerformanceInterface(NULL)
{
DALI_ASSERT_ALWAYS( gThreadLocalAdaptor.get() == NULL && "Cannot create more than one Adaptor per thread" );
gThreadLocalAdaptor.reset(this);
}
示例6: DALI_ASSERT_ALWAYS
void AnimationPlaylist::AnimationDestroyed( Animation& animation )
{
Dali::Vector< Animation* >::Iterator iter = std::find( mAnimations.Begin(), mAnimations.End(), &animation );
DALI_ASSERT_ALWAYS( iter != mAnimations.End() && "Animation not found" );
mAnimations.Remove( iter );
}
示例7: DALI_ASSERT_ALWAYS
void RenderThread::InitializeEgl()
{
mEGL = mEglFactory->Create();
DALI_ASSERT_ALWAYS( mSurface && "NULL surface" );
// initialize egl & OpenGL
mDisplayConnection->InitializeEgl( *mEGL );
mSurface->InitializeEgl( *mEGL );
// create the OpenGL context
mEGL->CreateContext();
// create the OpenGL surface
mSurface->CreateEglSurface(*mEGL);
// Make it current
mEGL->MakeContextCurrent();
// set the initial sync mode
// tell core it has a context
mCore.ContextCreated();
}
示例8: DALI_ASSERT_ALWAYS
const SceneGraph::PropertyBase* PanGestureDetector::GetSceneObjectAnimatableProperty( Property::Index index ) const
{
DALI_ASSERT_ALWAYS( IsPropertyAnimatable(index) && "Property is not animatable" );
// None of our properties are animatable
return NULL;
}
示例9: DALI_ASSERT_DEBUG
Property::Value& Property::Value::GetValue(const std::string& key) const
{
DALI_ASSERT_DEBUG(Property::MAP == GetType() && "Property type invalid");
Property::Map *container = AnyCast<Property::Map>(&(mImpl->mValue));
DALI_ASSERT_DEBUG(container);
if(container)
{
for(Property::Map::iterator iter = container->begin(); iter != container->end(); ++iter)
{
if(iter->first == key)
{
return iter->second;
}
}
}
DALI_LOG_WARNING("Cannot find property map key %s", key.c_str());
DALI_ASSERT_ALWAYS(!"Cannot find property map key");
// should never return this
static Property::Value null;
return null;
}
示例10: main
int main( int argc, char* argv[] )
{
// pull out the JSON file and JavaScript file from the command line arguments
std::string javaScriptFileName;
std::string jSONFileName;
for( int i = 1 ; i < argc ; ++i )
{
std::string arg( argv[i] );
size_t idx = std::string::npos;
idx = arg.find( ".json" );
if( idx != std::string::npos )
{
jSONFileName = arg;
}
else
{
idx = arg.find( ".js" );
if( idx != std::string::npos )
{
javaScriptFileName = arg;
}
}
}
if( !jSONFileName.empty() )
{
bool exists = CheckIfFileExists( jSONFileName );
if( !exists )
{
DALI_ASSERT_ALWAYS( 0 && "JSON file not found ")
}
}
示例11: DALI_ASSERT_ALWAYS
const SceneGraph::PropertyBase* AnimatableMesh::GetSceneObjectAnimatableProperty( Property::Index index ) const
{
DALI_ASSERT_ALWAYS( IsPropertyAnimatable(index) && "Property is not animatable" );
const SceneGraph::PropertyBase* property( NULL );
// This method should only return a property which is part of the scene-graph
if( mSceneObject != NULL )
{
int vertexProperty = index % VERTEX_PROPERTY_COUNT;
int vertexIndex = index / VERTEX_PROPERTY_COUNT;
switch ( vertexProperty )
{
case Dali::AnimatableVertex::POSITION:
property = &mSceneObject->mVertices[vertexIndex].position;
break;
case Dali::AnimatableVertex::COLOR:
property = &mSceneObject->mVertices[vertexIndex].color;
break;
case Dali::AnimatableVertex::TEXTURE_COORDS:
property = &mSceneObject->mVertices[vertexIndex].textureCoords;
break;
}
}
return property;
}
示例12: DemangleClassName
bool TypeRegistry::Register( const std::string& uniqueTypeName, const std::type_info& baseTypeInfo,
Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit )
{
bool ret = false;
std::string baseTypeName = DemangleClassName(baseTypeInfo.name());
RegistryMap::iterator iter = mRegistryLut.find(uniqueTypeName);
if( iter == mRegistryLut.end() )
{
mRegistryLut[uniqueTypeName] = Dali::TypeInfo(new Internal::TypeInfo(uniqueTypeName, baseTypeName, createInstance));
ret = true;
DALI_LOG_INFO( gLogFilter, Debug::Concise, "Type Registration %s(%s)\n", uniqueTypeName.c_str(), baseTypeName.c_str());
}
else
{
DALI_LOG_WARNING("Duplicate name for TypeRegistry for '%s'\n", + uniqueTypeName.c_str());
DALI_ASSERT_ALWAYS(!"Duplicate type name for Type Registation");
}
if( callCreateOnInit )
{
mInitFunctions.push_back(createInstance);
}
return ret;
}
示例13: DALI_ASSERT_ALWAYS
void ShadowView::Activate()
{
DALI_ASSERT_ALWAYS( Self().OnStage() && "ShadowView should be on stage before calling Activate()\n" );
// make sure resources are allocated and start the render tasks processing
CreateRenderTasks();
}
示例14: DALI_LOG_INFO
void RenderThread::Start()
{
DALI_LOG_INFO( gRenderLogFilter, Debug::Verbose, "RenderThread::Start()\n");
// initialise GL and kick off render thread
DALI_ASSERT_ALWAYS( !mEGL && "Egl already initialized" );
// create the render thread, initially we are rendering
mThread = new pthread_t();
int error = pthread_create( mThread, NULL, InternalThreadEntryFunc, this );
DALI_ASSERT_ALWAYS( !error && "Return code from pthread_create() in RenderThread" );
if( mSurface )
{
mSurface->StartRender();
}
}
示例15: CheckGlError
void CheckGlError( Integration::GlAbstraction& glAbstraction, const char* operation )
{
for( GLint error = glAbstraction.GetError(); error; error = glAbstraction.GetError() )
{
DALI_LOG_ERROR( "glError (0x%x) %s - after %s\n", error, ErrorToString(error), operation );
DALI_ASSERT_ALWAYS( !error && "GL ERROR"); // if errors are being checked we should assert
}
}