MiniB3d for FreeBasic

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
Post Reply
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Post by duke4e »

awesome! keep up the great work! this will come handy one day...
super_castle
Posts: 289
Joined: Oct 10, 2006 7:19

Post by super_castle »

hello, who is "imageload" in the programm?
i can not found.

gruss
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Post by angros47 »

I don't understand what are you referring to.

There is no "imageload", in minib3d: you can load an image as a texture, with LoadTexture.

Internally, MiniB3d uses STBI to load the image: the LoadTexture (file texture.cpp) function calls stbi_load (file stb_image.c), that loads a picture in memory.

The format is not exactly the same of FB images.
You can also use stbi_load in FreeBasic (and you don't even need minib3d shared library to do that).
I've posted a sample here: http://www.freebasic.net/forum/viewtopi ... 021#133021
super_castle
Posts: 289
Joined: Oct 10, 2006 7:19

Post by super_castle »

why make sprite transparent with minib3d?

gruss
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Post by angros47 »

What do you mean? Anyway, check the alpha channel of the image.
super_castle
Posts: 289
Joined: Oct 10, 2006 7:19

Post by super_castle »

hello, have you one demo for transparentsprite?

gruss
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Post by angros47 »

Still no demo, sorry. You can check on BlitzBasic site.

Anyway, I finally ported MiniB3d to linux:
http://www.file-pasta.com/file/0/Minib3 ... nux.tar.gz

Warning! Linux filesystem is case-sensitive, so be sure, if you want to load files (texture, models) that the name is written correctly.

The shared library is libminib3d.so

If you don't want to install it, just copy it in the directory where you have your freebasic program; to launch program, you have to do

Code: Select all

LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH  ./filename
In fact, this is another difference between Windows and Linux: in Windows, a program will look for shared libraries in its own directory, and in system folder; in linux, a program will look for shared libraries in path only (so, you have to explicitly tell it to look into its own directory)
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Post by angros47 »

Getting closer to load 3ds files. Also, the new version should allow to map images drawn in FreeBasic to textures.

Stay tuned...
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Post by angros47 »

Updated, check first post.

http://www.file-pasta.com/file/0/miniB3 ... r%20FB.zip

it includes a flight simulator, to show how easy is it.
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Post by kiyotewolf »

How did you make the dll into (or aided by) a .bi file?

I'm just curious.

You don't have to get into detail, cause this type of stuff is WAY over my head. I was just curious.



~Kiyote!
Westbeam
Posts: 239
Joined: Dec 22, 2009 9:24
Contact:

Post by Westbeam »

Hey, thats amazing. I used Blitz3D before i found FreeBasic. Now i can write my 3D-Game without OpenGL. :D

I made a miniB3D-Logo with the BB-Spacefighter:
Image

And now ill write a tutorial: "3D-Programming with miniB3D".

Sorry for my bad english, im german :/
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Post by angros47 »

@Westbeam

Nice logo! I like it.

@kiyotewolf

I just converted the declarations from C to FreeBasic, then i used the "inclib" keyword.

http://www.freebasic.net/wiki/wikka.php ... eyPginclib

In fact, you can use it with no .a file, if the dll is in the current directory (or in path directory)
kiyotewolf
Posts: 1009
Joined: Oct 11, 2008 7:42
Location: ABQ, NM
Contact:

Post by kiyotewolf »

@Westbeam

From the sounds of it, we should expect GREAT THINGS from you.

Voldemort did GREAT THINGS.. terrible things.. but great..

* kidding *

~~~

Anyways,.. yes, I am anxious to see what kind of cool stuff you make.



~Kiyote!
Westbeam
Posts: 239
Joined: Dec 22, 2009 9:24
Contact:

Post by Westbeam »

Ive got a problem:
I can only load textures, when they are in the same directory as the source-code. When they are in another directory, you cannot see them.
:/
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Post by angros47 »

This is a bug of MiniB3d: it come from the fact that MiniB3d is derived from iMiniB3d, that has a subroutine that remove path info from file name.
Otherwise, many meshes that store texture name with path info would have crashed the library (because paths are managed in a different way under windows and posix)

For now, I haven't fixed it, since it requires a different fix for Windows and Linux version (because linux uses "/", windows uses "\").

Meanwhile, you can work around this bug by using "chdir".
I.E.

Code: Select all

chdir "data"
tex=loadtexture ("file.3ds")
chdir ".."
Post Reply