diff options
author | Jesse Hall <jessehall@google.com> | 2012-05-08 15:44:35 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2012-05-10 11:50:16 -0700 |
commit | ba5c1f674511aff458dae69927a1c61d60e66aa1 (patch) | |
tree | d279d4a506bee2b5aabf37c5432e23cfc309939a /android/opengles.c | |
parent | 291744a651760261527f0bf66a7573d4a94a862e (diff) | |
download | external_qemu-ba5c1f674511aff458dae69927a1c61d60e66aa1.zip external_qemu-ba5c1f674511aff458dae69927a1c61d60e66aa1.tar.gz external_qemu-ba5c1f674511aff458dae69927a1c61d60e66aa1.tar.bz2 |
Remove init-time GLES per-frame callback
The GLES renderer interface now allows the per-frame callback to be
registered after initialization. This change updates the emulator to
use the new interface. Since reading back completed frames is slow
(due to pipeline flush/stall), a future change will enable the
callback only while multitouch emulation is actually in use.
Change-Id: I7ad23b4bebe1bd3077863da4d50333cc0578519e
Diffstat (limited to 'android/opengles.c')
-rw-r--r-- | android/opengles.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/android/opengles.c b/android/opengles.c index 70e3f8c..6f0556f 100644 --- a/android/opengles.c +++ b/android/opengles.c @@ -47,6 +47,7 @@ int android_gles_fast_pipes = 1; DYNLINK_FUNC(initLibrary) \ DYNLINK_FUNC(setStreamMode) \ DYNLINK_FUNC(initOpenGLRenderer) \ + DYNLINK_FUNC(setPostCallback) \ DYNLINK_FUNC(getHardwareStrings) \ DYNLINK_FUNC(createOpenGLSubwindow) \ DYNLINK_FUNC(destroyOpenGLSubwindow) \ @@ -139,20 +140,28 @@ BAD_EXIT: } int -android_startOpenglesRenderer(int width, int height, OnPostFunc onPost, void* onPostContext) +android_startOpenglesRenderer(int width, int height) { if (!rendererLib) { D("Can't start OpenGLES renderer without support libraries"); return -1; } - if (!initOpenGLRenderer(width, height, ANDROID_OPENGLES_BASE_PORT, onPost, onPostContext)) { + if (!initOpenGLRenderer(width, height, ANDROID_OPENGLES_BASE_PORT)) { D("Can't start OpenGLES renderer?"); return -1; } return 0; } +void +android_setPostCallback(OnPostFunc onPost, void* onPostContext) +{ + if (rendererLib) { + setPostCallback(onPost, onPostContext); + } +} + static void strncpy_safe(char* dst, const char* src, size_t n) { strncpy(dst, src, n); |