ref: db3e69fcd0fbb4939f7d9dd1c43e070f7982cae2
parent: e917e944d5ce94e6498235194e9e4d75a0f0675f
author: David <gek@katherine>
date: Fri Feb 12 07:47:08 EST 2021
Sample program Update
--- a/src/SDL_Examples/gears.c
+++ b/src/SDL_Examples/gears.c
@@ -216,6 +216,17 @@
// initialize SDL video:
int winSizeX=640;
int winSizeY=480;
+
+ if(argc > 2){
+ char* larg = argv[1];
+ for(int i = 0; i < argc; i++){
+ if(!strcmp(larg,"-w"))
+ winSizeX = atoi(argv[i]);
+ if(!strcmp(larg,"-h"))
+ winSizeY = atoi(argv[i]);
+ larg = argv[i];
+ }
+ }
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)<0) {
fprintf(stderr,"ERROR: cannot initialize SDL video.\n");
return 1;