Compiler doesn't return missing SDL.h, but rather that SDL_DisplayFormat is not declared in scope of a class member function located on a different header even though I have it initialized in main.
SDL_Surface *SpriteLoad::Load(char *File)
{
SDL_Surface *temp = NULL;
SDL_Surface *opt = NULL;
if ((temp = IMG_Load(File)) == NULL)
{
return NULL;
}
opt = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
return opt;
}
Where my main inits SDL through a class and member function:
int main (int args, char *argc[])
{
bool quit = false;
OnRun Game; // Class that init's SDL
Window TestWin;
GlobalTimer fps;
TestWin.Debug();
I'm able to create a window using SDL_Window using that Class and also use SDL_GetTick.
EDIT: Headers used for Sprite::Load are currently SDL, SDL_image, SDL_ttf, and SDL_mixer pulled and built from the mercurial repo. I do not think it's a linking error though
The reason you're getting that compiler error is because SDL_DisplayFormat
no longer exist in SDL-2.0.
After looking at the SDL wiki doc it appears SDL_DisplayFormat
from SDL-1.2 has been replaced by SDL_ConvertSurfaceFormat
in SDL-2.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With