diff options
author | David 'Digit' Turner <digit@google.com> | 2014-03-27 17:21:13 +0100 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2014-04-01 10:22:22 +0200 |
commit | d06559227bc6071c96572334d2a2e3f6eb4de96d (patch) | |
tree | 99407a4f71fa2ad3c05e37562a883ec08c3ad371 | |
parent | f652f506734ff36069f5100766d557cd9b82d29e (diff) | |
download | sdk-d06559227bc6071c96572334d2a2e3f6eb4de96d.zip sdk-d06559227bc6071c96572334d2a2e3f6eb4de96d.tar.gz sdk-d06559227bc6071c96572334d2a2e3f6eb4de96d.tar.bz2 |
emulator/opengl: Fix Windows EGL queryConfigs().
The function uses DescribePixelFormat() which doesn't return a
count, but a maximum index, in a base-1 list of possible formats,
so adjust the code accordingly.
See http://msdn.microsoft.com/en-us/library/windows/desktop/dd318302(v=vs.85).aspx
Change-Id: Id0cc92249348e6c845570adaaf4c280721a194bb
-rw-r--r-- | emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp b/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp index 460c0b6..5628165 100644 --- a/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp +++ b/emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp @@ -416,10 +416,10 @@ void queryConfigs(EGLNativeInternalDisplayType display,int renderableType,Config initPixelFormat(dpy); //quering num of formats - int nFormats = DescribePixelFormat(dpy, iPixelFormat,sizeof(PIXELFORMATDESCRIPTOR), &pfd); + int maxFormat = DescribePixelFormat(dpy, iPixelFormat,sizeof(PIXELFORMATDESCRIPTOR), &pfd); //inserting rest of formats - for(iPixelFormat;iPixelFormat < nFormats; iPixelFormat++) { + for(;iPixelFormat <= maxFormat; iPixelFormat++) { DescribePixelFormat(dpy, iPixelFormat,sizeof(PIXELFORMATDESCRIPTOR), &pfd); EglConfig* pConfig = pixelFormatToConfig(display,renderableType,&pfd,iPixelFormat); if(pConfig) listOut.push_back(pConfig); |