0
0

😕 Well, I don’t know much C/C++. I know enough to be able to write out some simple dlls for math funcs. etc. since I mainly program in blitz basic ( http://www.blitzbasic.com ) which only supports 32 bit ints and floats or null terminated strings. Anyway, to my question. I’m attempting to access the fmod dll from blitz, and so far it’s looking like a very sweet dll. A year or two back, Blitz got a new ‘userlib’ system which allows you to create .decls files for dlls. this allows you to access the dlls and create aliasis in a similar way to VB. Thankfully, most functions return an int if they are actually returning a non-boolean value. Anyway, to the point, what’s with the signed char business for all the true/false functions? why not use bool?

  • You must to post comments
0
0

The bool type is not part of the ANSI C, it is casted by the compiler to a int/char (depending of the compiler). It can be written :

[code:3d295b9f]
typedef int bool;
const bool false = 0;
const bool true = 1;
[/code:3d295b9f]

[code:3d295b9f]
enum bool {
false = 0,
true = 1
}
[/code:3d295b9f]

[code:3d295b9f]

define TRUE 1

define FALSE 0

[/code:3d295b9f]

Btw, i ve heard about BlitzBasic but i ve choose [url=http://www.purebasic.com:3d295b9f]PureBasic[/url:3d295b9f], another powerfull basic.

  • You must to post comments
0
0

Yeah. Purebasic is also a popular choice. Actually, it has a similar syntax to blitzbasic. The major differences are that purebasic can do sophesticated user interfaces and compile dlls, Blitz3d/2d/plus include 2d graphics and very easy 3d graphics. Many blitz users also use purebasic to create dlls for there blitz programs.

Anyway, thanks. This should work. I assume that the true/false functions return $00 for false and some non-zero number for true? I think I can get blitz to read the chars into a integer. I really do wish blitz had some variable options… Mark ( creator of blitz ) left it out for simplicity.

  • You must to post comments
0
0

I think let Blitz read the signed char as a byte value for bool, for others value ( > 255 ), add the AND logicial operator to get an unsigned value :

[code:2ny2zjrf]
byte.b = 250
word.w = 64000

a.l = byte & $FF
debug a
a.l = word & $FFFF
debug a
[/code:2ny2zjrf]

Blitz3D is a VERY good language to do 3D games, i know someone coding his own FPS, the 3D engine is much better than commercial games like CS (lol) and the physics can be very accurate.
PureBasic has it’s own 3D set of functions based on the fabulous [url=http://ogre.sourceforge.net:2ny2zjrf]Ogre[/url:2ny2zjrf] 3D engine, the 3D support is now the main goal, we ll get also a physic engine similar to the one in Half Life 2 :)

  • You must to post comments
0
0

Okay. I got it perfectly integrated :)

Yeah, I’m working on the physics/importing some models/ sound system of a blitz engine that used to be called singularity.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.