MiniB3d for FreeBasic
-
- Posts: 289
- Joined: Oct 10, 2006 7:19
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
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
-
- Posts: 289
- Joined: Oct 10, 2006 7:19
-
- Posts: 289
- Joined: Oct 10, 2006 7:19
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
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)
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
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.
http://www.file-pasta.com/file/0/miniB3 ... r%20FB.zip
it includes a flight simulator, to show how easy is it.
-
- Posts: 1009
- Joined: Oct 11, 2008 7:42
- Location: ABQ, NM
- Contact:
@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)
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)
-
- Posts: 1009
- Joined: Oct 11, 2008 7:42
- Location: ABQ, NM
- Contact:
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.
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 ".."