retrieves a pointer to surface memory. allowed to lock one surface multiple times. ptr is the returned pointer to surface memory. used to unlock surface also rowsize is the size in bytes of one row of memory. */
| 97 | rowsize is the size in bytes of one row of memory. |
| 98 | */ |
| 99 | bool ddgr_surf_Lock(ddgr_surface *sf, void **ptr, int *rowsize) { |
| 100 | bool success; |
| 101 | |
| 102 | switch (LIB_DATA(subsystem)) { |
| 103 | case DDGR_GDIX_SUBSYSTEM: |
| 104 | case DDGR_GDI_SUBSYSTEM: |
| 105 | success = ddgr_gdi_surf_Lock(sf, ptr, rowsize); |
| 106 | break; |
| 107 | case DDGR_DX_SUBSYSTEM: |
| 108 | success = ddgr_dx_surf_Lock(sf, ptr, rowsize); |
| 109 | break; |
| 110 | default: |
| 111 | Int3(); |
| 112 | } |
| 113 | |
| 114 | if (!success) { |
| 115 | ddgr_FatalError("Failed to lock surface <%s>", sf->name); |
| 116 | } |
| 117 | |
| 118 | return success; |
| 119 | } |
| 120 | |
| 121 | bool ddgr_surf_Unlock(ddgr_surface *sf, void *ptr) { |
| 122 | bool success; |
no test coverage detected