From d06559227bc6071c96572334d2a2e3f6eb4de96d Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 27 Mar 2014 17:21:13 +0100 Subject: 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 --- emulator/opengl/host/libs/Translator/EGL/EglWindowsApi.cpp | 4 ++-- 1 file 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); -- cgit v1.1