MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / PreReset

Method PreReset

engine/PoseidonGL33/EngineGL33_Lifecycle.cpp:438–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436void EngineGL33::Restore() {}
437
438void EngineGL33::PreReset(bool hard)
439{
440 FreeAllQueues(_queueNo);
441
442 // Detach engine textures from units 0/1 by re-binding the 1x1 white
443 // sentinel. Binding GL name 0 here would leave the units pointing at
444 // a texture object with no defined base level, which the driver flags
445 // as a KHR_debug LOW warning the moment any draw happens between the
446 // soft Reset and the next SetTexture (id 131204). The sentinel
447 // survives a soft reset and is recreated by InitGL on a hard reset
448 // (PreReset(true) is followed by DestroySurfaces + InitGL).
449 GLuint placeholder = _fallbackWhiteTex ? _fallbackWhiteTex : 0;
450 for (int i = 0; i < 2; i++)
451 {
452 GL33Bind::Tex2D(i, placeholder);
453 }
454 glFlush();
455
456 if (hard)
457 {
458 _textBank->ReleaseAllTextures();
459 DeinitPixelShaders();
460 DeinitVertexShaders();
461 }
462
463 DestroyVB();
464 DestroyVBTL();
465 _lastQueueSource = nullptr;
466}
467
468void EngineGL33::PostReset()
469{

Callers

nothing calls this directly

Calls 2

Tex2DFunction · 0.85
ReleaseAllTexturesMethod · 0.45

Tested by

no test coverage detected