mirror of
https://github.com/libretro/RetroArch
synced 2025-03-23 10:20:57 +00:00
Add JNI target to libretro-test-gl.
Fixup GLES build.
This commit is contained in:
parent
71c699b5fc
commit
179b374c39
6
gfx/gl.c
6
gfx/gl.c
@ -650,10 +650,6 @@ void gl_init_fbo(void *data, unsigned width, unsigned height)
|
||||
#ifndef HAVE_RGL
|
||||
bool gl_init_hw_render(gl_t *gl, unsigned width, unsigned height)
|
||||
{
|
||||
#if defined(__QNX__) || defined(ANDROID)
|
||||
width = 512;
|
||||
height = 512;
|
||||
#endif
|
||||
RARCH_LOG("[GL]: Initializing HW render (%u x %u).\n", width, height);
|
||||
|
||||
if (!load_fbo_proc(gl))
|
||||
@ -662,7 +658,7 @@ bool gl_init_hw_render(gl_t *gl, unsigned width, unsigned height)
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
pglGenFramebuffers(TEXTURES, gl->hw_render_fbo);
|
||||
|
||||
bool depth = g_extern.system.hw_render_callback.depth;
|
||||
bool depth = g_extern.system.hw_render_callback.depth;
|
||||
|
||||
if (depth)
|
||||
{
|
||||
|
25
libretro-test-gl/jni/Android.mk
Normal file
25
libretro-test-gl/jni/Android.mk
Normal file
@ -0,0 +1,25 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := retro-test-gl
|
||||
|
||||
ifeq ($(TARGET_ARCH),arm)
|
||||
LOCAL_CFLAGS += -DANDROID_ARM
|
||||
LOCAL_ARM_MODE := arm
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),x86)
|
||||
LOCAL_CFLAGS += -DANDROID_X86
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),mips)
|
||||
LOCAL_CFLAGS += -DANDROID_MIPS
|
||||
endif
|
||||
|
||||
LOCAL_SRC_FILES += $(wildcard ../*.c)
|
||||
LOCAL_CFLAGS += -O2 -Wall -std=gnu99 -ffast-math -DGLES
|
||||
LOCAL_LDLIBS += -lGLESv2
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
3
libretro-test-gl/jni/Application.mk
Normal file
3
libretro-test-gl/jni/Application.mk
Normal file
@ -0,0 +1,3 @@
|
||||
APP_ABI := all
|
||||
APP_PLATFORM := android-9
|
||||
|
@ -9,13 +9,33 @@
|
||||
static struct retro_hw_render_callback hw_render;
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES
|
||||
#if defined(GLES) && 0
|
||||
#if defined(GLES)
|
||||
#include <GLES2/gl2.h>
|
||||
#else
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glext.h>
|
||||
#endif
|
||||
|
||||
#ifdef GLES
|
||||
#define pglCreateProgram glCreateProgram
|
||||
#define pglCreateShader glCreateShader
|
||||
#define pglCompileShader glCompileShader
|
||||
#define pglUseProgram glUseProgram
|
||||
#define pglShaderSource glShaderSource
|
||||
#define pglAttachShader glAttachShader
|
||||
#define pglLinkProgram glLinkProgram
|
||||
#define pglBindFramebuffer glBindFramebuffer
|
||||
#define pglGetUniformLocation glGetUniformLocation
|
||||
#define pglUniformMatrix4fv glUniformMatrix4fv
|
||||
#define pglGetAttribLocation glGetAttribLocation
|
||||
#define pglVertexAttribPointer glVertexAttribPointer
|
||||
#define pglEnableVertexAttribArray glEnableVertexAttribArray
|
||||
#define pglDisableVertexAttribArray glDisableVertexAttribArray
|
||||
#define pglGenBuffers glGenBuffers
|
||||
#define pglBufferData glBufferData
|
||||
#define pglBindBuffer glBindBuffer
|
||||
#define init_gl_proc()
|
||||
#else
|
||||
static PFNGLCREATEPROGRAMPROC pglCreateProgram;
|
||||
static PFNGLCREATESHADERPROC pglCreateShader;
|
||||
static PFNGLCREATESHADERPROC pglCompileShader;
|
||||
@ -71,6 +91,7 @@ static void init_gl_proc(void)
|
||||
memcpy(proc_map[i].proc, &proc, sizeof(proc));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static GLuint prog;
|
||||
static GLuint vbo;
|
||||
|
Loading…
x
Reference in New Issue
Block a user