Exemplo n.º 1
0
bool NativeEngine::HandleEglError(EGLint error) {
    switch (error) {
        case EGL_SUCCESS:
            // nothing to do
            return true;
        case EGL_CONTEXT_LOST:
            LOGW("NativeEngine: egl error: EGL_CONTEXT_LOST. Recreating context.");
            KillContext();
            return true;
        case EGL_BAD_CONTEXT:
            LOGW("NativeEngine: egl error: EGL_BAD_CONTEXT. Recreating context.");
            KillContext();
            return true;
        case EGL_BAD_DISPLAY:
            LOGW("NativeEngine: egl error: EGL_BAD_DISPLAY. Recreating display.");
            KillDisplay();
            return true;
        case EGL_BAD_SURFACE:
            LOGW("NativeEngine: egl error: EGL_BAD_SURFACE. Recreating display.");
            KillSurface();
            return true;
        default:
            LOGW("NativeEngine: unknown egl error: %d", error);
            return false;
    }
}
Exemplo n.º 2
0
bool InitDisplay(int width, int height, int depth) {
  if (!Display) {
    size_t i, j;

    Display = NewRecord(DisplayT);

    for (i = 0; i < 2; i++)
      Display->Bitmap[i] = AllocBitMap(width, height, depth,
                                       BMF_DISPLAYABLE|BMF_CLEAR, NULL);

    Display->Palette = NewRecord(ScreenPaletteT);
    Display->Palette->Count = 256;

    for (i = 0, j = 0; i < 256; i++) {
      Display->Palette->Colors[j++] = i << 24;
      Display->Palette->Colors[j++] = i << 24;
      Display->Palette->Colors[j++] = i << 24;
    }

    ScreenTags[0].ti_Data = width;
    ScreenTags[1].ti_Data = height;
    ScreenTags[2].ti_Data = depth;
    ScreenTags[3].ti_Data = (ULONG)Display->Bitmap[0];
    ScreenTags[4].ti_Data = (ULONG)Display->Palette;

    if ((Display->Screen = OpenScreenTagList(0L, ScreenTags))) {
      return TRUE;
    } else {
      KillDisplay();
    }
  }

  return FALSE;
}
Exemplo n.º 3
0
static void Kill() {
  KillDisplay();

  MemUnref(canvas);
  MemUnref(map[0]);
  MemUnref(map[1]);
  MemUnref(shade);
}
Exemplo n.º 4
0
static void Kill() {
  KillDisplay();

  MemUnref(origU);
  MemUnref(origU);
  MemUnref(flare);
  MemUnref(uvmap);
  MemUnref(canvas);
}
Exemplo n.º 5
0
static void Kill() {
  KillDisplay();

  MemUnref(uvmap);
  MemUnref(shades);
  MemUnref(canvas);
  MemUnref(scene);
  MemUnref(orig);
}
Exemplo n.º 6
0
static void Kill() {
  KillDisplay();

  MemUnref(canvas);
  MemUnref(uvmap);
  MemUnref(shades);
  MemUnref(smallMap);
  MemUnref(lightFunc);
}
Exemplo n.º 7
0
static void Kill() {
  KillDisplay();
  
  MemUnref(canvas);
  MemUnref(shades);
  MemUnref(uvmap);
  MemUnref(component);
  MemUnref(colorFunc);
}
Exemplo n.º 8
0
static void Kill() {
  KillDisplay();

  MemUnref(canvas);
  MemUnref(buffer);
}
Exemplo n.º 9
0
static void Kill() {
  KillDisplay();

  MemUnref(uvmap);
  MemUnref(canvas);
}