c++sdl

How to get SDL_CreateWindow definition


I was trying to learn SDL2 and was trying to figure out how SDL_CreateWindow was implemented. All I could find out was this

extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title,
                                                      int x, int y, int w,
                                                      int h, Uint32 flags);

and a #define in the code

#define SDL_CreateWindow SDL_CreateWindow_REAL

Is it loaded via a dll or something? Is there a way I can see the definition?

I tried looking around the SDL.sln but didnt get any good matches.


Solution

  • Those *_REAL-suffixed names are an artifact of SDL's dynapi system that lets end-users update the SDL version of programs that statically link against it.

    git grep-ing the source for SDL_CreateWindowTexture should lead you to the actual implementation at src/video/SDL_video.c:221