emulator opengl: context version param

add version parameter when creating new context

Change-Id: I3e36796dd4e582b5deda0da2aaf764ceba92a1d1
This commit is contained in:
Jacky Romano
2011-04-23 22:28:23 +03:00
committed by David 'Digit' Turner
parent 0c814b227c
commit 25af30c464
9 changed files with 25 additions and 16 deletions

View File

@@ -17,14 +17,18 @@
#include <stdio.h>
#include <stdlib.h>
RendererContext * RendererContext::create(EGLDisplay dpy, EGLConfig config, RendererContext *shareCtx)
RendererContext * RendererContext::create(EGLDisplay dpy, EGLConfig config, RendererContext *shareCtx, int version)
{
EGLContext ctx;
EGLContext shared = shareCtx == NULL ? EGL_NO_CONTEXT : shareCtx->eglContext();
ctx = eglCreateContext(dpy, config, shared, NULL);
EGLint context_attributes[] = { EGL_CONTEXT_CLIENT_VERSION, 1, EGL_NONE };
context_attributes[1] = version;
ctx = eglCreateContext(dpy, config, shared, context_attributes);
if (eglGetError() != EGL_SUCCESS) return NULL;
return new RendererContext(dpy, ctx);
return new RendererContext(dpy, ctx, version);
}
int RendererContext::destroy()