Skip to content

Instantly share code, notes, and snippets.

@yashi
Last active August 29, 2015 14:05
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 yashi/2822dea05e0730a1965b to your computer and use it in GitHub Desktop.
Save yashi/2822dea05e0730a1965b to your computer and use it in GitHub Desktop.
#include <SDL.h>
int main()
{
int ret;
SDL_Window *w1, *w2;
Uint32 flags = SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN;
int i, j;
ret = SDL_Init(SDL_INIT_VIDEO);
w1 = SDL_CreateWindow("my title", 100, 200, 100, 100, flags);
i = SDL_GetWindowDisplayIndex(w1);
SDL_Log("index: %d\n", i);
SDL_Quit();
ret = SDL_Init(SDL_INIT_VIDEO);
w2 = SDL_CreateWindow("my title2", 100, 200, 100, 100, flags);
j = SDL_GetWindowDisplayIndex(w2);
SDL_Log("w2 index: %d\n", j);
i = SDL_GetWindowDisplayIndex(w1);
SDL_Log("w1 index: %d\n", i);
SDL_Quit();
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment