From 5fe2cf3279c279750d4821a9fa97bdbbe876e568 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 12 Jun 2017 10:48:36 -0700 Subject: GLSL: get GLSL limping in `render-test` The test case that is there right now is nominally a cross-compilation test, but for right now it uses the preprocessor to present completely different code for HLSL and GLSL compilation. This change is really just fleshing out the OpenGL side of `render-test` enough that it can produce images using OpenGL to enable further testing. --- tools/render-test/main.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'tools/render-test/main.cpp') diff --git a/tools/render-test/main.cpp b/tools/render-test/main.cpp index e444a8387..2746c505d 100644 --- a/tools/render-test/main.cpp +++ b/tools/render-test/main.cpp @@ -262,16 +262,26 @@ int main( // Next, we create a window using that window class. + // We will create a borderless window since our screen-capture logic in GL + // seems to get thrown off by having to deal with a window frame. + DWORD windowStyle = WS_POPUP; DWORD windowExtendedStyle = 0; - DWORD windowStyle = 0; - LPWSTR windowName = L"Slang Hello World"; + + + RECT windowRect = { 0, 0, gWindowWidth, gWindowHeight }; + AdjustWindowRectEx(&windowRect, windowStyle, /*hasMenu=*/false, windowExtendedStyle); + + auto width = windowRect.right - windowRect.left; + auto height = windowRect.bottom - windowRect.top; + + LPWSTR windowName = L"Slang Render Test"; HWND windowHandle = CreateWindowExW( windowExtendedStyle, (LPWSTR)windowClassAtom, windowName, windowStyle, 0, 0, // x, y - gWindowWidth, gWindowHeight, + width, height, NULL, // parent NULL, // menu instance, @@ -291,6 +301,7 @@ int main( renderer = createD3D11Renderer(); break; + case Mode::GLSL: case Mode::GLSLCrossCompile: renderer = createGLRenderer(); break; @@ -349,6 +360,8 @@ int main( // Whenver we don't have Windows events to process, // we render a frame. + static const float kClearColor[] = { 0.25, 0.25, 0.25, 1.0 }; + renderer->setClearColor(kClearColor); renderer->clearFrame(); renderFrameInner(renderer); -- cgit v1.2.3