MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / clearFB

Function clearFB

util/fbxtest.cpp:114–138  ·  view source on GitHub ↗

Makes sure the frame buffer has been cleared prior to a write

Source from the content-addressed store, hash-verified

112
113// Makes sure the frame buffer has been cleared prior to a write
114void clearFB(void)
115{
116 #ifdef _WIN32
117
118 if(wh)
119 {
120 HDC hdc = 0; RECT rect;
121 TRY_W32(hdc = GetDC(wh));
122 TRY_W32(GetClientRect(wh, &rect));
123 TRY_W32(PatBlt(hdc, 0, 0, rect.right, rect.bottom, BLACKNESS));
124 TRY_W32(ReleaseDC(wh, hdc));
125 }
126
127 #else
128
129 if(wh.dpy && wh.d && !doPixmap)
130 {
131 XSetWindowBackground(wh.dpy, wh.d,
132 BlackPixel(wh.dpy, DefaultScreen(wh.dpy)));
133 XClearWindow(wh.dpy, wh.d);
134 XSync(wh.dpy, False);
135 }
136
137 #endif
138}
139
140
141// Platform-specific write test

Callers 2

nativeWriteFunction · 0.70
nativeStressFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected