From 65db6cb1ac39ef4f1ba3b7e081fc3121fb14e306 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 5 May 2022 17:48:53 -0700 Subject: [PATCH] smyrna: propagate and remove 'fullscreen' parameter to 'cb_glutinit' 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 | 20 ++------------------ cmd/smyrna/glutrender.h | 2 +- cmd/smyrna/main.c | 2 +- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/cmd/smyrna/glutrender.c b/cmd/smyrna/glutrender.c index 71da494cf..bf21e37ee 100644 --- a/cmd/smyrna/glutrender.c +++ b/cmd/smyrna/glutrender.c @@ -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); diff --git a/cmd/smyrna/glutrender.h b/cmd/smyrna/glutrender.h index 90b307abb..ff2890b4a 100644 --- a/cmd/smyrna/glutrender.h +++ b/cmd/smyrna/glutrender.h @@ -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); diff --git a/cmd/smyrna/main.c b/cmd/smyrna/main.c index 382c12ad0..e1c3b0775 100644 --- a/cmd/smyrna/main.c +++ b/cmd/smyrna/main.c @@ -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 -- 2.40.0