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

Method CreateGPUSurface

engine/PoseidonGL33/TextureBankGL33_Core.cpp:438–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436}
437
438int TextBankGL33::CreateGPUSurface(SurfaceInfoGL33& surface, const TextureDescGL33& desc, PacFormat format,
439 int totalSize)
440{
441 int ret = surface.CreateSurface(desc, format, totalSize);
442 if (ret < 0)
443 {
444 LOG_DEBUG(Graphics, "GL33: CreateGPUSurface failed, trying ForcedReserveMemory");
445 ForcedReserveMemory(totalSize);
446 ret = surface.CreateSurface(desc, format, totalSize);
447 if (ret < 0)
448 {
449 Poseidon::Foundation::ErrorMessage("GL33: Cannot create texture (%dx%d)", desc.w, desc.h);
450 return -1;
451 }
452 }
453 _totalAllocated += surface.SizeUsed();
454 return 0;
455}
456
457Texture* TextBankGL33::CreateDynamic(int w, int h, const void* rgba, uint32_t size, bool mipmap)
458{

Callers 2

LoadLevelsMethod · 0.80
LoadSmallMethod · 0.80

Calls 2

ErrorMessageFunction · 0.85
SizeUsedMethod · 0.80

Tested by

no test coverage detected