Very, very strange things are happening here on my pc... :(
I've created a simple userlib-dll with powerbasic:
It exports only a single function, that should show an int var (= 345) and an int const value (= 1) in a message box.
The decl file is pretty simple:
Well, and here's my Blitz3D code:
Guess what's happening when I run this piece of code?
The first call of xplTest shows this:
i=345, c=1
Everything looks fine.
But the second one won't:
i=344,99998255992, c=10
I cannot use ints in my DLL after entering 3d graphics. How can this be? And no, this is not a bug in PB's message box, because I noted this strange thing after getting mysterious results when doing simple calculation with int vars (e.g. some results were one less than expected).
Maybe I should ask this over there at powerbasic forums. But since this happens only after a Graphics3D call, it seems to have something to do with Blitz' 3d engine, too.
Anyone else experienced this?
I've created a simple userlib-dll with powerbasic:
#Compile Dll "xpldebug.dll" #Debug Error On #Dim All #Option Version4 #Register Default %c = 1 Declare Function xplTest SDecl Alias "xplTest" () As Long Function LibMain (ByVal hInstance As Long, ByVal fwdReason As Long, ByVal lpvReserved As Long) Export As Long Function = 1 End Function Function xplTest() Export As Long Local i As Long i = 345 MsgBox "i = " + Str$(i) + ", c = " + Str$(%c) Function = 0 End Function
It exports only a single function, that should show an int var (= 345) and an int const value (= 1) in a message box.
The decl file is pretty simple:
.lib "xpldebug.dll" xplTest%()
Well, and here's my Blitz3D code:
xplTest Graphics3D 1024, 768, 32, 3 xplTest
Guess what's happening when I run this piece of code?
The first call of xplTest shows this:
i=345, c=1
Everything looks fine.
But the second one won't:
i=344,99998255992, c=10
I cannot use ints in my DLL after entering 3d graphics. How can this be? And no, this is not a bug in PB's message box, because I noted this strange thing after getting mysterious results when doing simple calculation with int vars (e.g. some results were one less than expected).
Maybe I should ask this over there at powerbasic forums. But since this happens only after a Graphics3D call, it seems to have something to do with Blitz' 3d engine, too.
Anyone else experienced this?