Skip to content

Instantly share code, notes, and snippets.

@sewbacca
Last active May 22, 2021 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sewbacca/79a84414e73848dc1e931051643f752a to your computer and use it in GitHub Desktop.
Save sewbacca/79a84414e73848dc1e931051643f752a to your computer and use it in GitHub Desktop.
Printing Invalid window ID
#include <SDL2/SDL.h>
#include <unistd.h>
int main(int argc, char const *argv[])
{
uint32_t nix = 0;
auto win = SDL_CreateWindow("Test", 0, 0, 400, 200, nix);
SDL_RaiseWindow(win);
printf("ID: %i\n", SDL_GetWindowID(win));
while (1) { usleep(100000); }
return 0;
}
@sewbacca
Copy link
Author

Run with:

g++ -o test main.cpp -lSDL2 && ./test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment