Skip to main content
gamedev.net
🔒 Locked

Surface limit?

Started by raptorstrike Sep 18, 2005 at 1:45 PM 6 replies 1.1k views
Original Post
raptorstrike
raptorstrike
as far as anyone knows is there a limit to how many blits SDL can perform per cycle? is there a max size for vectors? my problem is every once in a while SDL misses a surface and so its just blank (it doesnt load the image but it acnowlages the object) thanks =)
____"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
rip-off
rip-off
i imagine your hardware will be the only limit...


the bit about missing blits is just wrong though, are you sure they're trying to blit...
raptorstrike
raptorstrike
I cant think of anything else, they are added to the "blit list" in the constructor and the object most certinly exists because you can interact with it but its picture is not showing up, the debugger doesnt catch it, only thing I can think of is some weird interaction with the vector that im putting it in (I dont even have that many things in the vector just like ~20)

I seriously doubt its my GPU because i have GeForce4 MX and the game isnt showing any kind of slow down (it runs quite fast and smoothly)
____"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
raptorstrike
raptorstrike
If it helps at all if I add too many units to the screen the program crashes and the debugger points to this function

template
inline _Tp*
__copy_trivial(const _Tp* __first, const _Tp* __last, _Tp* __result)
{
memmove(__result, __first, sizeof(_Tp) * (__last - __first));
return __result + (__last - __first);
}

in the vector class
____"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
rip-off
rip-off
i had a program like that.

there were a bunch of "fancy sprites" in a vector.

each sprite had a pointer to the loaded image.

i could have 18,000 entities and it would be slow, but they'd all be blitted.

even before i made shared images( like "image.bmp" could be loaded several times )
they would all blit.

the answer to your problem is probably somewhere in your source...
raptorstrike
raptorstrike
hmm well I'm using SDL_image.h library to load PNGs (to save space) is there any know bugs with this? I am really baffled here. it will blit some surfaces but not others (even if its the exact same picture) could it have anything to do with duplicate file loading? i.e IMG_Load("same_file.png") and doing this like 10 times?
____"This just in, 9 out of 10 americans agree that 1 out of 10 americans will disagree with the other 9"- Colin Mochrie
Kylotan
Kylotan
I would take a serious look at whichever of your functions is (indirectly) calling that function highlighted in the debugger. It looks like you're storing something in a standard container; have you ensured that whatever you're storing is compliant with that container? (eg. Is copyable, copy-constructable, whatever those restrictions are.)
Simian Man
Simian Man
I would double-check the destination rectangle you send to SDL_BlitSurface. It's possible that your'e trying to blit it way off the screen.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.