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
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: MiniB3d for FreeBasic

Post by D.J.Peters »

@Gunslinger you never posted the problem of .3ds loading with my build of the lib.
The right forum section is libOpenB3D-1.25 not MiniB3d !
How ever I will look for the problem on weekend, but I self never changed or used the 3ds loader before.

Joshy
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: MiniB3d for FreeBasic

Post by D.J.Peters »

It works with libOpenB3D-1.25 from 2019 tested on Windows and Linux both 32 and 64-bit !
I upload "fighter.3ds" in the zip file see LoadMesh.bas.
By the way your code is "2018" you have to read the notes about changes in the "openb3d.bi" file.

Again "MiniB3d or OpenB3d" and "libOpenB3D" isn't the same !

Both use the C++ library but the interface are different.
For example in my build RGBA colors are in range of 0.0 - 1.0 each
while the other or original interface use 0-255 for RGB but 0.0-1.0 for A.

Use MiniB3d/OpenB3d if it the right for you
but if you use "libOpenB3D-1.25" use the right forum section for any questions or problems.

Happy 3D coding.

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

Re: MiniB3d for FreeBasic

Post by angros47 »

First attempt to add sound support to OpenB3D

https://sourceforge.net/projects/minib3 ... p/download
IvanisIvan
Posts: 44
Joined: Nov 07, 2019 21:57

Re: MiniB3d for FreeBasic

Post by IvanisIvan »

How do I install a Library to FBIDE?
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: MiniB3d for FreeBasic

Post by MrSwiss »

IvanisIvan wrote:How do I install a Library to FBIDE?
Sorry, but the question is 'all wrong'.
Libraries are installed into the Compiler-Tree (FBC's file structure) and not any IDE.

E.g.: you have FBC (64 bit) in C:\FreeBASIC\fbc.exe (and more files) then
Libraries go to C:\FreeBASIC\lib\win64\ (..\win32\ for 32 bit FBC)
(just a example for a Windows installation)
Important: the bitness of compiler and libraries must be the same (mandatory).
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: MiniB3d for FreeBasic

Post by dodicat »

Put the library file (.a or .dll) into the same folder as your code calling it.
It will work perfectly well this way.
If you really like the library (static .a), then do as Mr Swiss advises.
Any .dll you like you can put into your system folder (system32 windows) and put the .dll.a file into the lib folder as Mr Swiss advises.
FB will always produce a .dll.a file if you create a .dll with fb.
Otherwise you will have to create your own with dlltool.exe and gendef.exe.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: MiniB3d for FreeBasic

Post by jj2007 »

IvanisIvan wrote:How do I install a Library to FBIDE?
Hi Ivan,

As an example, the Cairo library would sit in two locations:
C:\MyBasics\FreeBasic\lib\win32\Cairo\*.dll
C:\MyBasics\FreeBasic\inc\Cairo\*.bi

Once the necessary files sit there, you can compile e.g. C:\MyBasics\FreeBasic\lib\win32\Cairo\line.bas (if you do it from other locations, it will not find the necessary includes, unless you manually set the PATH variables).

P.S.:
MrSwiss wrote:Sorry, but the question is 'all wrong'.
Ignore him ;-)
IvanisIvan
Posts: 44
Joined: Nov 07, 2019 21:57

Re: MiniB3d for FreeBasic

Post by IvanisIvan »

jj2007 wrote:
IvanisIvan wrote:How do I install a Library to FBIDE?
Hi Ivan,

As an example, the Cairo library would sit in two locations:
C:\MyBasics\FreeBasic\lib\win32\Cairo\*.dll
C:\MyBasics\FreeBasic\inc\Cairo\*.bi

Once the necessary files sit there, you can compile e.g. C:\MyBasics\FreeBasic\lib\win32\Cairo\line.bas (if you do it from other locations, it will not find the necessary includes, unless you manually set the PATH variables).

P.S.:
MrSwiss wrote:Sorry, but the question is 'all wrong'.
Ignore him ;-)
Thank you! If I could upvote this, I would. :D
IvanisIvan
Posts: 44
Joined: Nov 07, 2019 21:57

Re: MiniB3d for FreeBasic

Post by IvanisIvan »

I'm going to sound real stupid but I can't seem to find minib3d.bi. I downloaded the zip file from https://sourceforge.net/projects/minib3d/. Please tell me what I am doing wrong.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: MiniB3d for FreeBasic

Post by jj2007 »

IvanisIvan
Posts: 44
Joined: Nov 07, 2019 21:57

Re: MiniB3d for FreeBasic

Post by IvanisIvan »

jj2007 wrote:Try this post: viewtopic.php?f=14&t=27233
thank you, that was very helpful!
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Re: MiniB3d for FreeBasic

Post by angros47 »

IvanisIvan wrote:I can't seem to find minib3d.bi
In the later version it's called openb3d.bi
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Re: MiniB3d for FreeBasic

Post by angros47 »

@D.J.Peters

In the past you complained that in 64 bit mode the words "near" and "far" used in octree.h and octree.cpp prevent compilation, and I replied that I was able to compile in 64 bit with no issues. I realized now that the issue occurs only under some compilers in windows, and it doesn't depend on the fact that near and far are reserved words, but on the fact that they are defined to nothing in the file minwindef.h (so the variable names are removed by the preprocessor). That happens to help compiling old, 16 bit source codes still designed for Windows 3.1

So, the simplest fix is to #undef near and far in the file octree.h
angros47
Posts: 2323
Joined: Jun 21, 2005 19:04

Re: MiniB3d for FreeBasic

Post by angros47 »

New version is online. Some minor fixes, no new features added, besides the fact that now it should be usable with FreeBasic Emscripten branch

Also, with make is now possible to use "make static" to compile a version for static linking (under Linux, it works well, under Windows, it requires you to have the same version of mingw for the C++ compiler and for FreeBasic: since FreeBasic carries its own version of Mingw, this is not always true)
ITomi
Posts: 154
Joined: Jul 31, 2015 11:23
Location: Hungary

Re: MiniB3d for FreeBasic

Post by ITomi »

Hello!

I have a problem with MiniB3d:
first, I create a texture:

Code: Select all

walltexture=loadtexture("pics\brickwall.jpg")
then, after I create an entity and scale it to bigger, I add this texture to this entity:

Code: Select all

borderwalls(0).image=CreateCube()
ScaleEntity borderwalls(0).image,wallwidth*pixels,1,1
EntityTexture borderwalls(0).image,walltexture
The borderwall will be enough width, and the texture stretching on it and I don't want this, because I would like a repeating texture on this width wall, not a coloured, long strip.
I tried solve this with using flag 16 in the loadtexture, but the result is the same. I don't know, what's wrong: my technique or the version of MiniB3d doesn't be able to this yet? Version of my MiniB3d is 1.1.
Post Reply