Streams on other platforms

BlitzMax Forums/BlitzMax Programming/Streams on other platforms

Robby(Posted 2013) [#1]
Hi guys! I ran into a curious problem. I code most of my app on Vista 64. I can copy the whole directory onto my Mac OS X Leopard, recompile, and all runs well. Similarly, I can copy the whole Mac directory back to Vista, re-compile, and it works fine.

Now if I copy my directory from Vista 64 to my XP Sp3 computer, I can compile, but it won't run, getting "null object" errors, and this appears to be any time its loading anything from disk with a stream.

I thought maybe the xp directory was write protected or something, but its not.

Now the files were made on either the Vista or the Mac, and can interchange and read with no problem.

Any thoughts why XP is unable to read the files? I'm quite puzzled by this and any help would be appreciated. Thanks, -Robert


xlsior(Posted 2013) [#2]
- Do the files look OK in explorer (e.g. correct file sizes?)
- did you transfer the files over the network onto the XP station? If so, It's possible that the files got marked by XP as 'insecure' because of that, which could prevent them from getting opened by programs without specifically allowing them. Try browsing to the folder in Explorer, right-click on a file -> properties. Do you see an 'unlock' checkbox? Does checking it allow it to work?
If so, you could add the name/ip address of the 'source' computer where the files originated in the list of trusted sources in your internet settings to keep them from getting blocked (Control Panel -> Internet Settings)


Robby(Posted 2013) [#3]
Thanks for the tips, but it seems the problem is stranger! If I run this little program on my vista or mac:

Graphics 1280,800,32

While Not KeyDown(KEY_ESCAPE)

SetColor (255,0,0)

DrawRect 22,22,100,100

Flip

Wend

It does what you expect. Makes a red rectangle until you tap escape.

If I compile - which it does fine - on my XP, when it runs I get:
"Unhandled Exception: Attempt to access field or method of Null Object" and highlights the SetColor instruction.

This would indicate maybe my opengl is screwed? But it gets a lot worse! I checked and updated everything on that computer. Windows XP Pro sp3.
2 gigs RAM
Nvidia 7950 GT
OpenGl version 2.1
Defragged the drive.

The REAL killer is that if I load any of the Blitz examples, like Fireduck, etc., they work!!! Those are a lot more complicated than my little program.

Its like just MY stuff doesn't work! This is not a joke! Its actually doing this and I haven't the foggiest idea why. Never ran into a problem like this, that's for sure! -Robert


TomToad(Posted 2013) [#4]
Try putting SetGraphicsDriver GLMax2dDriver() at the top. Vista and XP default to DirectX, not OpenGL. Make sure you have the latest drivers for your video card, could be you are trying to get a resolution the current driver doesn't support. Get the driver from the NVidia site, I don't believe the driver that comes with XP supports non 4:3 resolutions natively. Also make sure your BlitzMAX install is up-to-date. Possible that you are still using an earlier buggy version on XP?

Edit: One more thing, put Superstrict at the top of your code. It might shed some light on the problem.


Robby(Posted 2013) [#5]
Thanks for the help! I discovered that the main problem was I was attempting to use a resolution not supported by my screen. When I put in a proper resolution, all the graphics commands worked fine.

But the XP curse is not letting me alone! I checked all the files in the directory for any write protect, etc. Things load fine, like wav files, etc.

What's really mind-boggling is the slew of NULL object errors I'm getting.
And its mostly simple variables, not stuff loaded from disk.

For example, I have one function that defines a couple locals and uses them to generate a bunch of random numbers, like:

Function MakeRnds()
Local gran:Int

Then in the code (Selected_Tile is Global):

gran = Rand(1,5)
If gran = 1 Then
Selected_tile = 123
End

' more......
End Function

So maybe there's 15 of these gran blocks in the function. He gets through maybe 7 of them, then highlights Selected_Tile saying its a null object.

Sometimes a whole function is highlighted as a null, or clearly defined locals used immediately after their declarations are said to be null.

I even tried moving my main loop to the bottom, so anything and everything, Globals, Functions, etc., were defined first, and still keep getting these errors. Indeed, the errors are actually different ones if I have no strict, or strict, or superstrict.

Weirdly, he compiles just fine. Its when it is run that these odd errors occur.

Now the strangest part is that I'm testing my mapmaker, which is a stripped-down version of the main game, which is like ten time larger with many more functions, declarations, and complexity.

So why do both my mapmaker and main game, with the EXACT same code compile and run perfectly on my vista 64 and Mac, and bomb out royally on the XP?? This is driving me nuts!


Robby(Posted 2013) [#6]
I forgot to mention, the graphics stuff works with or without the SetGraphicsDriver GLMax2dDriver() now that I have the proper resolution.


Henri(Posted 2013) [#7]
Hello,

I think MacOS is also 64-bit so maybe you are missing 32-bit build files in your Blitzmax/mod folder ?

EDIT:

Ah nevermind. Just thought if something was named x86 on 32-bit system, it would be x64 on 64-bit system, but that is not so.

-Henri


Robby(Posted 2013) [#8]
Well! It turned out it was muffing up because I had Build GUI app selected under Build Options. When I unchecked that, everything suddenly worked perfectly!

What's the GUI app? Is that when you want like windows and forms and text fields etc., like VB6? Hopefully that's all because I don't need it.

Now of course I need to figure out resolutions. It probably won't work on square 4:3 screens but fortunately most these days will be widescreen displays.

I'm not sure what my program will look like at its 1280x800, which is 16:10 at a fairly low res, vs., say, 1600x900 or some such, which is 16:9, shorter aspect but higher res. Well, at least its running properly! Thanks for all the tips! -Robert


Brucey(Posted 2013) [#9]
Generally you need to choose GUI app if you intend to run it from an icon (double-click). Otherwise, on Windows at least, it will also launch a console window when you double-click on the icon.


xlsior(Posted 2013) [#10]
What's the GUI app? Is that when you want like windows and forms and text fields etc., like VB6? Hopefully that's all because I don't need it.


It really means "This is not a command line application"

A non-GUI app will be text-mode only, and run / interact with the command prompt.

A GUI app will create its own windows, which means either a windows GUI OR the 'standard' graphics window that you'd use for a game.