Can you use fopen to load art?

Non-platform specific questions.

Can you use fopen to load art?

Postby Hblade » Sun Feb 14, 2010 5:47 pm

Hey, I was wondering if you could use fopen to open other things such as graphics / sounds?
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Can you use fopen to load art?

Postby DST » Sun Feb 14, 2010 8:21 pm

You can use it to load anything, as far as i know, because it simply reads the stream of data. However, you will have to create your own functions and algorithms to interpret the information, so you can't just import a sound and use it that way.

In the 24 bit bmp functions, a canvas is used to display the data. There is no sound equivalent of a canvas, so what you'd have to do is read the data, store it in an array, save it as a wav file, and then load that wav file and play that. While it wouldn't be practical for most things, one neat thing you could do is grab the sound data and create a waveform profile of the sound, then display that waveform along with playing the sound (much like a visualization). Again it wouldn't be practical, but its one of those fun ge experiments.

But i'm pretty sure that f can be used to read and save any data type, as long as its in the game folder only.
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: Can you use fopen to load art?

Postby Hblade » Sun Feb 14, 2010 9:09 pm

Thanks :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest