Try exposing (unsafe) memory access to surface buffer
This commit is contained in:
@@ -3691,6 +3691,67 @@ value lime_bitmap_data_dump_bits(value inSurface)
|
|||||||
DEFINE_PRIM(lime_bitmap_data_dump_bits,1);
|
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 --------------------------------------------------
|
// --- Video --------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -1187,7 +1187,7 @@ DEFINE_PRIM(lime_jni_call_member,3);
|
|||||||
value lime_jni_get_env()
|
value lime_jni_get_env()
|
||||||
{
|
{
|
||||||
JNIEnv *env = GetEnv();
|
JNIEnv *env = GetEnv();
|
||||||
return alloc_int((int)env);
|
return alloc_int((intptr_t)env);
|
||||||
}
|
}
|
||||||
DEFINE_PRIM(lime_jni_get_env,0);
|
DEFINE_PRIM(lime_jni_get_env,0);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user