I started to wrap Xors3D Engine for my projects and there were some problems.
Some info about xors3d.dll: all functions using stdcall calling convention.
My wrappers code (xors3d.inc):
Alias Long As tHandle
' Test Function for Working
Declare Sub xGraphics3D Lib "xors3d.dll" Alias "_xGraphics3D@20" (_
ByVal scr_width As Long,_
ByVal scr_height As Long,_
ByVal scr_depth As Long,_
ByVal scr_mode As Long,_
ByVal scr_vsync As Long)
Declare Sub xAppTitle Lib "xors3d.dll" Alias "_xAppTitle@4" (ByVal title As Asciiz)
Declare Sub xSetBuffer Lib "xors3d.dll" Alias "_xSetBuffer@4" (ByVal buffer As tHandle)
Declare Function xBackBuffer Lib "xors3d.dll" Alias "_xBackBuffer@0" () As tHandle
Declare Sub xFlip Lib "xors3d.dll" Alias "_xFlip@0" ()
Declare Function xKeyHit Lib "xors3d.dll" Alias "_xKeyHit@4" (ByVal key As Long) As Long
Declare Function xWinMessage Lib "xors3d.dll" Alias "_xWinMessage@4" (ByVal message As Asciiz) As Long
Declare Sub xReleaseGraphics Lib "xors3d.dll" Alias "_xReleaseGraphics@0" ()
' Brushes commands
Declare Function xLoadBrush Lib "xors3d.dll" Alias "_xLoadBrush@16" (_
ByVal path As Asciiz,_
ByVal flags As Long,_
ByVal xScale As Single,_
ByVal yScale As Single) As tHandle
My project code example (test_wrapper.tbasic):
#INCLUDE "%APP_INCLUDEPATH%\xors3d.inc"
xAppTitle("Тестируем Xors3D")
xGraphics3D(800, 600, 32, 0, 1)
xSetBuffer(xBackBuffer())
While xKeyHit(%xKEY_ESCAPE) = 0
xFlip()
If xWinMessage("WM_CLOSE") Then Exit While
Wend
xReleaseGraphics()
End
When I trying execute script, i have bug (see atachments).
screenshot.png
Wrapper files (*.tbasic, *.inc, *.dll):
http://dark5132007.narod.ru/wrapper.rar
Bookmarks