+#define RETRO_ENVIRONMENT_SET_HW_RENDER (14 | RETRO_ENVIRONMENT_EXPERIMENTAL)
+ // struct retro_hw_render_callback * --
+ // NOTE: This call is currently very experimental, and should not be considered part of the public API.
+ // The interface could be changed or removed at any time.
+ // Sets an interface to let a libretro core render with hardware acceleration.
+ // Should be called in retro_load_game().
+ // If successful, libretro cores will be able to render to a frontend-provided framebuffer.
+ // The size of this framebuffer will be at least as large as max_width/max_height provided in get_av_info().
+ // If HW rendering is used, pass only RETRO_HW_FRAME_BUFFER_VALID or NULL to retro_video_refresh_t.
+#define RETRO_ENVIRONMENT_GET_VARIABLE 15
+ // struct retro_variable * --
+ // Interface to aquire user-defined information from environment
+ // that cannot feasibly be supported in a multi-system way.
+ // 'key' should be set to a key which has already been set by SET_VARIABLES.
+ // 'data' will be set to a value or NULL.
+ //
+#define RETRO_ENVIRONMENT_SET_VARIABLES 16
+ // const struct retro_variable * --
+ // Allows an implementation to signal the environment
+ // which variables it might want to check for later using GET_VARIABLE.
+ // This allows the frontend to present these variables to a user dynamically.
+ // This should be called as early as possible (ideally in retro_set_environment).
+ //
+ // 'data' points to an array of retro_variable structs terminated by a { NULL, NULL } element.
+ // retro_variable::key should be namespaced to not collide with other implementations' keys. E.g. A core called 'foo' should use keys named as 'foo_option'.
+ // retro_variable::value should contain a human readable description of the key as well as a '|' delimited list of expected values.
+ // The number of possible options should be very limited, i.e. it should be feasible to cycle through options without a keyboard.
+ // First entry should be treated as a default.
+ //
+ // Example entry:
+ // { "foo_option", "Speed hack coprocessor X; false|true" }
+ //
+ // Text before first ';' is description. This ';' must be followed by a space, and followed by a list of possible values split up with '|'.
+ // Only strings are operated on. The possible values will generally be displayed and stored as-is by the frontend.
+ //
+#define RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE 17
+ // bool * --
+ // Result is set to true if some variables are updated by
+ // frontend since last call to RETRO_ENVIRONMENT_GET_VARIABLE.
+ // Variables should be queried with GET_VARIABLE.
+ //
+#define RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME 18
+ // const bool * --
+ // If true, the libretro implementation supports calls to retro_load_game() with NULL as argument.
+ // Used by cores which can run without particular game data.
+ // This should be called within retro_set_environment() only.
+
+
+// Pass this to retro_video_refresh_t if rendering to hardware.
+// Passing NULL to retro_video_refresh_t is still a frame dupe as normal.
+#define RETRO_HW_FRAME_BUFFER_VALID ((void*)-1)
+
+// Invalidates the current HW context.
+// If called, all GPU resources must be reinitialized.
+// Usually called when frontend reinits video driver.
+// Also called first time video driver is initialized, allowing libretro core to init resources.
+typedef void (*retro_hw_context_reset_t)(void);
+// Gets current framebuffer which is to be rendered to. Could change every frame potentially.
+typedef uintptr_t (*retro_hw_get_current_framebuffer_t)(void);
+
+// Get a symbol from HW context.
+typedef void (*retro_proc_address_t)(void);
+typedef retro_proc_address_t (*retro_hw_get_proc_address_t)(const char *sym);
+
+enum retro_hw_context_type
+{
+ RETRO_HW_CONTEXT_NONE = 0,
+ RETRO_HW_CONTEXT_OPENGL, // OpenGL 2.x. Latest version available before 3.x+.
+ RETRO_HW_CONTEXT_OPENGLES2, // GLES 2.0
+
+ RETRO_HW_CONTEXT_DUMMY = INT_MAX
+};