retrograde-android
retrograde-android copied to clipboard
Support for hardware rendering
- Core calls the "environment" callback with
RETRO_ENVIRONMENT_SET_HW_RENDER
https://github.com/libretro/libretro-common/blob/master/include/libretro.h#L546 - Frontend receives that callback and returns a pointer to a struct
retro_hw_render_callback
- That struct has two important fields that need to be populated by the frontend:
-
get_proc_address
-- pointer to a function that resolves functions by name.- This function gets called by the core for every GL symbol. https://github.com/libretro/libretro-common/blob/master/glsm/glsm.c#L2256 https://github.com/libretro/libretro-common/blob/master/glsym/rglgen.c#L41
- The list of symbols depends on the gl version being used: https://github.com/libretro/libretro-common/blob/master/glsym/glsym_gl.c https://github.com/libretro/libretro-common/blob/master/glsym/glsym_es2.c https://github.com/libretro/libretro-common/blob/master/glsym/glsym_es3.c
- RetroArch has an implementation of get_proc_address for Android that simply calls thru to egl_get_proc_address.
-
get_current_framebuffer
-- pointer to function that returns an opengl framebuffer- TODO: Figure this out.
-
- Struct also has a field
context_reset
pointing to a function that needs to be called by the frontend to initialize/reset hw rendering.