Just raylib for now. I think you could translate raygui to PureBasic code easily or code your own GUI.
I switched to using a module few days ago, and for the problematic names I currently just add "Raylib" to the function name, for example:
It's a few names that need to add something, all other functions can be used directly. It looks like this:
Code: Select all
UseModule ray
SetConfigFlags( #FLAG_MSAA_4X_HINT |
;#FLAG_FULLSCREEN_MODE |
#FLAG_VSYNC_HINT |
#FLAG_WINDOW_RESIZABLE )
SetTraceLogLevel(#LOG_NONE)
SetExitKey(#KEY_ESCAPE)
InitWindow( 1000, 500, "pbRaylib" )
If Not IsWindowReady() ; Error at init!
End
EndIf
SetTargetFPS(60)
Define camera.Camera3D
InitVector3( @camera\position, 0.0, 10, 15 )
InitVector3( @camera\target, 0.0, 0.0, 0.0 )
InitVector3( @camera\up, 0.0, 1.0, 0.0 )
camera\fovy = 30.0
camera\type = #CAMERATYPE_ORTHOGRAPHIC
camera\type = #CAMERATYPE_PERSPECTIVE
SetCameraMode(@camera, #CAMERAMODE_ORBITAL)
Define cube1.Vector3 : InitVector3( @cube1, 0.0, 1.01, 0.0 )
Define cube2.Vector3 : InitVector3( @cube2,-1.5, 0.51, 2.5 )
Define cube3.Vector3 : InitVector3( @cube3, 1.5, 1.51, 2.5 )
Define cube4.Vector3 : InitVector3( @cube4,-1.5, 0.51, -2.5 )
Define cube5.Vector3 : InitVector3( @cube5, 1.5, 0.61, -2.5 )
Define grnd.Vector3 : InitVector3( @grnd , 0.0,-0.05, 0.0 )
NewList cubes.Vector3()
AddElement(cubes())
InitVector3( @cubes(), 0.0, 2.52, 0.0 )
Define.Vector2 v1, v2, v3, v4
InitVector2( @v1, 0,200 ) : InitVector2( @v2,100,500 )
InitVector2( @v3,100,500 ) : InitVector2( @v4,400,800 )
Define sector.Vector2 : InitVector2(@sector,204,504)
Repeat
UpdateCamera(@camera)
BeginDrawing()
ClearBackground(#COLOR_RAYWHITE)
BeginMode3D(@camera)
DrawCube (@grnd ,10,0.09,10,RGBA($90,$90,$90,$FF))
DrawCube (@cube1,2, 2,2,RGBA($FF,$FF,$00,$FF))
DrawCubeWires(@cube1,2, 2,2,RGBA($00,$00,$00,$FF))
DrawCube (@cube2,1, 1,1,RGBA($FF,$00,$00,$FF))
DrawCubeWires(@cube2,1, 1,1,RGBA($00,$00,$00,$FF))
DrawCube (@cube3,1, 3,1,RGBA($00,$00,$FF,$FF))
DrawCubeWires(@cube3,1, 3,1,RGBA($00,$00,$00,$FF))
DrawCube (@cube4,1, 1,1,RGBA($00,$FF,$FF,$FF))
DrawCubeWires(@cube4,1, 1,1,RGBA($00,$00,$00,$FF))
DrawCube (@cube5,1,1.2,1,RGBA($FF,$00,$FF,$FF))
DrawCubeWires(@cube5,1,1.2,1,RGBA($00,$00,$00,$FF))
BeginBlendMode(#BLEND_ALPHA)
DrawCubeWires(@cubes(),1,1,1,RGBA($00,$00,$00,$FF))
DrawCube (@cubes(),1,1,1,RGBA($F0,$F0,$F0,$80))
EndBlendMode()
DrawGrid(20, 0.5)
EndMode3D()
DrawCircleGradient(200,200,100, RGBA($00,$00,$00,$FF),RGBA($FF,$FF,$00,$FF))
DrawEllipse (450,200,100,100,RGBA($00,$00,$00,$FF))
DrawEllipseLines (450,200,101,101,RGBA($FF,$FF,$00,$FF))
DrawEllipseLines (450,200,100,100,RGBA($FF,$FF,$00,$80))
DrawEllipseLines (450,200,102,102,RGBA($FF,$FF,$00,$80))
DrawRectangleGradientH(600,100,100,100,RGBA($00,$00,$00,$FF),RGBA($FF,$FF,$00,$FF))
DrawRectangleGradientV(750,100,100,100,RGBA($00,$00,$00,$FF),RGBA($FF,$FF,$00,$FF))
DrawLineBezier(@v1,@v2,3,RGBA($00,$FF,$FF,$FF))
DrawLineBezier(@v3,@v4,3,RGBA($00,$FF,$FF,$FF))
DrawCircleSector (@sector, 200, 0, 360, 8, RGBA($40,$40,$FF,$FF))
DrawCircleSectorLines(@sector, 200, 0, 360, 8, RGBA($00,$00,$00,$FF))
;DrawRectangle(5,8,83,23,RGBA($00,$00,$00,$FF))
DrawFPS(10,10)
EndDrawing()
If IsKeyPressed(#KEY_F1)
TakeScreenshot("example_004.png")
EndIf
Until WindowShouldClose() Or IsKeyDown(#KEY_ESCAPE)