MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ddgr_surf_InitVideo

Function ddgr_surf_InitVideo

dd_grwin32/ddgrWin32API.cpp:167–189  ·  view source on GitHub ↗

initializes a video screen from the given input surface which specifies the dimensions of the screen. sf->name is optional sf->w, sf->h are mandatory sf->bpp is recommended. if set to BPP_DEFAULT, it uses the current display bit depth sf->type = SURFTYPE_VIDEOSCREEN sf->flags = 0 or SURFFLAG_BACKBUFFER. surfa

Source from the content-addressed store, hash-verified

165 them and display via flip. monopage surfaces don't have this luxury.
166*/
167bool ddgr_surf_InitVideo(ddgr_surface *sf) {
168 bool success;
169
170 ASSERT(sf->type == SURFTYPE_VIDEOSCREEN);
171
172 switch (LIB_DATA(subsystem)) {
173 case DDGR_GDIX_SUBSYSTEM:
174 case DDGR_GDI_SUBSYSTEM:
175 success = ddgr_gdi_surf_InitVideo(sf);
176 break;
177 case DDGR_DX_SUBSYSTEM:
178 success = ddgr_dx_surf_InitVideo(sf);
179 break;
180 default:
181 Int3();
182 }
183
184 if (!success) {
185 ddgr_FatalError("Failed to initialize video screen <%s>", sf->name);
186 }
187
188 return success;
189}
190
191/* close video reverses the operation of init video for that surface. the display should stay
192 the same, but no more operations may occur to that surface through this library.

Callers 1

createMethod · 0.85

Calls 3

ddgr_gdi_surf_InitVideoFunction · 0.85
ddgr_dx_surf_InitVideoFunction · 0.85
ddgr_FatalErrorFunction · 0.85

Tested by

no test coverage detected