The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Double clicking the icon to run SDL program.
bilsch01


Joined: 26 Feb 2015
Posts: 55
Location: Seattle, WA, USA
I wrote a C program that draws Lissajous patterns (periodic graphs) using sine functions and exponential functions. There are many parameters that affect the display of these graphs. The program uses SDL for plotting the points of the graph. There is 'front end' C code that allows user to set these parameters using scanf statements. This front end should query the user any time the program is started - indeed it does when the program is started from the command line. I have an icon on my Ubuntu desktop that starts the program when you double click the icon - however when you do it that way none of the user querys are executed. The
program simply runs using the values initialized when the variables were declared. This behavior is a mystery to me. How does it skip over the front end code? I have another simpler program structured the same way also using SDL and it has the same behavior when started by double clicking the icon. I asked this question in a C programming group and they suggested I ask SDL people about it.

TIA. Bill S.
Double clicking the icon to run SDL program.
Jonny D


Joined: 12 Sep 2009
Posts: 932
Could you show us the code (a minimal case is ideal)?  If it is getting "skipped", then there's probably something in the code that isn't doing what you expect.

Jonny D


On Sat, Mar 28, 2015 at 7:55 AM, bilsch01 wrote:
Quote:
I wrote a C program that draws Lissajous patterns (periodic graphs) using sine functions and exponential functions. There are many parameters that affect the display of these graphs. The program uses SDL for plotting the points of the graph. There is 'front end' C code that allows user to set these parameters using scanf statements. This front end should query the user any time the program is started - indeed it does when the program is started from the command line. I have an icon on my Ubuntu desktop that starts the program when you double click the icon - however when you do it that way none of the user querys are executed. The
program simply runs using the values initialized when the variables were declared. This behavior is a mystery to me. How does it skip over the front end code? I have another simpler program structured the same way also using SDL and it has the same behavior when started by double clicking the icon. I asked this question in a C programming group and they suggested I ask SDL people about it.

TIA. Bill S.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: Double clicking the icon to run SDL program.
bilsch01


Joined: 26 Feb 2015
Posts: 55
Location: Seattle, WA, USA
[quote="Jonny D"]Could you show us the code (a minimal case is ideal)?  If it is getting "skipped", then there's probably something in the code that isn't doing what you expect.

People are telling me this question is not apropos to SDL. Please disregard the question.
Double clicking the icon to run SDL program.
Ryan C. Gordon
Guest

Quote:
I have an icon on my Ubuntu desktop that starts the program when you double click the icon - however when you do it that way none of the user querys are executed. The
program simply runs using the values initialized when the variables were declared

Since there's no terminal when launched from an icon, maybe scanf() is returning immediately (stdin is at EOF) so the code is going with the values in those variables by default.

--ryan.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Double clicking the icon to run SDL program.
Jared Maddox
Guest

Quote:
Date: Sat, 28 Mar 2015 17:14:31 +0000
From: "bilsch01"
To:
Subject: Re: [SDL] Double clicking the icon to run SDL program.
Message-ID:
Content-Type: text/plain; charset="iso-8859-1"

[quote="Jonny D"]Could you show us the code (a minimal case is ideal)??? If it is getting "skipped", then there's probably something in the code that isn't doing what you expect.

People are telling me this question is not apropos to SDL. Please disregard the question.


Please check to make certain that it has nothing to do with SDL. It's
probably something in the C library itself detecting the absence of a
console, but if SDL is setting C library runtime option then we want
to know.

A simple program to write data to a file should be fine: one
compilation that doesn't even link to SDL, one that links but doesn't
initialize, and one that displays a blank window would hopefully catch
all of the major corner cases. You should be able to fit it into a
single file pretty easily.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org