Home | History | Annotate | Download | only in android
      1 /* Copyright (C) 2011 The Android Open Source Project
      2 **
      3 ** This software is licensed under the terms of the GNU General Public
      4 ** License version 2, as published by the Free Software Foundation, and
      5 ** may be copied, distributed, and modified under those terms.
      6 **
      7 ** This program is distributed in the hope that it will be useful,
      8 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
      9 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     10 ** GNU General Public License for more details.
     11 */
     12 #ifndef ANDROID_OPENGLES_H
     13 #define ANDROID_OPENGLES_H
     14 
     15 #include <stddef.h>
     16 
     17 #define ANDROID_OPENGLES_BASE_PORT  22468
     18 
     19 /* See the description in render_api.h. */
     20 typedef void (*OnPostFn)(void* context, int width, int height, int ydir,
     21                          int format, int type, unsigned char* pixels);
     22 
     23 /* Call this function to initialize the hardware opengles emulation.
     24  * This function will abort if we can't find the corresponding host
     25  * libraries through dlopen() or equivalent.
     26  */
     27 int android_initOpenglesEmulation(void);
     28 
     29 /* Tries to start the renderer process. Returns 0 on success, -1 on error.
     30  * At the moment, this must be done before the VM starts. The onPost callback
     31  * may be NULL.
     32  */
     33 int android_startOpenglesRenderer(int width, int height,
     34                                   OnPostFn onPost, void* onPostContext);
     35 
     36 int android_showOpenglesWindow(void* window, int x, int y, int width, int height, float rotation);
     37 
     38 int android_hideOpenglesWindow(void);
     39 
     40 void android_redrawOpenglesWindow(void);
     41 
     42 /* Stop the renderer process */
     43 void android_stopOpenglesRenderer(void);
     44 
     45 /* set to TRUE if you want to use fast GLES pipes, 0 if you want to
     46  * fallback to local TCP ones
     47  */
     48 extern int  android_gles_fast_pipes;
     49 
     50 /* Write the path of the Unix socket we're going to use to access GLES on a given <port> */
     51 /* The result is only valid on Unix systems */
     52 void android_gles_unix_path(char* buff, size_t buffsize, int port);
     53 
     54 #endif /* ANDROID_OPENGLES_H */
     55