MCPcopy Create free account
hub / github.com/WheretIB/nullc / WindowDrawCanvas

Function WindowDrawCanvas

NULLC/includes/window.cpp:48–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 }
47
48 void WindowDrawCanvas(NULLCCanvas::Canvas* c, int x, int y, Window* wnd)
49 {
50 NULLCCanvas::CanvasCommit(c);
51 PAINTSTRUCT ps;
52 BeginPaint(wnd->handle, &ps);
53 HDC dc = GetDC(wnd->handle);
54
55 BITMAPINFO bi;
56 memset(&bi, 0, sizeof(bi));
57 bi.bmiHeader.biSize = sizeof(bi);
58 bi.bmiHeader.biWidth = c->width;
59 bi.bmiHeader.biHeight = -c->height;
60 bi.bmiHeader.biPlanes = 1;
61 bi.bmiHeader.biBitCount = 32;
62 bi.bmiHeader.biCompression = BI_RGB;
63 bi.bmiHeader.biSizeImage;
64 bi.bmiHeader.biXPelsPerMeter;
65 bi.bmiHeader.biYPelsPerMeter;
66 bi.bmiHeader.biClrUsed;
67 bi.bmiHeader.biClrImportant;
68
69 SetDIBitsToDevice(dc, x, y, c->width, c->height, 0, 0, 0, c->height, c->dataI.ptr, &bi, DIB_RGB_COLORS);
70
71 ReleaseDC(wnd->handle, dc);
72 EndPaint(wnd->handle, &ps);
73 }
74
75 void WindowUpdate(Window* wnd)
76 {

Callers

nothing calls this directly

Calls 1

CanvasCommitFunction · 0.85

Tested by

no test coverage detected