IPhone OpenGL swapBuffers problem! Help!

Hi guys,
I am writing a 2D game using OpenGL, based heavily on Apple's CrashLanding sample.
My main game loop calls three functions:
1. update, which moves all my objects
2. draw, which draws the objects to the current OpenGL context using Apple's Texture2D
3. finally, the swapBuffers function provided by apple.
I've set the rendering timer to 60 FPS. Right now all I'm drawing is a background texture (320x480 - fills the screen) and 10 or so clouds, about 100x50 px each, with blending enabled.
**Here's the problem: most of the time it runs fine, but seemingly at random, about every tenth frame or so, the swapBuffers function takes 10x as long as usual (about 0.002 sec. instead of 0.0002 sec) - Does anyone know what could be causing this? If I understand correctly, it seems like any slowdown should come in the draw function, and the speed of swapbuffers should be completely independent of what's on the buffers being swapped, right?
Anyone know what could be causing this or seen anything similar?

Yea I noticed it because there are a few really choppy frames every 2-3 seconds but it's smooth as silk the rest of the time, even though (seemingly) nothing changes.
I had one thought though: In the process of moving my objects around, I allocate and then release a lot of Vector2D's (a class I wrote). Is there any way that the de-allocated vectors pile up and the stutter is when it decides to clean them out?
When I run the Object Allocations instrument, the "Net" number of Vector2D's stays steady, so I don't think I'm leaking anything. However, the big red bar to the side of that is huge, though mostly light pink with a tiny sliver of dark red. What does that mean? Sorry for all the newbie questions
Thanks a ton!

Similar Messages

  • Rom UK to South IPhone 3GS Synching Problems - HELP PLEASE

    Hey, I need help.
    Every time I connect my iphone to my HP laptop, it says it can't read the iphone and wants to restore the software.
    I go through this route, and it sometimes allows me to synch my contacts, but I have no joy with apps or music. This iPhone has worked perfectly with this PC previously.
    I am now running the latest iTunes software and also iOS4 on my iPhone and still no success.
    I get a message saying that an iPhone has previously been synched with this PC, which is true, as it is my one and only iPhone.
    As an aside, but may be related, I recently moved from UK to South Africa, and had my iPhone unlocked by o2 in the UK and now work from a Vodacom sim card.
    I've taken my iPhone and laptop into a local Apple store, and whilst it appeared to work in the shop, as these things always do, when I got home, reconnected, I got the same problem and has to restore my iPhone completely.
    Can anyone possibly help.
    I feel I need to get my iTunes to recognise that this is the iPhone thats been synched with it in the past.
    Other random error messages I get are things like, "cannot sync as item is a folder rather than a file"
    HELP

    Welcome to the club. This is a problem that has surfaced with OS 3.0.1 and continues into 3.1. All 3rd party apps crash at startup on iPhone 3g and 3gs. OS 3.0 didn't behave this way and Apple apparently has no comment to make on the matter.

  • Iphone and email problems - help please!

    I have a few questions about email on the iphone I wondered if someone could help me with?
    1. If I check my email at home on wifi everything is fine, I can recieve and send emails no problem. If I am outside and using GPRS ( Not found an EDGE signal yet ) I can recieve emails but when I try and send one it tells me it cannot find the outgoing server after trying to send the email for a few minutes.
    2. Sometimes I open my email and its fine but when I go back and try and open an email I have previously read it says "This message has not been dowloaded from the server". How do I get the email to stay there?
    Thanks guys

    See my reply on this post.
    http://discussions.apple.com/message.jspa?messageID=5842248#5842248
    In sort, even once you view it, it will not remain in the Inbox for ever...it will attempt to redownload if accessed later.

  • Iphone 4 sound problem, help?

    Hello, basically I have the Iphone 4, and im having such an annoying problem with the sound and cannot find a solution anywhere!
    When im using my phone to listen to music or speak on the phone, my volume works perfectly, no problems at all, yet when i go to on any of my apps NO VOLUME whatsoever, also my phone doesnt make a noise when someone rings or messages me, its not on silent, ive checked all the settings aswell,h
    when i press the volume buttons on the side of the phone the volume doesnt change, it doesn't even come up on the screen that its going up or down, same when i switch it from silent mode, to non silent mode.
    ive tried reformatting the device, also updated to 1S07, this problem is still happening.
    someone has to know what to do right?! hahaha.
    Thank-you in advance...

    still no help....

  • Iphone and Ipod problem help me!!

    I just bought a iPhone and I want to give my iPod to my boyfriend but I only have one computer there for I only have one way to get to my iTunes,me and my boyfriend have different tastes in music and he doesn't want my music and vise-versa I've tired to change our apple IDs but I cant seem to figure it out :-( Please someone help me I want to try and not go to the apple store
    Thank you!!

    The iPhone and the iPod sync characteristics are configured separately.  The iTunes application keeps track by S/N.  Apple ID doesn't matter.  (I currently have two IDs and the only problem is very minor - log out/in to update apps obtained with the "wrong" ID.)

  • IPhone 4 recovery problem HELP!

    So today I downloaded for my iPhone 4 the 4.2 update this could not be done i went in recovery mode I restored it That did not work I keeps getting errors. I cannot not restore my phone back which I guess means its broke and I payed £500 for it so I am not happy if restore is not fixed soon I want a new Phone free

    if the restore doesnt work then your going to have to take it into a apple store for replacement

  • I couldn't log into my apple account on my iPad, then i couldn't unlock it resulting in it being disabled, however it's the same as my iPhones password, I then called apple, i was hung up on twice and they said it will cost £70 to fix THEIR problem, help?

    I couldn't log into my apple account on my iPad, then i couldn't unlock it resulting in it being disabled, however it's the same as my iPhones password, I then called apple, i was hung up on twice and they said it will cost £70 to fix THEIR problem, help?

    If you cannot remember the passcode, you will need to restore your device using the computer with which you last synced it. This allows you to reset your passcode and resync the data from the device (or restore from a backup).
    If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present.
    You may have to force iPad/iPod into Recovery Mode
    http://support.apple.com/kb/ht4097

  • Please help iPhone 5 sound problems

    iPhone 5 sound problem: my iPhone 5 noise is only coming out thru the ear speaker and will not come out of any of the other speakers on my phone i say again it will ONLY come out my ear speaker it does it in games and in videos in music in everything! Ive reset the phone and went thru all the settings and everything to try to fix with no luck at all please help me!

    fdisk formated and reinstaled windows 3 times. fresh install each time i installed a sound card. so I dont think lingering drivers is the problem which also means dx9 has been installed fresh each time.also I have been dealing with this for nearly a month and I am at a loss.

  • Hello, i changed my mediathek-folder due to space-problems and since then i am not able to fill the iphone (4) with music anymore. also i cant delete music in itunes, which already is on the iphone... HELP!!!

    hello, i changed my mediathek-folder due to space-problems and since then i am not able to fill the iphone (4) with music anymore. also i cant delete music in itunes, which already is on the iphone... HELP!
    does anybody know how to solve this problem? thx!

    If you want to try to clear even more disk space see https://discussions.apple.com/thread/5872318?tstart=0

  • I can't turn off find my ihone, always show "there was a problem when canceling the registration of this iphone with icloud" please help me. i can't restore my iphone before turn off find my iphone

    i can't turn off find my ihone, always show "there was a problem when canceling the registration of this iphone with icloud" please help me. i can't restore my iphone before turn off find my iphone

    If you are the original owner of the phone and know the Apple ID and password that were used to activate it originally, and if you have an existing backup to restore from, you can force it into recovery mode (which will completely erase it) and restore it as explained here: If you can't update or restore your iPhone, iPad, or iPod touch - Apple Support.  When you do you will encounter activation lock, and will have to provide the ID and password used to activate it originally in order to activate it again.  If you can't, you won't be able to activate and use it.

  • Hello everyone, im using iphone 4, my problem is that i cant update my iphone from 5.0.1 to 5.1.1 while using software update in settings on my iphone please help......

    Hello everyone, im using iphone 4, my problem is that i cant update my iphone from 5.0.1 to 5.1.1 while using software update in settings on my iphone please help......

    Downgrading to a previous version of iOS is not supported.
    Sounds like your iPhone was hacked/modified/jailbroken to work
    with wireless carrier other than the one it was purchased from. The
    update has relocked it to the original carrier. Contact the original
    carrier to see if they offer unlocking and if you qualify - only the
    carrier to which the iPhone is locked can unlock it.
    What does it say when you look at Settings=>General=>Carrier?
    Be advised that the previous modifications to change from original carrier
    to your local Carrier may have rendered the iPhone unable to be
    officially unlocked.

  • TS1559 I have problem with my iPhone 4s, the problem is i can't turn on wifi, when i go to the setting then to the general and then to the about, i see there is wifi address for my iPhone but still i can't turn it on, please help me

    I have problem with my iPhone 4s, the problem is i can't turn on wifi, though i have wifi address in my iPhone setting when i go to the general then about option, i tryed many options like turning of iPhone in airplan mode, reset options, but still the same, its gray button of wifi, please help me.

    Hello Pllumb,
    It sounds like you are unable to turn on Wi-Fi because the option is grayed out in Settings. Use these steps from the following article named:
    iOS: Wi-Fi settings grayed out or dim
    http://support.apple.com/kb/ts1559
    Restart your iOS device.
    Make sure that airplane mode is off by tapping Settings > Airplane Mode.
    Reset the network settings by tapping Settings > General > Reset > Reset Network Settings.
    This will reset all network settings, including Bluetooth pairing records, Wi-Fi passwords, VPN, and APN settings.
    Make sure that your device is using the latest software. To do so, connect your device to your computer and check for updates in iTunes.
    If you still can't turn Wi-Fi on, please contact Apple for support and service options. If you can turn Wi-Fi on but are experiencing other issues with Wi-Fi, please see these steps.
    Thank you for using Apple Support Communities.
    All the very best,
    Sterling

  • I just got my iphone and i want to get all my apps and music from my ipod onto my iphone. the only problem is that my itunes is not recognizing my iphone in the devices. in fact there are no devices at all listed. Please help!

    I just got my iphone and i want to get all my apps and music from my ipod onto my iphone. the only problem is that my itunes is not recognizing my iphone in the devices. in fact there are no devices at all listed. Please help!

    See either:
    iPhone not recognized in iTunes for Mac
    iPhone not recognized in iTunes for Windows

  • Hello my name is achuthranesh and my iPhone has in problem. When my iPhone was in vertical position the upper touch screen (up to 4mm) is not working....... Plz help me.....

    Hello my name is achuthranesh and my iPhone has in problem. When my iPhone was in vertical position the upper touch screen (up to 4mm) is not working....... Plz help me.....

    Are you talking about status bar or 4 mm ( screen) below it

  • Activation Problem..i Have Registered for the devolopers account and also paid 99 dollars. how do i open my iphone now? please help. this is urgent!

    this morning my iphone showed up a activation problem then it told me to go to devoloper.apple.com and register for the ios developer program.. it costed me 99 dollars. but i did it.. just a moment ago.. how do i access my iphone now? please help me this is real urgent.

    this in my problem too apple say : ur request is pending now and it did not activated yet !    ?  
    what should i do?

Maybe you are looking for

  • Pass query result as parameter to javascript

    Hello, I'm a beginner with javascript, so (maybe) sorry for this question. Is it possible to use a query result as parameter in a javascript function for example like this? <cfquery name="select_data"> select name from user_table </cfquery> <script l

  • Which equipment for that ?

    Is there any NI equipment which can do next thing on 60-100 channels: - need to measure resistance, or just voltage (if i have constant current source) - constant current source (need about 100 mA per channel) What's the best solution for that. I nee

  • Migrate from Crystal Reports to XMLP?

    We have a bunch of reports implemented with Crystal Reports and we are planning to migrate those reports to XMLP. Is that possible? Dose anyone has the same problem? What is the general process? I have no experience about XMLP before. Thanks in advan

  • IPOD 60GB will not transfer PHOTOs from my XP 64 bit computer

    iPOD 60GB will not transfer PHOTOs from my XP 64 bit computer - I get read/write to iPOD hardrive error message. Everything esle is working (including iPOD update). Is it something I am doing wrong or is it not compatible with Window XP Pro 64 Bit ju

  • Can I store photos and music in I cloud and relieve space on my hard drive?

    can I store photos and music in I cloud and relieve space on my hard drive?