]> granicus.if.org Git - graphviz/commitdiff
smyrna: propagate and remove 'fullscreen' parameter to 'cb_glutinit'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 6 May 2022 00:48:53 +0000 (17:48 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 4 Jun 2022 16:21:54 +0000 (09:21 -0700)
This function did not properly support non-fullscreen mode, as evidenced by the
`x` and `y` parameters (removed in the previous commit) that it was ignoring.

cmd/smyrna/glutrender.c
cmd/smyrna/glutrender.h
cmd/smyrna/main.c

index 71da494cf4003feb85c17468862174af80e73de7..bf21e37ee33b3cad18ec40d007a9c58f099e1518 100644 (file)
@@ -223,21 +223,11 @@ static int cb_game_mode(char* optArg)
        graphviz_exit(-1);
 
     }
-
-}
-static int cb_windowed_mode(int w,int h)
-{
-  glutInitWindowSize(w, h);
-  glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_ACCUM | GLUT_DOUBLE);
-  glutCreateWindow("smyrna");
-  return 1;
-    
 }
 
-int cb_glutinit(int w, int h, int fullscreen, int *argcp, char *argv[], char *optArg) {
+int cb_glutinit(int w, int h, int *argcp, char *argv[], char *optArg) {
     /*
     w,h: width and height of the window in pixels
-    fullscreen: if it will be a fullscreen window,
     argcp argv: main function's parameters, required for glutinit
     */
 
@@ -254,13 +244,7 @@ int cb_glutinit(int w, int h, int fullscreen, int *argcp, char *argv[], char *op
        glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);      // Really Nice Perspective Calculations
 
 
-    if (fullscreen)
-       cb_game_mode(optArg);
-    else    //well, use gtk then
-    {  
-       cb_windowed_mode(w,h);
-
-    }
+    cb_game_mode(optArg);
 
     /*register callbacks here*/
     glutDisplayFunc(cb_display);
index 90b307abb10b0cf4192def9a1e5d5250a233c8f1..ff2890b4a4bc737f326a579f053df10363c8a711 100644 (file)
@@ -1,3 +1,3 @@
 #pragma once
 
-int cb_glutinit(int w, int h, int fullscreen, int *argcp, char *argv[], char *optArg);
+int cb_glutinit(int w, int h, int *argcp, char *argv[], char *optArg);
index 382c12ad074fe5fdc0fc8dbc2c063d0a43745232..e1c3b0775661b522c1201634998eecc6f1ba092b 100644 (file)
@@ -243,7 +243,7 @@ int main(int argc, char *argv[])
        view->initFile=1;
 
     if(view->guiMode==GUI_FULLSCREEN)
-       cb_glutinit(800, 600, 1, &argc, argv, view->optArg);
+       cb_glutinit(800, 600, &argc, argv, view->optArg);
     else
        windowedMode(argc, argv);
 #ifdef G_OS_WIN32