Ejemplo n.º 1
0
void Demi::DiLogManager::Error( const char* szFileName, unsigned int uiLine, const char* pacFormat, ... )
{
    const int MAX_CHAR = 10 * 1024;
    static char szLog[MAX_CHAR + 1];
    szLog[MAX_CHAR] = '\0';

    va_list args;    
    va_start(args, pacFormat);    
    SAFE_VSPRINTF(szLog, MAX_CHAR, pacFormat, args);
    va_end(args);

    OutputUnformat(LOG_LEVEL_ERROR,szFileName,uiLine,szLog);

    DiString fileName = szFileName;
    DiString lines;
    lines.SetInt(uiLine);
    DiString outstr("A fatal error occured:\n\nFilename:");
    outstr += fileName;
    outstr += "\n\nLine:";
    outstr += lines;
    outstr += "\n\nDescription:";
    outstr += szLog;
    DiPlatformFunc::ErrorDlg(outstr.c_str());

#if DEMI_PLATFORM == DEMI_PLATFORM_WIN32
    __asm int 3
#endif
}
Ejemplo n.º 2
0
    DiGLES2RenderBuffer::DiGLES2RenderBuffer(GLenum format, uint32 width, uint32 height)
        :mRenderbufferID(0),
        mGLFormat(format)
    {
        // Generate render buffer
        CHECK_GL_ERROR(glGenRenderbuffers(1, &mRenderbufferID));

        if (DiGLES2Driver::GLUtil->CheckExtension("GL_EXT_debug_label"))
        {
            DiString name;
            name.SetInt(mRenderbufferID);
            IF_IOS_VERSION_IS_GREATER_THAN(5.0)
            glLabelObjectEXT(GL_PROGRAM_OBJECT_EXT, mRenderbufferID, 0, name.c_str());
        }

        // Bind it to FBO
        CHECK_GL_ERROR(glBindRenderbuffer(GL_RENDERBUFFER, mRenderbufferID));
        CHECK_GL_ERROR(glRenderbufferStorage(GL_RENDERBUFFER, format, width, height));
    }
Ejemplo n.º 3
0
    DiInstancedModel::DiInstancedModel( DiInstanceBatch *batchOwner, 
        uint32 instanceID, DiInstancedModel* sharedTransformEntity /*= NULL*/ )
        :DiTransformUnit(),
        mInstanceId( instanceID ),
        mInUse( false ),
        mBatchOwner( batchOwner ),
        mClipSet( NULL ),
        mSkeletonInstance( NULL ),
        mBoneMatrices( NULL ),
        mBoneWorldMatrices( NULL ),
        mFrameAnimationLastUpdated(std::numeric_limits<ULONG>::max() - 1),
        mSharedTransformModel( NULL ),
        mTransformLookupNumber(instanceID),
        mPosition(DiVec3::ZERO),
        mDerivedLocalPosition(DiVec3::ZERO),
        mOrientation(DiQuat::IDENTITY),
        mScale(DiVec3::UNIT_SCALE),
        mMaxScaleLocal(1),
        mNeedTransformUpdate(true),
        mNeedAnimTransformUpdate(true),
        mUseLocalTransform(false),
        mSpeed(1),
        mAutoUpdateAnims(false)
    {
        static int count = 0;
        DiString s;
        s.SetInt(count++);
        mName = batchOwner->GetName() + "_InsMdl_";
        mName += s;

        if (sharedTransformEntity)
        {
            sharedTransformEntity->ShareTransformWith(this);
        }
        else
        {
            CreateSkeletonInstance();
        }
        UpdateTransforms();
    }