Advertisement
Guest User

Untitled

a guest
May 9th, 2011
738
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1.  
  2.     EGLint attr[] =
  3.     {
  4.         EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
  5.         EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
  6.         EGL_RED_SIZE, 8,
  7.         EGL_GREEN_SIZE, 8,
  8.         EGL_BLUE_SIZE, 8,
  9.         EGL_NONE
  10.     };
  11.  
  12.     EGLCheck(eglhandle = eglGetDisplay(GetDC(handle)));
  13.     EGLCheck(eglInitialize(eglhandle, NULL, NULL));
  14.  
  15.     EGLConfig eglcfg;
  16.     EGLint dummy;
  17.  
  18.     EGLCheck(eglChooseConfig(eglhandle, attr, &eglcfg, 1, &dummy));
  19.     EGLCheck(surface = eglCreateWindowSurface(eglhandle, eglcfg, handle, NULL));
  20.  
  21.     attr[0] = EGL_CONTEXT_CLIENT_VERSION; attr[1] = 2;
  22.     attr[2] = EGL_NONE;
  23.  
  24.     EGLCheck(ctx = eglCreateContext(eglhandle, eglcfg, EGL_NO_CONTEXT, attr));
  25.     EGLCheck(eglMakeCurrent(eglhandle, surface, surface, ctx));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement