NO animation

Hi,

Just modified linux code to win32/SDL and when I
compile it, there’s no indication of an error. But,
when i try to run it nothing happens, not evening a
brief showing of the screen. I also modified the code
to use bmps instead of png and removed the SDLimage.
I’ve compared the code with another program that works
and couldn’t find anything that could cause the prob.

Any suggestions?

Thanks

Richard__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

Hi.
What compiler do you use?
Also try following the first SDL tutorial on http://cone3d.gamedev.net

Marius> Hi,

Just modified linux code to win32/SDL and when I
compile it, there’s no indication of an error. But,
when i try to run it nothing happens, not evening a
brief showing of the screen. I also modified the code
to use bmps instead of png and removed the SDLimage.
I’ve compared the code with another program that works
and couldn’t find anything that could cause the prob.

Any suggestions?

Thanks

Richard

Hi,

I use VC++6.0. I’ve been using it for a while and
other SDL programs work ok.

Richard

— Marius Andra wrote:> Hi.

What compiler do you use?
Also try following the first SDL tutorial on
http://cone3d.gamedev.net

Marius

Hi,

Just modified linux code to win32/SDL and when I
compile it, there’s no indication of an error.
But,
when i try to run it nothing happens, not evening
a
brief showing of the screen. I also modified the
code
to use bmps instead of png and removed the
SDLimage.
I’ve compared the code with another program that
works
and couldn’t find anything that could cause the
prob.

Any suggestions?

Thanks

Richard


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

Does it generate stderr.txt or stdout.txt? (That’s where the standard I/O
is redirected on some platforms.)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Wednesday 03 April 2002 21:19, Richard Perrine wrote:

Hi,

Just modified linux code to win32/SDL and when I
compile it, there’s no indication of an error. But,
when i try to run it nothing happens, not evening a
brief showing of the screen. I also modified the code
to use bmps instead of png and removed the SDLimage.
I’ve compared the code with another program that works
and couldn’t find anything that could cause the prob.

— David Olofson <david.olofson at reologica.se> wrote:> On Wednesday 03 April 2002 21:19, Richard Perrine wrote:

Hi,

Just modified linux code to win32/SDL and when I
compile it, there’s no indication of an error.
But,
when i try to run it nothing happens, not evening
a
brief showing of the screen. I also modified the
code
to use bmps instead of png and removed the
SDLimage.
I’ve compared the code with another program that
works
and couldn’t find anything that could cause the
prob.

Does it generate stderr.txt or stdout.txt? (That’s
where the standard I/O
is redirected on some platforms.)

//David Olofson — Programmer, Reologica
Instruments AB

.- M A I A
-------------------------------------------------.
| Multimedia Application Integration
Architecture |
| A Free/Open Source Plugin API for Professional
Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter | ------------------------------------->
http://olofson.net -’


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
Yes!

Richard


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

hmm. then I can only guess that the problem is somewhere within your
program. Check that all the data files are in the same directory and can be
accessed by the program.

Marius> Hi,

I use VC++6.0. I’ve been using it for a while and
other SDL programs work ok.

Richard

— Marius Andra <@Marius_Andra> wrote:

Hi.
What compiler do you use?
Also try following the first SDL tutorial on
http://cone3d.gamedev.net

Marius

Hi,

Just modified linux code to win32/SDL and when I
compile it, there’s no indication of an error.
But,
when i try to run it nothing happens, not evening
a
brief showing of the screen. I also modified the
code
to use bmps instead of png and removed the
SDLimage.
I’ve compared the code with another program that
works
and couldn’t find anything that could cause the
prob.

Any suggestions?

Thanks

Richard


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

[…]

Does it generate stderr.txt or stdout.txt? (That’s
where the standard I/O
is redirected on some platforms.)
[…]
Yes!

Well… Were there any hints in there? :slight_smile:

(It’s kind of nice to have development versions output tons of diagnostic
messages while loading, converting etc. In fact, it’s probably a good
idea to keep that in “production” versions as well, just in case…)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Wednesday 03 April 2002 22:47, Richard Perrine wrote:

Sorry about that.

there are stderr.tx in the program.

Richard

— David Olofson <david.olofson at reologica.se> wrote:> On Wednesday 03 April 2002 22:47, Richard Perrine wrote:

[…]

Does it generate stderr.txt or stdout.txt?
(That’s

where the standard I/O
is redirected on some platforms.)
[…]
Yes!

Well… Were there any hints in there? :slight_smile:

(It’s kind of nice to have development versions
output tons of diagnostic
messages while loading, converting etc. In fact,
it’s probably a good
idea to keep that in “production” versions as well,
just in case…)

//David Olofson — Programmer, Reologica
Instruments AB

.- M A I A
-------------------------------------------------.
| Multimedia Application Integration
Architecture |
| A Free/Open Source Plugin API for Professional
Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter | ------------------------------------->
http://olofson.net -’


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

Not quite sure about previous message. So, should i
remove the stderr.txts for it to execute?

Richard

— David Olofson <david.olofson at reologica.se> wrote:> On Wednesday 03 April 2002 22:47, Richard Perrine wrote:

[…]

Does it generate stderr.txt or stdout.txt?
(That’s

where the standard I/O
is redirected on some platforms.)
[…]
Yes!

Well… Were there any hints in there? :slight_smile:

(It’s kind of nice to have development versions
output tons of diagnostic
messages while loading, converting etc. In fact,
it’s probably a good
idea to keep that in “production” versions as well,
just in case…)

//David Olofson — Programmer, Reologica
Instruments AB

.- M A I A
-------------------------------------------------.
| Multimedia Application Integration
Architecture |
| A Free/Open Source Plugin API for Professional
Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter | ------------------------------------->
http://olofson.net -’


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

