diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-06-12 10:48:36 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-06-12 12:12:20 -0700 |
| commit | 5fe2cf3279c279750d4821a9fa97bdbbe876e568 (patch) | |
| tree | b929d3d7f77da2ba538846f598e7eeb0a302b0cc /tools/render-test/main.cpp | |
| parent | 4d63b6fe73018ae253bbef0075478f5989ad279a (diff) | |
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.
Diffstat (limited to 'tools/render-test/main.cpp')
| -rw-r--r-- | tools/render-test/main.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
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); |
