Ejemplo n.º 1
0
// public static void DeleteFile(string filename) [static] :1150
void FileSystemImpl::DeleteFile(uString* filename_)
{
    try
    {
        Xli::Disk->DeleteFile(uStringToXliString(filename_));
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Ejemplo n.º 2
0
// public static extern Uno.IO.CppXliStreamHandle CppXliOpenRead(string filename) [static] :1105
::Xli::Stream* FileSystemImpl::CppXliOpenRead(uString* filename_)
{
    try
    {
        return Xli::Disk->OpenFile(uStringToXliString(filename_), Xli::FileModeRead);
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Ejemplo n.º 3
0
// public static void WriteAllBytes(string filename, byte[] bytes) [static] :1216
void FileSystemImpl::WriteAllBytes(uString* filename_, uArray* bytes_)
{
    try
    {
        Xli::Managed<Xli::Stream> f = Xli::Disk->OpenFile(uStringToXliString(filename_), Xli::FileModeWrite);
        f->Write(bytes_->Ptr(), 1, bytes_->Length());
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Ejemplo n.º 4
0
int Main(const Xli::Array<Xli::String>& args)
{
    uRuntime uno;
    int flags = Xli::WindowFlagsResizeable;



    flags |= Xli::WindowFlagsDisablePowerSaver;







# ifdef XLI_PLATFORM_ANDROID
    Xli::PlatformSpecific::Android::SetLogTag("MyMineral");
# endif


    try
    {
        uApplication app;
        Xli::Application::Run(&app, flags);
    }
    catch (const uThrowable& t)
    {
        Xli::String str = "(null)";

        if (t.Exception && t.Exception->Message())
            str = uStringToXliString(t.Exception->Message());

        Xli::Exception x(str);
        x._func = t.Function;
        x._line = t.Line;

        throw x;
    }

    return 0;
}
Ejemplo n.º 5
0
void GL__ShaderSource(::uStatic* __this, ::uUInt shader_, ::uString* source_)
{
    Xli::String source = uStringToXliString(source_);
    
    const char* code[] =
    {
    #ifdef XLI_GL_DESKTOP
        "#version 120\n",
    #else
        "",
    #endif
        source.Ptr(),
    };
    
    GLint len[] =
    {
        (GLint)strlen(code[0]),
        source.Length(),
    };
    
    glShaderSource(shader_, 2, code, len);
}
Ejemplo n.º 6
0
uType* uReflection::GetType(uString* name)
{
    uType* result;
    return _Types->TryGetValue(uStringToXliString(name), result) ? result : NULL;
}
Ejemplo n.º 7
0
int GL__GetUniformLocation(::uStatic* __this, ::uUInt program_, ::uString* name_)
{
    return glGetUniformLocation(program_, uStringToXliString(name_).Ptr());
}