Sidesign

BlitzMax Forums/BlitzMax Beginners Area/Sidesign

dw817(Posted 2016) [#1]
I would like to examine some code regarding a 3D dungeon program that Jeff Hanson wrote.

At the top it reads, "Import sidesign.minib3d"

Could someone please point me to a compiled and ready-to-go MOD library for this ?

Thanks.


kfprimm(Posted 2016) [#2]
https://github.com/si-design/minib3d

He doesn't provide a pre-compiled version though.

You'll need to setup MinGW to build it yourself.

Install TCC-GDM,

http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-5.1.0-3.exe/download

It should add GCC to your %PATH%. Confirm this by opening a command prompt and type "gcc -v" and press enter.

After that, add a "MINGW" environment variable to your system. Set it's value to "C:\TDM-GCC-32" (or whatever the path the installer sets).

http://www.computerhope.com/issues/ch000549.htm

Reboot your system, open MaxIDE, and you should now see the "Build Modules" menu item enabled.


dw817(Posted 2016) [#3]
Hmm ... a bit of work. Okay, downloaded the first link, I have a set of files in directory, "minib3d-master."



I'm not sure what to do with them or where they go.

TDM-GCC-64 Application Installed.

After that, add a "MINGW" environment variable to your system. Set it's value to "C:\TDM-GCC-32" (or whatever the path the installer sets).

How do I do this please, Kfprimm ?


kfprimm(Posted 2016) [#4]
Install TDM-GCC-32. TDM-GCC-64 may work, but TDM-GCC-32 should be a safe bet.

Copy sidesign.mod to C:\BlitzMax\mod.

To set the MINGW variable, please reference the link above.


dw817(Posted 2016) [#5]
Hokay, I want to do this right. TDM-GCC-64 uninstalled. TDM-GCC-32 installed.

Backing up main MOD directory for safety. Complete.

Copying sidesign.mod to BlitzMAX\MOD directory. Complete.

I don't know how to add a MINGW environment variable - so I'm stopped here again, Kfprimm.


kfprimm(Posted 2016) [#6]
To quote myself, quoting myself from another thread:


dw817, you need to pay attention to what people write.

To quote myself,

[quote]Remove your calls to Flip and see what happens. You may need to invoke glFlush to force the drawing operations to happen.

[/quote]


http://www.blitzbasic.com/Community/post.php?topic=105660&post=1290464


dw817(Posted 2016) [#7]
Oh, okay. Gimme a sec (missed the link). Advanced system settings. Really ? (Ready to lose my hard-drive ?) :D

Pha-hew ! This looks really nasty. Okay, o k a y ... got it !

Continuing, shutting down BlitzMAX, bringing it back up. Checking menu, no, it is still ghosted.

Here is what I have done so far.

[1] Downloaded TDM-GCC-5.1.0-3.exe
[2] Ran it, created installation of c:\TDM-GCC-32
[2] Copied sidesign.mod to main MOD directory (c:\david\blitzmax\mod)
[3] Searched for and found "Edit The System Environment Variables"
[4] Clicked on "Edit The System Environment Variables"
[5] Clicked on "Environment Variables"
[6] Added new Environment Variable called, "MINGW" (all caps)
[7] Gave it the value of, "C:\TDM-GCC-32" (also all caps)
[8] Shutdown MaxIDE
[9] Brought back up MaxIDE
[10] Did not see Build Modules available, only ghosted

Please let me know if this gets any easier, Kfprimm. :)


Bobysait(Posted 2016) [#8]

Please let me know if this gets any easier



As far as I remember, minib3d can be used as an "include", without the needs for mingw to compile as a module.

But, I have to say the last time I tried minib3d it was an earlier version I think. Maybe it's not possible anymore, but you should look into the "inc" directory.


ps : whatever it can or not be included, it's still a good thing to have mingw ready to compile modules.
> modules make things easier to recycle stuff.
Once you made a module of a SDK, you don't need anymore to include bunch of files, just an "Import MyModuleDir.MyModuleName" at the top of the bmx file and it's ready to compile.


kfprimm(Posted 2016) [#9]
That should be correct.

What happens when you type "gcc -v" into the command prompt?

When in doubt, reboot your system!


Kryzon(Posted 2016) [#10]
Doesn't this archive include the precompiled module? I've always downloaded it through here:
http://www.blitzbasic.com/file/get.php?file=/Products/demos/minib3d-v054.zip

(Taken from this thread: http://www.blitzbasic.com/Community/posts.php?topic=96521)


dw817(Posted 2016) [#11]
BUILD MODULES IS LIT !

Wow, it required me to completely reboot the computer ? *shaking head* Man !

But, it's up now. Okay, scanning back to top.

Just click and go, right ? OK. Seems like it's going to a-while, it's recompiling everything !

If I do this in the future, will it know not to recompile everything all over again ?

Kryzon, I hate to admit it but I think I needed this experience. HOWEVER, let's hope someone posts a BlitzMAX IDE and company in the future that includes all ghosted buttons to be LIT - so no-one has to go through what I did to today to open an option that was already part of BlitzMAX, just not available.

If for some reason this doesn't work I will definitely be checking out your pre-compiled package.


kfprimm(Posted 2016) [#12]
Bobysait, you're correct. Prior to the introduction of the C++ collision code taken from Blitz3D, it was pure bmx code so you didn't need MinGW.


kfprimm(Posted 2016) [#13]
dw817, correct. It will only recompile a particular module when changes are made.

I've updated my initial post with an instruction to reboot the computer for future reference.


dw817(Posted 2016) [#14]
Hope this isn't off topic, Kfprimm. What exactly is compiling ? (it's still going at it).

Is it taking source code in MOD and making EXE out of all of it ? Is it possible I can make some MOD libraries myself with this to share with others ?


kfprimm(Posted 2016) [#15]
When you installed BlitzMax from the installer, it included all the modules precompiled into static libraries. These files have a ".a" extension and like ".exe" files are binary code (as opposed to plain-text source code).

After you install BlitzMax, the timestamps are whacky for some reason (probably because the .a and .bmx have the exact same timestamp), and that causes BlitzMax to rebuild the modules. Going forward the ".a" files will be newer than the ".bmx" files, and won't be recompiled.

And yes, you can make your own modules. Google for some tutorials on how to do that. I believe the MaxIDE help section has one as well.


Bobysait(Posted 2016) [#16]
When you compile (or "pre-compile" is probably a better fit) for the first time, it pre-compiles all the modules (from brl and pub) generating the ".a" and ".i" files for debug and release.

Once it's done, it won't be required until you modify some modules.
> if you have a module to recompile, it will depend on dependencies
A "low-level" module will require all the modules that use it to be recompiled.

Generally, blitzmax deals pretty well with this, but it may happen that a dependencies doesn't get updated and use old references ...
If you have random bugs sometimes using a module, it may be the reason.


dw817(Posted 2016) [#17]
Yep, and BOOM, down in flames.

Tried this code (well really ANY code):
Print MilliSecs()
End
And I get a whole bunch of error messages:

Building untitled1
Compiling:untitled1.bmx
flat assembler version 1.68 (1048575 kilobytes memory)
3 passes, 2520 bytes.
Linking:untitled1.debug.exe
Warning: .drectve `-aligncomm:"_joyhandle",5' unrecognized
Warning: .drectve `-aligncomm:"_ReadStream",2 ' unrecognized
Warning: .drectve `-aligncomm:"_WriteStream",2 ' unrecognized
Warning: .drectve `-aligncomm:"_ccinfo",5 ' unrecognized
Warning: .drectve `-aligncomm:"_jerr",5' unrecognized
Warning: .drectve `-aligncomm:"_stdin_",2 ' unrecognized
Warning: .drectve `-aligncomm:"_stdout_",2 ' unrecognized
Warning: .drectve `-aligncomm:"_stderr_",2' unrecognized
Warning: .drectve `-aligncomm:"_bbGCStackTop",2 ' unrecognized
etc ...


Good thing I backed up MOD before I began.

Here are the versions bringing up HELP:

BCC Version: BlitzMax Release Version 1.36
BlitzMAX Path: c:\david\BlitzMax
MinGZW Path: c:\TDM-GCC-32
FASM Version: 168
GCC Version: 5.1.0
G++ Version: 5.1.0

What now, sahib ?

Shut down BlitzMAX
renamed MOD to !MOD
Recovered original backed up MOD, copied over single directory "sidesign.mod"

Brought back up BlitzMAX
Re-ran Dungeon ... it works !

Ok, this is pretty neat stuff, I've never written a 3D game before - and now I have some code to look at and see if any of it's wisdom will rub off on me.

Think that's it guys, program is now running ! (purpose of the exercise).

Not sure why the botched (now renamed to !mod directory messes everything up).

Would it be of benefit for me to zip up my current MOD directory for others so they have ready access to Sidesign library where they don't have to go through what I did to get mine up and running ?

Outside of that, I've got a little catching up to do in programming with these new tools in place. Thanks for all your help ! :)


skidracer(Posted 2016) [#18]
It sounds like a bad version of mingw. Even the official howto here seems to link to an outdated version of mingw.

I suggest using the link in the readme of this page.