Is it possible to use the SDK with plain C (like Pelles-C for example) ? Or you need C++ support in the compiler ? Thanks.
SDK with plain C ?
Blitz3D SDK Forums/Blitz3D SDK Programming/SDK with plain C ? According to the products page, plain C is fine.
Works well with DEvC++ in 'C' mode. The default parameter must be "include"
Example :
BBEntity camera = bbCreateCamera(); // C++
BBEntity camera = bbCreateCamera(0); // C
Example :
BBEntity camera = bbCreateCamera(); // C++
BBEntity camera = bbCreateCamera(0); // C
Yeah I just did a little test to see if it would start and end properly in plain C... it worked fine. I think that's because it's not at all object oriented, a useful feature for people looking to use it with non object oriented languages. All the object handling is internal and all we, the end user coders get, is an integer handle system.
I tried some examples with LCC-Win32 for fun. No real problems except for the default parameter stuff.
"I tried some examples with LCC-Win32 for fun. No real problems except for the default parameter stuff."
With LCC?. Good news. I'm interesting. A post about these parameters? ;-)
JP
With LCC?. Good news. I'm interesting. A post about these parameters? ;-)
JP
@ZJP, so will you post a small example of the complete code you used in your compiler? I'm interested because this would be a great excuse to interface some 'c' with B3D.
Regards, BP.
Regards, BP.
An example from the SDK
extern int WINAPI WinMain(HINSTANCE hThisInst,HINSTANCE hPrevInst,LPSTR lpszArgs,int nWinMode){ bbBeginBlitz3D(); bbGraphics3D( 640, 480, 0, 2 ); bbAmbientLight( 64, 64, 64); BBEntity camera = bbCreateCamera(); BBEntity light = bbCreateLight(); BBEntity cube = bbCreateCube(); // move camera back from origin bbPositionEntity( camera, 0, 0, -5 ); // tilt default forward facing directional light downwards bbRotateEntity( light, 40, 0, 0 ); // now rotate the cube slowly infront of the camera until escape key pressed while( !bbKeyHit( KEY_ESCAPE ) ) { bbTurnEntity( cube, .1, .2, .3 ); bbUpdateWorld(); bbRenderWorld(); bbFlip(); } bbEndBlitz3D(); return 0; }
Works with VisualC 6 also, with the default parameters.
[Deleted] Nevermind. :)