feat: Testing setup outside i3
This commit is contained in:
23
src/main.cpp
23
src/main.cpp
@@ -15,21 +15,28 @@ static int width, height;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc != 2)
|
||||
if (argc > 2)
|
||||
{
|
||||
printf("Usage: %s <WID>\n", argv[0]);
|
||||
printf("Usage: %s [WID]\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int wid = 0;
|
||||
sscanf(argv[1], "%d", &wid);
|
||||
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
|
||||
SDL_PropertiesID props = SDL_CreateProperties();
|
||||
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER, wid);
|
||||
if (argc == 2)
|
||||
{
|
||||
int wid = 0;
|
||||
sscanf(argv[1], "%d", &wid);
|
||||
|
||||
SDL_PropertiesID props = SDL_CreateProperties();
|
||||
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER, wid);
|
||||
window = SDL_CreateWindowWithProperties(props);
|
||||
}
|
||||
else
|
||||
{
|
||||
window = SDL_CreateWindow("dxdesktop", 1024, 1024, SDL_WINDOW_OPENGL);
|
||||
}
|
||||
|
||||
window = SDL_CreateWindowWithProperties(props);
|
||||
sdl_renderer = SDL_CreateRenderer(window, NULL);
|
||||
|
||||
SDL_GetWindowSize(window, &width, &height);
|
||||
|
||||
Reference in New Issue
Block a user