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
| 165 | them and display via flip. monopage surfaces don't have this luxury. |
| 166 | */ |
| 167 | bool 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. |
no test coverage detected