Hash :
f0955f15
Author :
Date :
2014-06-20T16:07:07
Update the samples and tests to use eglGetPlatformDisplayEXT. BUG=angle:490 Change-Id: I5a685e42089377b5c600cd1f7ca8bd9a6654b3ba Reviewed-on: https://chromium-review.googlesource.com/204939 Reviewed-by: Brandon Jones <bajones@chromium.org> Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
#include "ANGLETest.h"
#include <windows.h>
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CLOSE:
PostQuitMessage(0);
return 1;
default:
break;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
static const PTCHAR GetTestWindowName()
{
return TEXT("ANGLE_TEST");
}
bool ANGLETest::InitTestWindow()
{
WNDCLASS sWC;
sWC.style = CS_OWNDC;
sWC.lpfnWndProc = WndProc;
sWC.cbClsExtra = 0;
sWC.cbWndExtra = 0;
sWC.hInstance = NULL;
sWC.hIcon = NULL;
sWC.hCursor = LoadCursor(NULL, IDC_ARROW);
sWC.lpszMenuName = NULL;
sWC.hbrBackground = NULL;
sWC.lpszClassName = GetTestWindowName();
if (!RegisterClass(&sWC))
{
return false;
}
mNativeWindow = CreateWindow(GetTestWindowName(), NULL, WS_BORDER, 128, 128, 128, 128, NULL, NULL, NULL, NULL);
SetWindowLong(mNativeWindow, GWL_STYLE, 0);
ShowWindow(mNativeWindow, SW_SHOW);
mNativeDisplay = GetDC(mNativeWindow);
if (!mNativeDisplay)
{
DestroyTestWindow();
return false;
}
return true;
}
bool ANGLETest::DestroyTestWindow()
{
if (mNativeDisplay)
{
ReleaseDC(mNativeWindow, mNativeDisplay);
mNativeDisplay = 0;
}
if (mNativeWindow)
{
DestroyWindow(mNativeWindow);
mNativeWindow = 0;
}
UnregisterClass(GetTestWindowName(), NULL);
return true;
}
bool ANGLETest::ReizeWindow(int width, int height)
{
RECT windowRect;
if (!GetWindowRect(mNativeWindow, &windowRect))
{
return false;
}
if (!MoveWindow(mNativeWindow, windowRect.left, windowRect.top, width, height, FALSE))
{
return false;
}
return true;
}