MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / VideoCreateDIBSection

Method VideoCreateDIBSection

source/Windows/Win32Frame.cpp:162–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void 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
192void Win32Frame::Initialize(bool resetVideoState)
193{

Callers

nothing calls this directly

Calls 2

DestroyMethod · 0.45
InitializeMethod · 0.45

Tested by

no test coverage detected