DEV Community

Discussion on: Using SDL2: Optimizing Surface Blitting

Collapse
 
bushstar profile image
Peter John Bushnell

Some corrections, IMG_INIT_JPEG should be IMG_INIT_JPG and there's an extra parenthesis. The below replacement code has been updated.

int flags = IMG_INIT_PNG | IMG_INIT_JPG;
int initiated_flags = IMG_Init(flags);

if ((initiated_flags & flags) != flags)
{
     std::cout << "Failed to initialize all image loaders\n";
     std::cout << "IMG Error: " << IMG_GetError() << "\n";
}
Enter fullscreen mode Exit fullscreen mode