Blitz3D FASM SDK (Assembler x86)


👉 BlitzCoder will be building a new platform and other plans to preserve and continue the Blitz legacy.

To be able to achieve this goal, we need your support by becoming a Patreon Paid Member 👈

 

Tweet code-archives
X32E

Example of code:

Blitz3D FASM SDK:
https://github.com/Blitz3DFASM/Blitz3DFASMSDK

B3D.dll link:
https://www.blitzcoder.org/forum/topic.php?id=922

Example of code:

 ;******************************************************
 ;*                  Blitz3D on FASM                   *
 ;******************************************************

 format PE GUI 4.0
 entry start

 include 'win32a.inc'
 include 'blitz3dsdk.inc'

 ; ------------------------ data -----------------------
 section '.data' data readable writeable

 buffer BBCanvas 0
 camera BBCamera 0
 light BBLight 0

 cone BBModel 0
 cube BBModel 0
 sphere BBModel 0

 title db 'Blitz3D 3D Graphics Exmple on FASM', 0
 text db 'Class of cube is: ', 0
 empty_str db 0
 class_name dd 0      ; Pointer to string

 ; ------------------------- code ------------------------
 section '.code' code readable executable

 start:
       cinvoke bbBeginBlitz3D
       cinvoke bbSetBlitz3DTitle, title, empty_str
       cinvoke bbGraphics3D, 640, 480, 32, 3

       cinvoke bbBackBuffer
       mov [buffer],eax
       cinvoke bbSetBuffer, [buffer]

       cinvoke bbCreateCamera, 0            ; paerent 0
       mov [camera], eax
       cinvoke bbCreateLight, 1, 0          ; 1 - direct light, parent null
       mov [light], eax

       cinvoke bbCreateCone, 32, BBTRUE, 0  ; 32 segments, solid, parent null
       mov [cone], eax
       cinvoke bbPositionEntity, [cone], -3f, 0f, 5f
       cinvoke bbEntityColor, [cone], 255f, 32f, 32f

       cinvoke bbCreateCube, 0              ; parent null
       mov [cube], eax
       cinvoke bbPositionEntity, [cube], 0f, 0f, 6.5f
       cinvoke bbEntityColor, [cube], 70f, 155f, 30f

       cinvoke bbCreateSphere, 7, 0         ; detail level - 7, parent null
       mov [sphere], eax
       cinvoke bbPositionEntity, [sphere], 3f, 0f, 5f
       cinvoke bbEntityColor, [sphere], 0f, 128f, 255f

       cinvoke bbEntityClass, [cube]
       mov [class_name], eax    ; Save pointer to string

 main_loop:
       cinvoke bbKeyHit, KEY_ESCAPE ; Wait Esc
       or eax, eax
       jnz exit_from_main_loop

       cinvoke bbTurnEntity, [cube], 0.5f, 2f, 1f
       cinvoke bbTurnEntity, [cone], 0f, 1f, 0.5f
       cinvoke bbTurnEntity, [sphere], 2f, 1f, 0.5f

       cinvoke bbRenderWorld, 1     ; Render world to buffer

       cinvoke bbFlip, BBTRUE       ; Flip buffers
       jmp main_loop;
 exit_from_main_loop:
       cinvoke bbEndBlitz3D
       invoke ExitProcess,0

 section '.idata' import data readable writeable

 library kernel32,'KERNEL32.DLL',\
        user32,'USER32.DLL',\
        b3d,'B3D.DLL'

        include 'api\kernel32.inc'
        include 'api\user32.inc'
        include 'b3d.inc'

 section '.rsrc' resource data readable
        ICON equ '3D.ico'
        include 'res.inc'
X32E commented:

To administrators: it is not clear why you moved this topic to Blitz3D programming, this topic does not concern the Basic language in any way. Here we are talking about programming B3D.dll lib in the x86 assembly language with using FASM ( Flat Assembler ) compilator.

Therefore, it would be more logical to return the topic to the section MiniB3d/OpenB3D https://www.blitzcoder.org/forum/topics.php?category=1

BlitzCoder commented:

Welcome to the forums X32E and thanks for sharing this interesting library.

Here we are talking about programming B3D.dll lib in the x86 assembly language with using FASM ( Flat Assembler ) compilator.

MiniB3D/OpenB3D are both derived OpenGL projects of Blitz3D and has nothing to do with Blitz3D SDK.
This library is also referring to the Blitz3D SDK DLL, which is more like Blitz3D/DX7.

Therefore, it would be more logical to return the topic to the section MiniB3d/OpenB3D https://www.blitzcoder.org/forum/topics.php?category=1

That points to BlitzMax programming, not MiniB3D/OpenB3D so yes moving to this subforum since this uses FASM which is the closest thing.

X32E commented:

Hi, why i can not change topic post? For example to update image and url links. Such restrictions very unusable.

BlitzCoder commented:

It does have an edit feature, but with expiration of 1 week. You should add a code-archive tag which will extend it to 3 months of editing and since it fits with your topic.

Just added the tag so you can now edit it. Next time, your recent reply should be posted in the Report an Issue (link below).

Reply To Topic (minimum 10 characters)

Please log in to reply