i have a resource file full of graphics (lets say all png) i know the where to locate each png in my file… how do i do to pass this informatin to an SDL_Surface.
thanks for asking this
i have a resource file full of graphics (lets say all png) i know the where to locate each png in my file… how do i do to pass this informatin to an SDL_Surface.
thanks for asking this
David wrote:
i have a resource file full of graphics (lets say all png) i know the
where to locate each png in my file… how do i do to pass this
informatin to an SDL_Surface.thanks for asking this
Have a look at the SDL_image library and SDL’s RWOps mechanism. You’ll
need to create an RWOps structure for reading from your archive and pass
this to SDL_image for decoding.
-John
i have a resource file full of graphics (lets say all png) i know the =
where to locate each png in my file… how do i do to pass this =
informatin to an SDL_Surface.
Well, i guess most SDL_Image methods offer you to load a png file from a
file but this file has to be one png only. So you would have to export
that png file from the resource file to a tmp file and then let
SDL_Image load it. On the other hand watch out for png libraries that
let you load a png image from a buffer in memory. You then could load
the png data fromfile to the buffer and convert it to an sdl surface.
Maybe SDL_Image can do this also for you. I am not very familiar with it.
I could also offer you a self made resource file format and c++ classes
to handle it, but i havent implemented a png data loader yet ( BITMAP
AND WAVE are available).
Hope this helped you a bit.
Marc__________________________________________________________________
Gesendet von Yahoo! Mail - http://mail.yahoo.de
Weihnachts-Eink?ufe ohne Stress! http://shopping.yahoo.de
Check out SDL_RWops and SDL_Image. RWOps allows you to use memory
buffers as if they were files, and SDL_Image lets you load pngs.
RWOps has functions to load data from an open file pointer from an
offset, then you can pass that data into SDL_Image to get the decoded
surface.
Check out
http://www.kekkai.org/roger/sdl/rwops/rwops.html
and
http://www.libsdl.org/projects/SDL_image/On Tue, 2002-12-31 at 08:13, David wrote:
i have a resource file full of graphics (lets say all png) i know the
where to locate each png in my file… how do i do to pass this
informatin to an SDL_Surface.thanks for asking this
–
Jimmy <@Jimmy>
Jimmy’s World.org
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030102/e44ee813/attachment.pgp
I recently upgraded to using SDL-1.2.5 on Windows, from 1.2.3. I noticed what seems like a weird bug though (I couldn’t find anything in the archives for this group on it). The system clock seems to slow down when my app is run in a window. Since the app is using the timer for animation, the whole thing runs in slow-motion. If I watch the system clock accessory, I can actually see it running slower if I watch another clock alongside it. Anyone seen this happen before? I’m running Win2K, fully patched. If I switch back to the 1.2.3 dll, the PC runs normal time while the app is running.---------------------------------
Post your free ad now! Yahoo! Canada Personals
Hi,
I guess what you are trying is
Assuming I am here’s what you need to do.
hope this helps
Vibhu…On Tue, 2002-12-31 at 18:43, David wrote:
i have a resource file full of graphics (lets say all png) i know the
where to locate each png in my file… how do i do to pass this
informatin to an SDL_Surface.thanks for asking this
-------------------------------------------------------------------------- No one wants war. – Kirk, “Errand of Mercy”, stardate 3201.7 --------------------------------------------------------------------------
but I don’t understand why, sorry.
I don’t know whether or not it was because of 1.2.5 though because I never used 1.2.3 for my programs, and when I was playing my tetris for an hour (heheheh) my system clock went by like 2 mins. My tetris was in a window as well. I’m running XP…maybe I should try 1.2.3 dll----- Original Message -----
From: feral_coder
Newsgroups: loki.open-source.sdl
To: sdl at libsdl.org
Sent: Thursday, January 02, 2003 5:38 PM
Subject: [SDL] SDL-1.2.5 + Windows system clock
I recently upgraded to using SDL-1.2.5 on Windows, from 1.2.3. I noticed what seems like a weird bug though (I couldn’t find anything in the archives for this group on it). The system clock seems to slow down when my app is run in a window. Since the app is using the timer for animation, the whole thing runs in slow-motion. If I watch the system clock accessory, I can actually see it running slower if I watch another clock alongside it. Anyone seen this happen before? I’m running Win2K, fully patched. If I switch back to the 1.2.3 dll, the PC runs normal time while the app is running.
Post your free ad now! Yahoo! Canada Personals
but I don’t understand why, sorry.
I don’t know whether or not it was because of 1.2.5 though because I never used 1.2.3 for my programs, and when I was playing my tetris for an hour (heheheh) my system clock went by like 2 mins. My tetris was in a window as well. I’m running XP…maybe I should try 1.2.3 dll
Also try 1.2.4 dll, to help isolate where the problem started.
Does the game use SDL sound? There was recently a switch to using the secondary
buffers instead of primary buffers (which seems to have broken some other stuff,
mentioned elsewhere on the list)
See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment