From 608744a1aea149a83d201e21f07b83eeb213b17a Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Tue, 31 Oct 2017 12:52:39 -0400 Subject: [PATCH] win32_4ed.cpp changes? --- platform_win32/win32_4ed.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform_win32/win32_4ed.cpp b/platform_win32/win32_4ed.cpp index f8a94740..af3b5215 100644 --- a/platform_win32/win32_4ed.cpp +++ b/platform_win32/win32_4ed.cpp @@ -206,8 +206,8 @@ internal void win32_toggle_fullscreen(){ HWND win = win32vars.window_handle; DWORD style = GetWindowLongW(win, GWL_STYLE); - b32 is_full = ((style & WS_OVERLAPPEDWINDOW) != 0); - if (is_full){ + b32 is_full = ((style & WS_OVERLAPPEDWINDOW) == 0); + if (!is_full){ MONITORINFO info = {sizeof(MONITORINFO)}; if (GetWindowPlacement(win, &win32vars.bordered_win_pos) && GetMonitorInfo(MonitorFromWindow(win, MONITOR_DEFAULTTOPRIMARY), &info)){ SetWindowLongW(win, GWL_STYLE, style & ~WS_OVERLAPPEDWINDOW); @@ -703,6 +703,8 @@ Win32InitGL(){ } } + ReleaseDC(win32vars.window_handle, dc); + #if (defined(BUILD_X64) && 1) || (defined(BUILD_X86) && 0) #if defined(FRED_INTERNAL) // NOTE(casey): This slows down GL but puts error messages to @@ -721,8 +723,6 @@ Win32InitGL(){ #endif #endif - ReleaseDC(win32vars.window_handle, dc); - glEnable(GL_TEXTURE_2D); glEnable(GL_SCISSOR_TEST); glEnable(GL_BLEND);