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

Function ddgr_surf_Lock

dd_grwin32/ddgrWin32API.cpp:99–119  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

97 rowsize is the size in bytes of one row of memory.
98*/
99bool 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
121bool ddgr_surf_Unlock(ddgr_surface *sf, void *ptr) {
122 bool success;

Callers 1

lockMethod · 0.85

Calls 3

ddgr_gdi_surf_LockFunction · 0.85
ddgr_dx_surf_LockFunction · 0.85
ddgr_FatalErrorFunction · 0.85

Tested by

no test coverage detected