当前位置: 首页>>代码示例>>C++>>正文


C++ DALI_ASSERT_ALWAYS函数代码示例

本文整理汇总了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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:36,代码来源:spline.cpp

示例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;
}
开发者ID:mettalla,项目名称:dali,代码行数:9,代码来源:scroll-view-effect-impl.cpp

示例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 );
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:7,代码来源:animation-playlist.cpp

示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:29,代码来源:frame-buffer-texture.cpp

示例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);
}
开发者ID:Tarnyko,项目名称:dali-adaptor,代码行数:29,代码来源:adaptor-impl.cpp

示例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 );
}
开发者ID:mettalla,项目名称:dali,代码行数:7,代码来源:animation-playlist.cpp

示例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();

}
开发者ID:mettalla,项目名称:dali,代码行数:25,代码来源:render-thread.cpp

示例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;
}
开发者ID:mettalla,项目名称:dali,代码行数:7,代码来源:pan-gesture-detector-impl.cpp

示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:26,代码来源:property-value.cpp

示例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 ")
    }
  }
开发者ID:mettalla,项目名称:dali,代码行数:35,代码来源:scripting-example.cpp

示例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;
}
开发者ID:Tarnyko,项目名称:dali-core,代码行数:28,代码来源:animatable-mesh-impl.cpp

示例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;
}
开发者ID:mettalla,项目名称:dali,代码行数:28,代码来源:type-registry-impl.cpp

示例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();
}
开发者ID:mettalla,项目名称:dali,代码行数:7,代码来源:shadow-view-impl.cpp

示例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();
  }
}
开发者ID:mettalla,项目名称:dali,代码行数:17,代码来源:render-thread.cpp

示例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
    }
}
开发者ID:noyangunday,项目名称:dali,代码行数:8,代码来源:gl-call-debug.cpp


注:本文中的DALI_ASSERT_ALWAYS函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。