Here is a project I made with the demo version of PureBasic. It is a wrapper for the Sigil Library, it is a fairly small and simple project. Sigil is a simple multimedia library for programming things like games and such.
More about Sigil here: https://gitlab.com/geoff-nagy/sigil/-/tree/master/
PB file and needed DLLs
https://katfile.com/otpr772l0izu/PBSigil.zip.html
PB Code File
Code: Select all
;Sigil PureBasic Wrapper
;Written By Andy P.
;Icy Viking Games
;Copyright (c) 2023
;Global Var
#SIGIL_D = 0
;Flags/Constants
#SL_ALIGN_CENTER = 0
#SL_ALIGN_RIGHT = 1
#SL_ALIGN_LEFT = 2
#SL_KEY_ESCAPE = 256
#SL_KEY_ENTER = 257
#SL_KEY_TAB = 258
#SL_KEY_BACKSPACE = 259
#SL_KEY_INSERT = 260
#SL_KEY_DELETE = 261
#SL_KEY_RIGHT = 262
#SL_KEY_LEFT = 263
#SL_KEY_DOWN = 264
#SL_KEY_UP = 265
#SL_KEY_PAGE_UP = 266
#SL_KEY_PAGE_DOWN = 267
#SL_KEY_HOME = 268
#SL_KEY_END = 269
#SL_KEY_CAPS_LOCK = 280
#SL_KEY_SCROLL_LOCK = 281
#SL_KEY_NUM_LOCK = 282
#SL_KEY_PRINT_SCREEN = 283
#SL_KEY_PAUSE = 284
#SL_KEY_F1 = 290
#SL_KEY_F2 = 291
#SL_KEY_F3 = 292
#SL_KEY_F4 = 293
#SL_KEY_F5 = 294
#SL_KEY_F6 = 295
#SL_KEY_F7 = 296
#SL_KEY_F8 = 297
#SL_KEY_F9 = 298
#SL_KEY_F10 = 299
#SL_KEY_F11 = 300
#SL_KEY_F12 = 301
#SL_KEY_F13 = 302
#SL_KEY_F14 = 303
#SL_KEY_F15 = 304
#SL_KEY_F16 = 305
#SL_KEY_F17 = 306
#SL_KEY_F18 = 307
#SL_KEY_F19 = 308
#SL_KEY_F20 = 309
#SL_KEY_F21 = 310
#SL_KEY_F22 = 311
#SL_KEY_F23 = 312
#SL_KEY_F24 = 313
#SL_KEY_F25 = 314
#SL_KEY_KEYPAD_0 = 320
#SL_KEY_KEYPAD_1 = 321
#SL_KEY_KEYPAD_2 = 322
#SL_KEY_KEYPAD_3 = 323
#SL_KEY_KEYPAD_4 = 324
#SL_KEY_KEYPAD_5 = 325
#SL_KEY_KEYPAD_6 = 326
#SL_KEY_KEYPAD_7 = 327
#SL_KEY_KEYPAD_8 = 328
#SL_KEY_KEYPAD_9 = 329
#SL_KEY_KEYPAD_DECIMAL = 330
#SL_KEY_KEYPAD_DIVIDE = 331
#SL_KEY_KEYPAD_MULTIPLY = 332
#SL_KEY_KEYPAD_SUBTRACT = 333
#SL_KEY_KEYPAD_ADD = 334
#SL_KEY_KEYPAD_ENTER = 335
#SL_KEY_KEYPAD_EQUAL = 336
#SL_KEY_LEFT_SHIFT = 340
#SL_KEY_LEFT_CONTROL = 341
#SL_KEY_LEFT_ALT = 342
#SL_KEY_LEFT_SUPER = 343
#SL_KEY_RIGHT_SHIFT = 344
#SL_KEY_RIGHT_CONTROL = 345
#SL_KEY_RIGHT_ALT = 346
#SL_KEY_RIGHT_SUPER = 347
#SL_MOUSE_BUTTON_1 = 0
#SL_MOUSE_BUTTON_2 = 1
#SL_MOUSE_BUTTON_3 = 2
#SL_MOUSE_BUTTON_4 = 3
#SL_MOUSE_BUTTON_5 = 4
#SL_MOUSE_BUTTON_6 = 5
#SL_MOUSE_BUTTON_7 = 6
#SL_MOUSE_BUTTON_8 = 7
#SL_MOUSE_BUTTON_LEFT = #SL_MOUSE_BUTTON_1
#SL_MOUSE_BUTTON_RIGHT = #SL_MOUSE_BUTTON_2
#SL_MOUSE_BUTTON_MIDDLE = #SL_MOUSE_BUTTON_3
;Prototypes
Prototype ProtoslWindow(width.i,height.i,title.s,fullScreen.i)
Prototype ProtoslShowCursor(showCursor.i)
Prototype ProtoslClose()
Prototype.I ProtoslShouldClose()
Prototype.I ProtoslGetKey(key.i)
Prototype.I ProtoslGetMouseButton(button.i)
Prototype.I ProtoslGetMouseX()
Prototype.I ProtoslGetMouseY()
Prototype.D ProtoslGetDeltaTime()
Prototype.D ProtoslGetTime()
Prototype ProtoslRender()
Prototype ProtoslSetBackColor(red.d,green.d,blue.d)
Prototype ProtoslSetForeColor(red.d,green.d,blue.d,alpha.d)
Prototype ProtoslSetAdditiveBlend(ab.i)
Prototype ProtoslPush()
Prototype ProtoslPop()
Prototype ProtoslTranslate(x.d,y.d)
Prototype ProtoslRotate(degrees.d)
Prototype ProtoslScale(x.d,y.d)
Prototype.I ProtoslLoadTexture(filename.s)
Prototype.I ProtoslLoadWAV(filename.s)
Prototype.I ProtoslSoundPlay(sound.i)
Prototype.I ProtoslSoundLoop(sound.i)
Prototype ProtoslSoundPause(sound.i)
Prototype ProtoslSoundStop(sound.i)
Prototype ProtoslSoundPauseAll()
Prototype ProtoslSoundResumeAll()
Prototype ProtoslSoundStopAll()
Prototype.I ProtoslSoundPlaying(sound.i)
Prototype.I ProtoslSoundLooping(sound.i)
Prototype ProtoslTriangleFill(x.d,y.d,width.d,height.d)
Prototype ProtoslTriangleOutline(x.d,y.d,width.d,height.d)
Prototype ProtoslRectangleFill(x.d,y.d,width.d,height.d)
Prototype ProtoslRectangleOutline(x.d,y.d,width.d,height.d)
Prototype ProtoslCircleFill(x.d,y.d,radius.d,numVerts.i)
Prototype ProtoslCircleOutline(x.d,y.d,radius.d,numVerts.i)
Prototype ProtoslSemiCircleFill(x.d,y.d,radius.d,numVerts.i,degrees.d)
Prototype ProtoslSemiCircleOutline(x.d,y.d,radius.d,numVerts.i,degrees.d)
Prototype ProtoslPoint(x.d,y.d)
Prototype ProtoslLine(x1.d,y1.d,x2.d,y2.d)
Prototype ProtoslSetSpriteTiling(x.d,y.d)
Prototype ProtoslSetSpriteScroll(x.d,y.d)
Prototype ProtoslSprite(texture.i,x.d,y.d,width.d,height.d)
Prototype ProtoslSetTextAlign(fontAlign.i)
Prototype ProtoslGetTextWidth(text.s)
Prototype ProtoslGetTextHeight(text.s)
Prototype ProtoslLoadFont(fontFileName.s)
Prototype ProtoslSetFont(font.i,fonstSize.i)
Prototype ProtoslSetFontSize(fontsize.i)
Prototype ProtoslText(x.d,y.d,text.s)
;DLL Calls
If OpenLibrary(#SIGIL_D,"sigil.dll")
slWindow.ProtoslWindow = GetFunction(#SIGIL_D,"slWindow")
slShowCursor.ProtoslShowCursor = GetFunction(#SIGIL_D,"slShowCursor")
slClose.ProtoslClose = GetFunction(#SIGIL_D,"slClose")
slShouldClose.ProtoslShouldClose = GetFunction(#SIGIL_D,"slShouldClose")
slGetKey.ProtoslGetKey = GetFunction(#SIGIL_D,"slGetKey")
slGetMouseButton.ProtoslGetMouseButton = GetFunction(#SIGIL_D,"slGetMouseButton")
slGetMouseX.ProtoslGetMouseX = GetFunction(#SIGIL_D,"slGetMouseX")
slGetMouseY.ProtoslGetMouseY = GetFunction(#SIGIL_D,"slGetMouseY")
slRender.ProtoslRender = GetFunction(#SIGIL_D,"slRender")
slSetBackColor.ProtoslSetBackColor = GetFunction(#SIGIL_D,"slSetBackColor")
slSetForeColor.ProtoslSetForeColor = GetFunction(#SIGIL_D,"slSetForeColor")
slSetAdditiveBlend.ProtoslSetAdditiveBlend = GetFunction(#SIGIL_D,"slSetAdditiveBlend")
slPush.ProtoslPush = GetFunction(#SIGIL_D,"slPush")
slPop.ProtoslPop = GetFunction(#SIGIL_D,"slPop")
slTranslate.ProtoslTranslate = GetFunction(#SIGIL_D,"slTranslate")
slRotate.ProtoslRotate = GetFunction(#SIGIL_D,"slRotate")
slScale.ProtoslScale = GetFunction(#SIGIL_D,"slScale")
slLoadTexture.ProtoslLoadTexture = GetFunction(#SIGIL_D,"slLoadTexture")
slLoadWAV.ProtoslLoadWAV = GetFunction(#SIGIL_D,"slLoadWAV")
slSoundPlay.ProtoslSoundPlay = GetFunction(#SIGIL_D,"slSoundPlay")
slSoundLoop.ProtoslSoundLoop = GetFunction(#SIGIL_D,"slSoundLoop")
slSoundPause.ProtoslSoundPause = GetFunction(#SIGIL_D,"slSoundPause")
slSoundStop.ProtoslSoundStop = GetFunction(#SIGIL_D,"slSoundStop")
slSoundPauseAll.ProtoslSoundPauseAll = GetFunction(#SIGIL_D,"slSoundPauseAll")
slSoundResumeAll.ProtoslSoundResumeAll = GetFunction(#SIGIL_D,"slSoundResumeAll")
slSoundStopAll.ProtoslSoundStopAll = GetFunction(#SIGIL_D,"slSoundStopAll")
slSoundPlaying.ProtoslSoundPlaying = GetFunction(#SIGIL_D,"slSoundPlaying")
slSoundLooping.ProtoslSoundLooping = GetFunction(#SIGIL_D,"slSoundLooping")
slTriangleFill.ProtoslTriangleFill = GetFunction(#SIGIL_D,"slTriangleFill")
slTriangleOutline.ProtoslTriangleOutline = GetFunction(#SIGIL_D,"slTriangleOutline")
slRectangleFill.ProtoslRectangleFill = GetFunction(#SIGIL_D,"slRectangleFill")
slRectangleOutline.ProtoslRectangleOutline = GetFunction(#SIGIL_D,"slRectangleOutline")
slCircleFill.ProtoslCircleFill = GetFunction(#SIGIL_D,"slCircleFill")
slCircleOutline.ProtoslCircleOutline = GetFunction(#SIGIL_D,"slCircleOutline")
slSemiCircleFill.ProtoslSemiCircleFill = GetFunction(#SIGIL_D,"slSemiCircleFill")
slSemiCircleOutline.ProtoslSemiCircleOutline = GetFunction(#SIGIL_D,"slSemiCircleOutline")
slPoint.ProtoslPoint = GetFunction(#SIGIL_D,"slPoint")
slLine.ProtoslLine = GetFunction(#SIGIL_D,"slLine")
slSetSpriteTiling.ProtoslSetSpriteTiling = GetFunction(#SIGIL_D,"slSetSpriteTiling")
slSetSpriteScroll.ProtoslSetSpriteScroll = GetFunction(#SIGIL_D,"slSetSpriteScroll")
slSprite.ProtoslSprite = GetFunction(#SIGIL_D,"slSprite")
slSetTextAlign.ProtoslSetTextAlign = GetFunction(#SIGIL_D,"slSetTextAlign")
slGetTextWidth.ProtoslGetTextWidth = GetFunction(#SIGIL_D,"slGetTextWidth")
slGetTextHeight.ProtoslGetTextHeight = GetFunction(#SIGIL_D,"slGetTextHeight")
slLoadFont.ProtoslLoadFont = GetFunction(#SIGIL_D,"slLoadFont")
slSetFont.ProtoslSetFont = GetFunction(#SIGIL_D,"slSetFont")
slSetFontSize.ProtoslSetFontSize = GetFunction(#SIGIL_D,"slSetFontSize")
slText.ProtoslText = GetFunction(#SIGIL_D,"slText")
;Simple Example
slWindow(800,600,"Hello",0)
While Not slShouldClose()
If slGetKey(#SL_KEY_ESCAPE)
slClose()
EndIf
slRender()
Wend
slClose()
CloseLibrary(#SIGIL_D)
EndIf