Updates
This commit is contained in:
parent
c5c2053913
commit
665aa372e0
10
Makefile
10
Makefile
|
@ -112,8 +112,14 @@ else
|
|||
endif
|
||||
|
||||
OBJECTS := mpv-libretro.o
|
||||
LDFLAGS += -lmpv -ldl -lm
|
||||
CFLAGS += -Wall -pedantic -std=gnu99
|
||||
LDFLAGS += -lmpv
|
||||
CFLAGS += -Wall -pedantic -std=c99
|
||||
|
||||
ifneq (,$(findstring gles,$(platform)))
|
||||
LDFLAGS += -ldl
|
||||
endif
|
||||
|
||||
LDFLAGS += -lm
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
@ -23,6 +22,10 @@
|
|||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef HAVE_OPENGLES
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOCALE
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
@ -30,7 +33,7 @@
|
|||
#include <mpv/client.h>
|
||||
#include <mpv/opengl_cb.h>
|
||||
|
||||
#include "libretro.h"
|
||||
#include <libretro.h>
|
||||
#include "version.h"
|
||||
|
||||
static struct retro_hw_render_callback hw_render;
|
||||
|
@ -131,20 +134,24 @@ static void *get_proc_address_mpv(void *fn_ctx, const char *name)
|
|||
void *proc_addr = (void *) hw_render.get_proc_address(name);
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#ifdef HAVE_OPENGLES
|
||||
/* EGL 1.4 (supported by the RPI firmware) does not necessarily return
|
||||
* function pointers for core functions.
|
||||
*/
|
||||
if (!proc_addr) {
|
||||
void *h = dlopen("/opt/vc/lib/libGLESv2.so", RTLD_LAZY);
|
||||
if (!proc_addr)
|
||||
{
|
||||
void *h = dlopen("/opt/vc/lib/libGLESv2.so", RTLD_LAZY);
|
||||
|
||||
if (!h)
|
||||
h = dlopen("/usr/lib/libGLESv2.so", RTLD_LAZY);
|
||||
if (!h)
|
||||
h = dlopen("/usr/lib/libGLESv2.so", RTLD_LAZY);
|
||||
|
||||
if (h) {
|
||||
proc_addr = dlsym(h, name);
|
||||
dlclose(h);
|
||||
}
|
||||
}
|
||||
if (h)
|
||||
{
|
||||
proc_addr = dlsym(h, name);
|
||||
dlclose(h);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(proc_addr == NULL)
|
||||
log_cb(RETRO_LOG_ERROR, "Failure obtaining %s proc address\n", name);
|
||||
|
|
Loading…
Reference in New Issue