| 160 | } |
| 161 | |
| 162 | void Win32Frame::VideoCreateDIBSection(bool resetVideoState) |
| 163 | { |
| 164 | // CREATE THE DEVICE CONTEXT |
| 165 | HWND window = GetDesktopWindow(); |
| 166 | HDC dc = GetDC(window); |
| 167 | if (g_hDeviceDC) |
| 168 | { |
| 169 | DeleteDC(g_hDeviceDC); |
| 170 | } |
| 171 | g_hDeviceDC = CreateCompatibleDC(dc); |
| 172 | |
| 173 | // CREATE THE FRAME BUFFER DIB SECTION |
| 174 | if (g_hDeviceBitmap) |
| 175 | { |
| 176 | DeleteObject(g_hDeviceBitmap); |
| 177 | GetVideo().Destroy(); |
| 178 | } |
| 179 | |
| 180 | uint8_t* pFramebufferbits; |
| 181 | |
| 182 | g_hDeviceBitmap = CreateDIBSection( |
| 183 | dc, |
| 184 | g_pFramebufferinfo, |
| 185 | DIB_RGB_COLORS, |
| 186 | (LPVOID*)&pFramebufferbits, 0, 0 |
| 187 | ); |
| 188 | SelectObject(g_hDeviceDC, g_hDeviceBitmap); |
| 189 | GetVideo().Initialize(pFramebufferbits, resetVideoState); |
| 190 | } |
| 191 | |
| 192 | void Win32Frame::Initialize(bool resetVideoState) |
| 193 | { |
nothing calls this directly
no test coverage detected