xerpi/libvita2d

New function

Closed this issue · 5 comments

Hello!
Thanks for your lib !

I didn't find any fonctions to get color of one pixel. Am I stupid or it's true ? :)

Thanks !

xerpi commented

Do you want to get the pixel from the texture or the framebuffer?

Framebuffer will be perfect :)

xerpi commented

You can do something like:

unsigned int get_pixel(int x, int y)
{
    unsigned int *buffer = vita2d_get_current_fb();
    return buffer[x + y * 544];
}

But be careful when you call vita2d_get_current_fb(), the GPU may still be writing to the framebuffer when you try to read from it.

Thank a lot !

Why not add a new function vita2d_draw_texture_part_scale_rotate_hotspot ;)