void Java_com_example_SanAngeles_DemoRenderer_nativeInit( JNIEnv* env ) { importGLInit(); appInit(); gAppAlive = 1; }
/* Call to initialize the graphics state */ void Java_com_example_SanAngeles_DemoRenderer_nativeInit( JNIEnv* env ) { importGLInit(); appInit(); gAppAlive = 1; sDemoStopped = 0; sTimeOffsetInit = 0; }
/* Call to initialize the graphics state */ void Java_com_StobDaoura_ToddlerShapePuzzle_DemoRenderer_nativeInit( JNIEnv* env ) { importGLInit(); appInit(); gAppAlive = 1; sDemoStopped = 0; sTimeOffsetInit = 0; }
/* Call to initialize the graphics state */ void Java_cc_co_androidzoo_jplayerg_PlayerRenderer_nativeInit( JNIEnv* env ) { importGLInit(); appInit(); gAppAlive = 1; sDemoStopped = 0; sTimeOffsetInit = 0; }
/* Call to initialize the graphics state */ void Java_foam_nebogeo_nomadic_NomadicRenderer_nativeInit( JNIEnv* env ) { importGLInit(); appInit(); gAppAlive = 1; sDemoStopped = 0; sTimeOffsetInit = 0; }
static int initGraphics() { static const EGLint configAttribs[] = { #if (WINDOW_BPP == 16) EGL_RED_SIZE, 5, EGL_GREEN_SIZE, 5, EGL_BLUE_SIZE, 5, #elif (WINDOW_BPP == 32) EGL_RED_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_BLUE_SIZE, 8, #else #error WINDOW_BPP must be 16 or 32 #endif EGL_DEPTH_SIZE, 16, EGL_ALPHA_SIZE, EGL_DONT_CARE, EGL_STENCIL_SIZE, EGL_DONT_CARE, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_NONE }; EGLBoolean success; EGLint numConfigs; EGLint majorVersion; EGLint minorVersion; int importGLResult; importGLResult = importGLInit(); if (!importGLResult) return 0; sDisplay = XOpenDisplay(NULL); sEglDisplay = eglGetDisplay(sDisplay); success = eglInitialize(sEglDisplay, &majorVersion, &minorVersion); if (success != EGL_FALSE) success = eglGetConfigs(sEglDisplay, NULL, 0, &numConfigs); if (success != EGL_FALSE) success = eglChooseConfig(sEglDisplay, configAttribs, &sEglConfig, 1, &numConfigs); if (success != EGL_FALSE) { sEglContext = eglCreateContext(sEglDisplay, sEglConfig, NULL, NULL); if (sEglContext == EGL_NO_CONTEXT) success = EGL_FALSE; } if (success != EGL_FALSE) { XSetWindowAttributes swa; XVisualInfo *vi, tmp; XSizeHints sh; int n; EGLint vid; eglGetConfigAttrib(sEglDisplay, sEglConfig, EGL_NATIVE_VISUAL_ID, &vid); tmp.visualid = vid; vi = XGetVisualInfo(sDisplay, VisualIDMask, &tmp, &n); swa.colormap = XCreateColormap(sDisplay, RootWindow(sDisplay, vi->screen), vi->visual, AllocNone); sh.flags = PMinSize | PMaxSize; sh.min_width = sh.max_width = sWindowWidth; sh.min_height = sh.max_height = sWindowHeight; swa.border_pixel = 0; swa.event_mask = ExposureMask | StructureNotifyMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask; sWindow = XCreateWindow(sDisplay, RootWindow(sDisplay, vi->screen), 0, 0, sWindowWidth, sWindowHeight, 0, vi->depth, InputOutput, vi->visual, CWBorderPixel | CWColormap | CWEventMask, &swa); XMapWindow(sDisplay, sWindow); XSetStandardProperties(sDisplay, sWindow, sAppName, sAppName, None, (void *)0, 0, &sh); } if (success != EGL_FALSE) { sEglSurface = eglCreateWindowSurface(sEglDisplay, sEglConfig, (NativeWindowType)sWindow, NULL); if (sEglSurface == EGL_NO_SURFACE) success = EGL_FALSE; } if (success != EGL_FALSE) success = eglMakeCurrent(sEglDisplay, sEglSurface, sEglSurface, sEglContext); if (success == EGL_FALSE) checkEGLErrors(); return success != EGL_FALSE; }