No, SDL should just overwrite them as needed - but provided you print
something (like “Loading images…”, “Done.” etc) to stdout or stderr
(printf(…) or fprintf(stderr, …), you’ll find it in the respective
file.

Here are some things to look for in general, when something compiles but
just “refuses to start” on a new platform:

* Are you using the right file patch format? (Should
  be ok in your case - Windows supports '/' as well.)

* Are file names in the right case? (Shouldn't be an
  issue when moving *to* Windows...)

* Are you assuming something about the screen? (Like
  always getting a s/w shadow surface, which is *not*
  what you get with DirectX/fullscreen.)

* Are you relying on something that might be broken
  or "dummy" on some platforms? (Check your own #ifdefs
  first, if any! :-)

Finally, and perhaps most obvious; the program working with one compiler

  • platform doesn’t guarantee anything! It might just segfault instantly
    and concistently on some other platform - and it’s nearly always because
    of a bug in your code. (The reason why it doesn’t crash on some platforms
    is usually just that alignment and memory manager behavior by coincidence
    "saves" your code.)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Wednesday 03 April 2002 23:41, Richard Perrine wrote:

Not quite sure about previous message. So, should i
remove the stderr.txts for it to execute?

Hi all.

Discovered the lines of code that seems to be causing the prob!

snprintf(filename, sizeof(filename), “pic%d.bmp”, i);
animation[i] = SDL_LoadBMP(filename);

When I enter an actual name of a bmp for pic%d.bmp it works. At least i get an image on a screen. It has something to do with the ‘snprintf’ . I’ve added the stdio.h library but nothing changes. I’m using win32. Any ideas?

Thanks.

Richard---------------------------------
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

Hi all.
Solved the prob with the animation. I changed snprintf to sprintf with only 3 parameters. Can someone explain why I couldn’t use snprintf?
Thanks.
RIchard
Richard Perrine <@Richard_Perrine> wrote:
Hi all.

Discovered the lines of code that seems to be causing the prob!

snprintf(filename, sizeof(filename), “pic%d.bmp”, i);
animation[i] = SDL_LoadBMP(filename);

When I enter an actual name of a bmp for pic%d.bmp it works. At least i get an image on a screen. It has something to do with the ‘snprintf’ . I’ve added the stdio.h library but nothing changes. I’m using win32. Any ideas?

Thanks.

Richard---------------------------------
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

Try using sprintf() instead? That’s what I always use. Use a buffer size that you are sure you won’t overrun and you’ll be fine. 20 should be enough for this example, but I typically use 1024 for any filename or pathname.

I don’t know anything about snprintf(), and never really heard of it before, so that isn’t such a good sign right there. :slight_smile: Stick to what’s used often by everyone, and you can expect better reliability. shrug Can’t help beyond that, sorry.

-Jason----- Original Message -----
From: Richard Perrine
To: SDLgroup
Sent: Wednesday, April 03, 2002 9:57 PM
Subject: [SDL] NO animation

Hi all.

Discovered the lines of code that seems to be causing the prob!

snprintf(filename, sizeof(filename), “pic%d.bmp”, i);
animation[i] = SDL_LoadBMP(filename);

When I enter an actual name of a bmp for pic%d.bmp it works. At least i get an image on a screen. It has something to do with the ‘snprintf’ . I’ve added the stdio.h library but nothing changes. I’m using win32. Any ideas?

Thanks.

Richard


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

Good enough for me. Thanks.
Richard
Jason Hoffoss wrote: Try using sprintf() instead? That’s what I always use. Use a buffer size that you are sure you won’t overrun and you’ll be fine. 20 should be enough for this example, but I typically use 1024 for any filename or pathname. I don’t know anything about snprintf(), and never really heard of it before, so that isn’t such a good sign right there. :slight_smile: Stick to what’s used often by everyone, and you can expect better reliability. shrug Can’t help beyond that, sorry. -Jason ----- Original Message ----- From: Richard Perrine To: SDLgroup Sent: Wednesday, April 03, 2002 9:57 PMSubject: [SDL] NO animation

Hi all.

Discovered the lines of code that seems to be causing the prob!

snprintf(filename, sizeof(filename), “pic%d.bmp”, i);
animation[i] = SDL_LoadBMP(filename);

When I enter an actual name of a bmp for pic%d.bmp it works. At least i get an image on a screen. It has something to do with the ‘snprintf’ . I’ve added the stdio.h library but nothing changes. I’m using win32. Any ideas?

Thanks.

Richard---------------------------------
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

Hi all.

Discovered the lines of code that seems to be causing the
prob!

snprintf(filename, sizeof(filename), “pic%d.bmp”, i);
animation[i] = SDL_LoadBMP(filename);

When I enter an actual name of a bmp for pic%d.bmp it works.
At least i get an image on a screen. It has something to do
with the ‘snprintf’ . I’ve added the stdio.h library but
nothing changes. I’m using win32. Any ideas?

Thanks.

Richard

— Jason Hoffoss wrote:

Try using sprintf() instead? That’s what I always use. Use a
buffer size that you are sure you won’t overrun and you’ll be
fine. 20 should be enough for this example, but I typically
use 1024 for any filename or pathname.

I don’t know anything about snprintf(), and never really heard
of it before, so that isn’t such a good sign right there. :slight_smile:
Stick to what’s used often by everyone, and you can expect
better reliability. shrug Can’t help beyond that, sorry.

-Jason

Get the latest version of glibc (and gcc wouldn’t hurt too). I
think it’s just the same as sprintf, but a 4th parameter of the
buffer size prevents buffer overflows.> ----- Original Message -----

From: Richard Perrine
To: SDLgroup
Sent: Wednesday, April 03, 2002 9:57 PM
Subject: [SDL] NO animation

=====
Dave Brondsema
dave at brondsema.net
http://www.brondsema.net
http://www.splike.com


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

I’m wondering how you even remotely get this to work. There
is no ‘snprintf’ on win32. It’s called ‘_snprintf’ (note the
underscore). I usually do the following in my sources:

#ifdef WIN32
    #define snprintf _snprintf
#endif

And it works quite well. Just make sure you have filename
declared properly, e.g. char filename[1024]; 

On Wed, Apr 03, 2002 at 06:57:09PM -0800, Richard Perrine wrote :>

Hi all.

Discovered the lines of code that seems to be causing the prob!

snprintf(filename, sizeof(filename), “pic%d.bmp”, i);
animation[i] = SDL_LoadBMP(filename);

When I enter an actual name of a bmp for pic%d.bmp it works. At least i get an image on a screen. It has something to do with the ‘snprintf’ . I’ve added the stdio.h library but nothing changes. I’m using win32. Any ideas?

Thanks.

Richard


Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"Mind if I MFH ?" “What QA did you do on it?” “the usual?” “ah… none :)”

Hi all.
Solved the prob with the animation. I changed snprintf to sprintf with
only 3 parameters.

It might be a sufficient solution in your case, but I’d rather not use
sprintf() and other similar funcs without ‘the n’ at all, as they’re one
of the more common reasons for “mysterious crashes”.

Can someone explain why I couldn’t use snprintf?

It beats me how you managed to compile your code at all! :slight_smile:

Anyway, the basic problem is that snprintf() isn’t ANSI C (not pre C99
anyway), so Win32 calls it _snprintf()… (I use an autoconf check to
#define snprintf _snprintf’ of there’s no snprintf.)

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Thursday 04 April 2002 06:20, Richard Perrine wrote: