Пример #1
0
Xli::Texture* uLoadXliTexture(const Xli::String& filename, Xli::Stream* stream)
{
    Xli::String fnUpper = filename.ToUpper();
    Xli::Managed<Xli::ImageReader> ir;

    if (fnUpper.EndsWith(".PNG"))
        ir = Xli::Png::CreateReader(stream);
    else if (fnUpper.EndsWith(".JPG") || fnUpper.EndsWith(".JPEG"))
        ir = Xli::Jpeg::CreateReader(stream);
    else
        XLI_THROW("Unsupported texture extension '" + Xli::Path::GetExtension(filename) + "'");

    Xli::Managed<Xli::Bitmap> bmp = ir->ReadBitmap();
    return Xli::Texture::Create(bmp);
}
Пример #2
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);
}
Пример #3
0
void AApplication::cppJavaThrowError (Xli::String message)
{
    XLI_THROW(message.Ptr());
}