Try exposing (unsafe) memory access to surface buffer

This commit is contained in:
Joshua Granick
2013-12-02 20:58:15 -08:00
parent 665f72edf1
commit bc72d65506
2 changed files with 62 additions and 1 deletions

View File

@@ -3691,6 +3691,67 @@ value lime_bitmap_data_dump_bits(value inSurface)
DEFINE_PRIM(lime_bitmap_data_dump_bits,1);
value lime_surface_get_base(value inSurface)
{
Surface *surf;
if (AbstractToObject(inSurface,surf))
{
return alloc_int((intptr_t)surf->GetBase());
}
return alloc_null();
}
DEFINE_PRIM(lime_surface_get_base,1);
value lime_surface_get_stride(value inSurface)
{
Surface *surf;
if (AbstractToObject(inSurface,surf))
{
return alloc_int(surf->GetStride());
}
return alloc_null();
}
DEFINE_PRIM(lime_surface_get_stride,1);
value lime_surface_begin_render(value inSurface, value inRect)
{
Surface *surf;
if (AbstractToObject(inSurface,surf))
{
Rect rect;
FromValue(rect,inRect);
surf->BeginRender(rect);
}
return alloc_null();
}
DEFINE_PRIM(lime_surface_begin_render,2);
value lime_surface_end_render(value inSurface)
{
Surface *surf;
if (AbstractToObject(inSurface,surf))
{
surf->EndRender();
}
return alloc_null();
}
DEFINE_PRIM(lime_surface_end_render,1);
/*value lime_surface_get_pixel_format(value inSurface)
{
Surface *surf;
if (AbstractToObject(inSurface,surf))
{
return alloc_int(surf->GetStride());
}
return alloc_null();
}*/
// --- Video --------------------------------------------------

View File

@@ -1187,7 +1187,7 @@ DEFINE_PRIM(lime_jni_call_member,3);
value lime_jni_get_env()
{
JNIEnv *env = GetEnv();
return alloc_int((int)env);
return alloc_int((intptr_t)env);
}
DEFINE_PRIM(lime_jni_get_env,0);