Wierd bug...

BlitzMax Forums/BlitzMax Programming/Wierd bug...

Arowx(Posted 2009) [#1]
Hi there wondered if anyone had come across a white rectangle effect on the Mac...

I had a working version of my game ported to the Mac using Grey Alien's Framework, but I needed a demo version so I branched (new directory) the existing code and added a demo timeout feature!

No the demo version works fine, but the full version has a bug...

Both versions load up fine and Splash a portal screen followed by the game logo screen, this screen has a background image which appears fine in both, the problem is the game logo.

Demo Version - Logo shows up and fades in/out fine!
Full Version - Logo appears as white rectangle and does the fade in/out!

Now the code that does the splash screens is exactly the same and called the same way, the only difference is the Demo version does a bit more file access prior to this happening!?

So has anyone seen something like this on the Mac?


therevills(Posted 2009) [#2]
Are you loading more resources in the Full version?

Ive only seen that when I tried to load a 2024x1024 (I know!!!) image and the Mac only had a 32MB graphics card...

Can you reproduce it with a small sample of code?

Is it the same image in the Demo and Full version?


Brucey(Posted 2009) [#3]
Hi there wondered if anyone had come across a white rectangle effect on the Mac...

You've ran out of VRAM, and your texture has been freed up for another TImage.


Arowx(Posted 2009) [#4]
This get's wierd, I've just restarted the mac and on the first run it works fine, then on the second run back to a white rectangle!

Tried renaming the app and exactly the same first run through fine, second produces white rectangle!

It must be an issue with the Framework somewhere as it builds a new ini file for each app, something in the ini file must be causing it!


Brucey(Posted 2009) [#5]
BlitzMax makes programmers lazy with regards efficient use of VRAM. Just because you can throw x number of images into VRAM, doesn't mean you should keep everything loaded in there.

Sometimes you may find it necessary to swap in and out.


Arowx(Posted 2009) [#6]
Hi Brucey,

Would fullscreen and windowed mode make a difference and if it is VRAM on the mac would opening more apps affect it?


*(Posted 2009) [#7]

Would fullscreen and windowed mode make a difference and if it is VRAM on the mac would opening more apps affect it?


Yes fullscreen means the computer doesnt really need to worry about the desktop image in the background until the application terminates. Windowed uses more VRam due to that requirement.


Arowx(Posted 2009) [#8]
No there is something really odd with this, get this running the demo version windowed no problem running the release version white rects, now if I run the demo version and while the demo version is running run the release version the release version is fine????

Now if it's VRAM wouldn't that cause more of a problem, definitely something weird going on here!

I wonder if it's the Frameworks ini or dat file?!


Arowx(Posted 2009) [#9]
No tried running that app multiple times and managed to get a binary pattern with works, fails, works, fails then moved the app file to the release folder (as opposed to the development folder) and ran multiple times again and got fail, fail, fail, worked!

Does this apparently random sequence of white rectangles match what you would expect from a VRAM issue, as subsequent screens have more graphics elements, they just don't try and zoom in on them!

As this only effects the splash screen on a mac mini I'm tempeted to launch the game but up the spec!

NB: Still absolutely no issue with the demo version! ARRGH!


DavidDC(Posted 2009) [#10]
I'm dubious about the VRAM call. Are you sure your blend state setup is identical in both releases?
[edit: meaning - are you relying on default render states rather than setting them explicitly]

My only other thought is a bizarre file path issue


DavidDC(Posted 2009) [#11]
the Demo version does a bit more file access prior to this happening!

Possible current working directory issue? Doesn't really explain intermittent success though...


therevills(Posted 2009) [#12]
Are your apps named differently?

If so, stab in the dark - Have you updated the Mutex name?

Edit - Mutex doesnt matter on the the Mac.... nvm!

What about your package, have you included everything correctly in the .app in the Mac?


Arowx(Posted 2009) [#13]
Well I've released it, jiggled the code a bit so now the background image sometime whites out but at least the logo still appears!

You can try the demo (or even buy the full version) if you would like to see it in action here: http://mmjChallenge.com