LibSGD (vom Blitz3d Programmierer)

Du brauchst Grafiken, gute Programme oder Leute die dir helfen? Frag hier.
Benutzeravatar
mpz
Beiträge: 505
Registriert: 14.06.2005 15:53
Computerausstattung: Win 11 Pro, 48 GB Ram, Intel I7 CPU und RX4070 Grafikkarte, PB (4/5) 6.12LT
Wohnort: Berlin, Tempelhof

LibSGD (vom Blitz3d Programmierer)

Beitrag von mpz »

Hallo,
mit grossem Bedauern muss ich den Tod von Marc Sibley vermelden. Ich hatte sein erstes Programm Blitzbasic auf dem Amig in den 80ziger Jahren erworben. Zu diesem Zeitpunkt gab es nur Turbobasic auf dem PC ohne irgenwelche Grafik, brrr. Bevor ich zu Purebasic kam, hatte ich später mit Blitzbasic 3D auf dem PC gearbeitet. Mein Traum war es immer die Blitz3D Grafik Funktionalität mit Purebasic zu verwendet, was ich mit der LIBSGD endlich hatte. Aber dann passierte das mit Marc. Ich kam 2 Wochen zu spät in das Forum und hatte keine Möglichkeit mehr mit Marc zu chatten. :(

Welcome to LibSGD
LibSGD is a simple game development library that provides a high level, easy to use 'scene graph' style API for writing games and apps.
https://github.com/blitz-research/libsgd

Zukunft:
Und nun versuchen die Anwender von libSGD eine Lösung zu finden. Ich habe mit dem Quellcode eine neue dll version 0.18 erzeugt und werde diese Version mit neuen Beispielen unter meine github Account veröffentlichen.
- Mein Problem ist es nur eine Unicode version und vielleicht sogar eine static lib version daraus zu erzeugen.

Ein vollständig compilierbare Version 0.18 liegt hier vor
https://github.com/blitz-research/libsgd/tree/develop
Wer also Lust und Ahnung hat hier mitzuhelfen ist herzlichst willkommen...

Ich habe die neuste Version libSGD v0.18 für Purebasic zum sofortigen vewenden angepasst und auch die Assets Dateien zum download bereitgestellt.
https://github.com/MPzCodes/LibSGD/tree ... rsion-0.18

Viel Spass damit

Leider benutzt Mark Text Variablen als ASCII Code, so dass man Text umwandeln muss (Kein Unicode).
Gruss

Bild
Bild
Bild
Zuletzt geändert von mpz am 30.12.2024 05:07, insgesamt 8-mal geändert.
Working on :lol: - LibSGD - MP3D Engine - 8)
Benutzeravatar
mpz
Beiträge: 505
Registriert: 14.06.2005 15:53
Computerausstattung: Win 11 Pro, 48 GB Ram, Intel I7 CPU und RX4070 Grafikkarte, PB (4/5) 6.12LT
Wohnort: Berlin, Tempelhof

Re: LibSGD (vom Blitz3d Programmierer)

Beitrag von mpz »

Hallo,

So hier mal zum Testen und Einstieg ein paar Informationen um unter Purebasic 6.12 LT x64 mit der libsgd zu arbeiten:

1) https://github.com/blitz-research/libsgd
kann man mit der Anleitung selber eine x64 "sgd_dynamic.dll" zu erstellen.
- Die lib gibt es für MAC und für Linux, und ich bin dabei zu schauen ob ich ein static lib hinbekomme. Leider fehlt mir hier das Wissen aber was nicht ist kann ja noch werden...

2) Wer das nicht hinbekommt kann für 2,8 Euro pro Monat Patreon werden und immer die neuste compilierten Version zu laden:
Help support LibSGD at https://patreon.com/libsgd

3) Ich habe für die Version LibSGD v0.17.1 die dll (mehr Schlecht als Recht) eingebunden und veröffentliche hier zum testen die ersten Version mit zwei Demos. Wer das optimieren möchte ist herzlichst eingeladen das zu tun...

Gruss Michael

Hier die init Dateien

keycodes.pb

Code: Alles auswählen

; Note: The content of this file and sgd.bb will eventually by baked into Blitz3D runtime.dll

#KEY_SPACE = 32
#KEY_APOSTROPHE = 39
#KEY_COMMA = 44
#KEY_MINUS = 45
#KEY_PERIOD = 46
#KEY_SLASH = 47
#KEY_0 = 48
#KEY_1 = 49
#KEY_2 = 50
#KEY_3 = 51
#KEY_4 = 52
#KEY_5 = 53
#KEY_6 = 54
#KEY_7 = 55
#KEY_8 = 56
#KEY_9 = 57
#KEY_SEMICOLON = 59
#KEY_EQUAL = 61
#KEY_A = 65
#KEY_B = 66
#KEY_C = 67
#KEY_D = 68
#KEY_E = 69
#KEY_F = 70
#KEY_G = 71
#KEY_H = 72
#KEY_I = 73
#KEY_J = 74
#KEY_K = 75
#KEY_L = 76
#KEY_M = 77
#KEY_N = 78
#KEY_O = 79
#KEY_P = 80
#KEY_Q = 81
#KEY_R = 82
#KEY_S = 83
#KEY_T = 84
#KEY_U = 85
#KEY_V = 86
#KEY_W = 87
#KEY_X = 88
#KEY_Y = 89
#KEY_Z = 90
#KEY_LEFT_BRACKET = 91
#KEY_BACKSLASH = 92
#KEY_RIGHT_BRACKET = 93
#KEY_GRAVE_ACCENT = 96
#KEY_WORLD_1 = 161
#KEY_WORLD_2 = 162

#KEY_ESCAPE = 256
#KEY_ENTER = 257
#KEY_TAB = 258
#KEY_BACKSPACE = 259
#KEY_INSERT = 260
#KEY_DELETE = 261
#KEY_RIGHT = 262
#KEY_LEFT = 263
#KEY_DOWN = 264
#KEY_UP = 265
#KEY_PAGE_UP = 266
#KEY_PAGE_DOWN = 267
#KEY_HOME = 268
#KEY_END = 269
#KEY_CAPS_LOCK = 280
#KEY_SCROLL_LOCK = 281
#KEY_NUM_LOCK = 282
#KEY_PRINT_SCREEN = 283
#KEY_PAUSE = 284
#KEY_F1 = 290
#KEY_F2 = 291
#KEY_F3 = 292
#KEY_F4 = 293
#KEY_F5 = 294
#KEY_F6 = 295
#KEY_F7 = 296
#KEY_F8 = 297
#KEY_F9 = 298
#KEY_F10 = 299
#KEY_F11 = 300
#KEY_F12 = 301
#KEY_F13 = 302
#KEY_F14 = 303
#KEY_F15 = 304
#KEY_F16 = 305
#KEY_F17 = 306
#KEY_F18 = 307
#KEY_F19 = 308
#KEY_F20 = 309
#KEY_F21 = 310
#KEY_F22 = 311
#KEY_F23 = 312
#KEY_F24 = 313
#KEY_F25 = 314
#KEY_KP_0 = 320
#KEY_KP_1 = 321
#KEY_KP_2 = 322
#KEY_KP_3 = 323
#KEY_KP_4 = 324
#KEY_KP_5 = 325
#KEY_KP_6 = 326
#KEY_KP_7 = 327
#KEY_KP_8 = 328
#KEY_KP_9 = 329
#KEY_KP_DECIMAL = 330
#KEY_KP_DIVIDE = 331
#KEY_KP_MULTIPLY = 332
#KEY_KP_SUBTRACT = 333
#KEY_KP_ADD = 334
#KEY_KP_ENTER = 335
#KEY_KP_EQUAL = 336
#KEY_LEFT_SHIFT = 340
#KEY_LEFT_CONTROL = 341
#KEY_LEFT_ALT = 342
#KEY_LEFT_SUPER = 343
#KEY_RIGHT_SHIFT = 344
#KEY_RIGHT_CONTROL = 345
#KEY_RIGHT_ALT = 346
#KEY_RIGHT_SUPER = 347
#KEY_MENU = 348
#KEY_LAST = #KEY_MENU

#KEY_MODIFIER_SHIFT = $01
#KEY_MODIFIER_CONTROL = $02
#KEY_MODIFIER_ALT = $04
#KEY_MODIFIER_SUPER = $08
#KEY_MODIFIER_CAPS_LOCK = $10
#KEY_MODIFIER_NUM_LOCK = $20

#MOUSE_BUTTON_LEFT = 0
#MOUSE_BUTTON_RIGHT = 1
#MOUSE_BUTTON_MIDDLE = 2

#GAMEPAD_BUTTON_A = 0
#GAMEPAD_BUTTON_B = 1
#GAMEPAD_BUTTON_X = 2
#GAMEPAD_BUTTON_Y = 3
#GAMEPAD_BUTTON_LEFT_BUMPER = 4
#GAMEPAD_BUTTON_RIGHT_BUMPER = 5
#GAMEPAD_BUTTON_BACK = 6
#GAMEPAD_BUTTON_START = 7
#GAMEPAD_BUTTON_GUIDE = 8
#GAMEPAD_BUTTON_LEFT_THUMB = 9
#GAMEPAD_BUTTON_RIGHT_THUMB = 10
#GAMEPAD_BUTTON_DPAD_UP = 11
#GAMEPAD_BUTTON_DPAD_RIGHT = 12
#GAMEPAD_BUTTON_DPAD_DOWN = 13
#GAMEPAD_BUTTON_DPAD_LEFT = 14

#GAMEPAD_BUTTON_CROSS = #GAMEPAD_BUTTON_A
#GAMEPAD_BUTTON_CIRCLE = #GAMEPAD_BUTTON_B
#GAMEPAD_BUTTON_SQUARE = #GAMEPAD_BUTTON_X
#GAMEPAD_BUTTON_TRIANGLE = #GAMEPAD_BUTTON_Y

#GAMEPAD_AXIS_LEFT_X = 0
#GAMEPAD_AXIS_LEFT_Y = 1
#GAMEPAD_AXIS_RIGHT_X = 2
#GAMEPAD_AXIS_RIGHT_Y = 3
#GAMEPAD_AXIS_LEFT_TRIGGER = 4
#GAMEPAD_AXIS_RIGHT_TRIGGER = 5
sgd.pb

Code: Alles auswählen

; Note: The content of this file and keycodes.bb will eventually by baked into Blitz3D runtime.dll

#EVENT_MASK_CLOSE_CLICKED = $01
#EVENT_MASK_SIZE_CHANGED  = $02
#EVENT_MASK_LOST_FOCUS    = $04
#EVENT_MASK_GOT_FOCUS     = $08
#EVENT_MASK_SUSPENDED     = $10
#EVENT_MASK_RESUMED       = $20

#WINDOW_STATE_CLOSED      = 0
#WINDOW_STATE_MINIMIZED   = 1
#WINDOW_STATE_NORMAL      = 2
#WINDOW_STATE_MAXIMIZED   = 3
#WINDOW_STATE_FULLSCREEN  = 4

#WINDOW_FLAGS_NONE        = $00
#WINDOW_FLAGS_FULLSCREEN  = $01
#WINDOW_FLAGS_RESIZABLE   = $02
#WINDOW_FLAGS_CENTERED    = $04

#MOUSE_CURSOR_MODE_NORMAL   = 1
#MOUSE_CURSOR_MODE_HIDDEN   = 2
#MOUSE_CURSOR_MODE_DISABLED = 3
#MOUSE_CURSOR_MODE_CAPTURED = 4

#TEXTURE_FORMAT_ANY      = 0
#TEXTURE_FORMAT_R8       = 1
#TEXTURE_FORMAT_RG8      = 2
#TEXTURE_FORMAT_RGBA8    = 3
#TEXTURE_FORMAT_SRGBA8   = 4
#TEXTURE_FORMAT_R8S      = 5
#TEXTURE_FORMAT_RG8S     = 6
#TEXTURE_FORMAT_RGBA8S   = 7
#TEXTURE_FORMAT_R16F     = 8
#TEXTURE_FORMAT_RG16F    = 9
#TEXTURE_FORMAT_RGBA16F  = 10

#TEXTURE_FLAGS_NONE    = $00
#TEXTURE_FLAGS_CLAMP_U = $01
#TEXTURE_FLAGS_CLAMP_V = $02
#TEXTURE_FLAGS_CLAMP_W = $04
#TEXTURE_FLAGS_CLAMP   = $07
#TEXTURE_FLAGS_FILTER  = $08
#TEXTURE_FLAGS_MIPMAP  = $10
#TEXTURE_FLAGS_DEFAULT = $18
#TEXTURE_FLAGS_IMAGE   = $1f

#BLEND_MODE_OPAQUE      = 1
#BLEND_MODE_ALPHA_MASK  = 2
#BLEND_MODE_ALPHA_BLEND = 3

#DEPTH_FUNC_NEVER         = 1
#DEPTH_FUNC_LESS          = 2
#DEPTH_FUNC_EQUAL         = 3
#DEPTH_FUNC_LESS_EQUAL    = 4
#DEPTH_FUNC_GREATER       = 5
#DEPTH_FUNC_NOT_EQUAL     = 6
#DEPTH_FUNC_GREATER_EQUAL = 7
#DEPTH_FUNC_ALWAYS        = 8

#CULL_MODE_NONE  = 1
#CULL_MODE_FRONT = 2
#CULL_MODE_BACK  = 3

#IMAGE_VIEW_MODE_FIXED   = 1
#IMAGE_VIEW_MODE_FREE    = 2
#IMAGE_VIEW_MODE_UPRIGHT = 3

#ANIMATION_MODE_ONE_SHOT  = 1
#ANIMATION_MODE_LOOP      = 2
#ANIMATION_MODE_PING_PONG = 3

#COLLISION_RESPONSE_NONE =    0
#COLLISION_RESPONSE_STOP =    1
#COLLISION_RESPONSE_SLIDE =   2
#COLLISION_RESPONSE_SLIDEXZ = 3
sgd_dynamic.pbi

Code: Alles auswählen




; Libname: sgd_dynamic.lib
; created: 2024/11/07  15:51
; translated MPz Version 0.03 alpha

 Macro SGD_String
    s
 EndMacro
 
 Macro SGD_Texture
    s
 EndMacro
  
 Macro SGD_Real
   d ; Double or float
  ;f
 EndMacro
 
 Macro  SGD_Key
   i
 EndMacro
 
Import "sgd_dynamic.lib"
    
  ;-! @defgroup System System
  ; ! Start up libsgd.
  sgd_Init() As "sgd_Init";
  ; ! Get current Runtime LibSGD version.
  ; ! Returns the value of SGD_VERSION Macro at the time the Runtime was built.
  sgd_GetVersion() As "sgd_GetVersion";
  ; ! Shut down libsgd.
  sgd_Terminate() As "sgd_Terminate";

  ; ! Set Global configuration variable.
  ; ! Config var name           | Default | Description
  ; !---------------------------|---------|------------
  ; ! log.logfilePath           |         | Logfile path, defaults To "~/.sgd/log.txt".
  ; ! log.logfileEnabled        | "1"     | Enables logging To logfile.
  ; ! log.stdoutEnabled         | "1"     | Enables logging To stdout.
  ; ! gltf.loggingEnabled       | "0"     | Enables logging by the gltf loader.
  ; ! dawn.backendType          |         | Backend For Dawn To use, one of: "D3D12", "D3D11", "Vulkan", "Metal". Defaults To
  ; ! "D3D12" on 64 bit Windows, "D3D11" on 32 bit Windows, "Vulkan" on 64 bit Linux And "Metal" on 64 bit MacOS.
  ; ! render.vsyncEnabled       | "1"     | Hack that fixes https://issues.chromium.org/issues/42241496#comment3
  ; ! render.shadowPassEnabled  | "1"     | Enables shadow rendering.
  ; ! render.opaquePassEnabled  | "1"     | Enables opaque rendering.
  ; ! render.blendPassEnabled   | "1"     | Enables blended rendering.
  ; ! render.effectPassEnabled  | "1"     | Enables effects rendering.
  sgd_SetConfigVar(name.SGD_String , value.SGD_String ) As "sgd_SetConfigVar";
  ; ! Set Global configuration variable. The returned value is valid Until the Next CALL To sgd_GetConfigVar.
  sgd_GetConfigVar(name.SGD_String ) As "sgd_GetConfigVar";
  ; ! Set error handler callback.
  ;SGD_API void SGD_DECL sgd_SetErrorHandler(void(SGD_DECL* handler)(SGD_String error, void* context), void* context); Weis nicht wie man das übersetzen soll
  ; ! Generate Runtime error.
  sgd_Error(error.SGD_String ) As "sgd_Error";
  ; ! Generate modal alert dialog.
  sgd_Alert(message.SGD_String ) As "sgd_Alert";
  ; ! Write line of text To log.
  sgd_Log(line.SGD_String ) As "";
  ; ! Return width of desktop IN pixels.
  sgd_GetDesktopWidth() As "sgd_GetDesktopWidth";
  ; ! Return height of desktop IN pixels.
  sgd_GetDesktopHeight() As "sgd_GetDesktopHeight";
  ; ! Poll system For events, returns a bit mask of event types that occured.
  ; ! The returned Return value should be bitwise 'and'ed With one of the @ref SGD_EventMask
  ; ! values To determine whether a particular event occured Or Not.
  sgd_PollEvents() As "sgd_PollEvents";
  ; ! Release an object handle.
  ; ! Will cause the object referenced by the handle To become available For destruction,
  ; ! And will also invalidate the handle.
  ; ! An object will Not be destroyed While it is still being used by another object, eg:
  ; ! a model's mesh will not be destroyed while it is still being used by a Model.
  ; ! It is an error To use an invalidated handle, so once a handle is released be careful
  ; ! Not To use it again.
  sgd_ReleaseHandle(handle.i) As "sgd_ReleaseHandle";
  ; ! Release all object handles.
  sgd_ReleaseAllHandles() As "sgd_ReleaseAllHandles";
  ; ! @cond Debug memory state.
  sgd_DebugMemory() As "sgd_DebugMemory";
  
  ;-! @defgroup Window Window
  ; ! Create a new window. See @ref SGD_WindowFlags for possible values for `flags`.
  sgd_CreateWindow(width.i, height.i, title.SGD_String, flags.i) As "sgd_CreateWindow"
  ; ! Destroy window.
  sgd_DestroyWindow() As "sgd_DestroyWindow"
  ; ! Set window position.
  sgd_SetWindowPosition(x.i, y.i) As "sgd_SetWindowPosition";
  ; ! Set window position.
  sgd_GetWindowX() As "sgd_GetWindowX"
  ; ! Get window x. 
  sgd_GetWindowY() As "sgd_GetWindowY"
  ; ! Get window y.
  sgd_SetWindowSize(width.i, heigh.i) As "sgd_SetWindowSize"
  ; ! Get window width.
  sgd_GetWindowWidth() As "sgd_GetWindowWidth"
  ; ! Get window height.
  sgd_GetWindowHeight() As "sgd_GetWindowHeight"
  ; ! Set window title.
  sgd_SetWindowTitle( title.SGD_String) As "sgd_SetWindowTitle"
  ; ! Get window title. The returned string will be valid until the next call to sgd_GetWindowTitle().
  sgd_GetWindowTitle() As "sgd_GetWindowTitle"
  ; ! Set fullscreen mode.
  sgd_SetFullscreenMode(width.i,height.i,hertz.i) As "sgd_SetFullscreenMode"
  ; ! Set window state.
  sgd_SetWindowState(state.i) As "sgd_SetWindowState"
  ; ! Get window state. See sgd_SetWindowState.
  sgd_GetWindowState() As "sgd_GetWindowState"
  
   ;-! @defgroup Input Input
   ; ! True If key is currently held down.
   sgd_IsKeyDown(key.SGD_Key) As "sgd_IsKeyDown"
   ; ! True If key was pressed down last frame.
   sgd_IsKeyHit(key.SGD_Key) As "sgd_IsKeyHit"
   ; ! Get Next unicode character from keyboard input queue.
   sgd_GetChar() As "sgd_GetChar"
   ; ! Clear keyboard input queue.
   sgd_FlushChars() As "sgd_FlushChars"
   ; ! Mouse X position IN window coordinates.
   sgd_GetMouseX.f() As "sgd_GetMouseX"
   ; ! Mouse Y position IN window coordinates.
   sgd_GetMouseY.f() As "sgd_GetMouseY"
   ; ! Mouse Z (scrollwheel) position.
   sgd_GetMouseZ.f() As "sgd_GetMouseZ"
   ; ! Mouse X velocity.
   sgd_GetMouseVX.f() As "sgd_GetMouseVX"
   ; ! Mouse Y velocity.
   sgd_GetMouseVY.f() As "sgd_GetMouseVY"
   ; ! Mouse Z (scrollwheel) velocity.
   sgd_GetMouseVZ.f() As "sgd_GetMouseVZ"
   ; ! Set Mouse Z (scrollwheel) position.
   sgd_SetMouseZ(z.f) As "sgd_SetMouseZ"
   ; ! Set mouse cursor mode.
   sgd_SetMouseCursorMode(cursorMode.i) As "sgd_SetMouseCursorMode"
   ; ! True If mouse button is curently held down.
   sgd_IsMouseButtonDown(button.i) As "sgd_IsMouseButtonDown"
   ; ! True If mouse button was pressed down last frame.
   sgd_IsMouseButtonHit(button.i) As "sgd_IsMouseButtonHit"   
   ; ! True If gamepad is currently connected.
   sgd_IsGamepadConnected(gamepad.i) As "sgd_IsGamepadConnected"
   ; ! True If gamepad button currently held down.
   sgd_IsGamepadButtonDown(gamepad.i, button.i) As "sgd_IsGamepadButtonDown"
   ; ! True If gamepad button was pressed down last frame.
   sgd_IsGamepadButtonHit(gamepad.i, button.i) As "sgd_IsGamepadButtonHit"
   ; ! Value IN the range -1 To 1 representing joystick axis position.
   sgd_GetGamepadAxis.f(gamepad.i,axis.i) As "sgd_GetGamepadAxis"
  
   
   ;-! @defgroup Texture Texture
   ; ! Load a new 2D texture. See also @ref SGD_TextureFlags.
   ; ! @param path is the file path of the texture To load.
   ; ! @param format is a SGD_TextureFormat constant.
   ; ! @param flags is a valid combination of SGD_TextureFlags values.
   sgd_Load2DTexture( path.SGD_String, format.i, flags.i) As "sgd_Load2DTexture"
   ; ! Load a new cube texture. See also @ref SGD_TextureFlags.
   sgd_LoadCubeTexture(path.SGD_String, format.i, flags.i) As "sgd_LoadCubeTexture"
   ; ! Load a new Array texture. See also @ref SGD_TextureFlags.
   sgd_LoadArrayTexture(path.SGD_String, format.i, flags.i) As "sgd_LoadArrayTexture"
   ; ! Create a new 2D texture. See also @ref SGD_TextureFlags.
   sgd_Create2DTexture(width.i, height.i, format.i, flags.i) As "sgd_Create2DTexture"
   ; ! Create a new cube texture. See also @ref SGD_TextureFlags.
   sgd_CreateCubeTexture(size.i, format.i, flags.i) As "sgd_CreateCubeTexture"
   ; ! Create a new Array texture. See also @ref SGD_TextureFlags.
   sgd_CreateArrayTexture(width.i, height.i, depth.i, format.i, flags.i) As "sgd_CreateArrayTexture"
   ; ! Get texture type.
   sgd_GetTextureType(texture.i) As "sgd_GetTextureType"
   ; ! Get width of texture.
   sgd_GetTextureWidth(texture.i) As "sgd_GetTextureWidth"
   ; ! Get height of texture.
   sgd_GetTextureDepth(texture.i) As "sgd_GetTextureDepth"
   ; ! Get height of texture.
   sgd_GetTextureHeight(texture.i) As "sgd_GetTextureHeight"
   ; ! Get texture format.
   sgd_GetTextureFormat(texture.i) As "sgd_GetTextureFormat"
   ; ! Get texture flags.
   sgd_GetTextureFlags(texture.i) As "sgd_GetTextureFlags"
   ; ! Set texture texel.
   sgd_SetTexelSRGBA(x.i,y.i, rgba.i) As "sgd_SetTexelSRGBA"
   ; ! Get texture texel
   sgd_GetTexelSRGBA( texture.i, x.i, y.i) As "sgd_GetTexelSRGBA"
   
   ;-! @defgroup Material Material

   ; ! Load a new PBR material.
    sgd_LoadPBRMaterial(path.SGD_String) As "sgd_LoadPBRMaterial"
    ; ! Create a new PBR material.
    sgd_CreatePBRMaterial() As "sgd_CreatePBRMaterial"
    ; ! Load a new prelit material.
    sgd_LoadPrelitMaterial(path.SGD_String) As "sgd_LoadPrelitMaterial"
    ; ! Create a new prelit material.
    sgd_CreatePrelitMaterial() As "sgd_CreatePrelitMaterial"
    ; ! Set material blend mode.
    sgd_SetMaterialBlendMode(material.i, blendMode.i) As "sgd_SetMaterialBlendMode"
    ; ! Set material depth comparison function.
    sgd_SetMaterialDepthFunc(material.i, depthFun.i) As "sgd_SetMaterialDepthFunc"
    ; ! Set material cull mode.
    sgd_SetMaterialCullMode(material.i, cullMode.i) As "sgd_SetMaterialCullMode"
    ; ! Set material texture parameter.
    sgd_SetMaterialTexture(material.i,  parameter.SGD_String, texture.i) As "sgd_SetMaterialTexture"
    ; ! Set material color parameter.
    sgd_SetMaterialColor(material.i, parameter.SGD_String , red.f, green.f, blue.f,alpha.f) As "sgd_SetMaterialColor"
    ; ! Set material float parameter.
    sgd_SetMaterialFloat(material.i, parameter.SGD_String , value.f) As "sgd_SetMaterialFloat"
    
    
    ;-! @defgroup Mesh Mesh
    ; ! Load a new mesh.
    sgd_LoadMesh(path.SGD_String) As "sgd_LoadMesh"
    ; ! Copy mesh.
    sgd_CopyMesh(mesh.i) As "sgd_CopyMesh"
    ; ! Create a new box mesh.
    sgd_CreateBoxMesh(minX.f, minY.f, minZ.f, maxX.f, maxY.f, maxZ.f,material.i) As "sgd_CreateBoxMesh";
    ; ! Create a new sphere mesh.
    sgd_CreateSphereMesh(radius.f, xSegs.i, ySegs.i, material.i) As "sgd_CreateSphereMesh";
    ; ! Create a new cylinder mesh.
    sgd_CreateCylinderMesh(height.f, radius.f, segs.i, material.i) As "sgd_CreateCylinderMesh";
    ; ! Create a new cone mesh.
    sgd_CreateConeMesh(height.f, radius.f,segs.i, material.i) As "sgd_CreateConeMesh";
    ; ! Create a new torus mesh.
    sgd_CreateTorusMesh(outerRadius.f, innerRadius.f,outerSegs.i, innerSegs.i,material.i) As "sgd_CreateTorusMesh";
    ; ! Set mesh shadow casting enabled, defaults To true.
    sgd_SetMeshShadowsEnabled(mesh.i, enabled.i) As "sgd_SetMeshShadowsEnabled";
    ; ! Get mesh shadow casting enabled.
    sgd_IsMeshShadowsEnabled( mesh.i) As "sgd_IsMeshShadowsEnabled";
    ; ! Update mesh normals.
    sgd_UpdateMeshNormals(mesh.i) As "sgd_UpdateMeshNormals" 
    ; ! Update mesh tangets. Mesh must have SGD_MESH_TANGENTS_ENABLED flag.
    sgd_UpdateMeshTangents(mesh.i) As "sgd_UpdateMeshTangents";
    ; ! Fit mesh To a bounding box.
    sgd_FitMesh(mesh.i, minX.f, minY.f, minZ.f, maxX.f, maxY.f, maxZ.f,uniform.i) As "sgd_FitMesh";
    ; ! Transform mesh by translation, rotation, scale.
    sgd_TransformMesh(mesh.i, tx.f, ty.f, tz.f, rx.f, ry.f, rz.f, sx.f,sy.f, sz.f) As "sgd_TransformMesh";
    ; ! Transform mesh texture coordinates.
    sgd_TransformTexCoords(mesh.i, scaleX.f, scaleY.f, offsetX.f, offsetY.f) As "sgd_TransformTexCoords";
    ; ! Flip mesh.
    sgd_FlipMesh(mesh.i) As "sgd_FlipMesh";
    ; ! Get mesh bounding box min x coordinate.
    sgd_GetMeshBoundsMinX.f(mesh.i) As "sgd_GetMeshBoundsMinX";
    ; ! Get mesh bounding box min y coordinate.
    sgd_GetMeshBoundsMinY.f(mesh.i) As "sgd_GetMeshBoundsMinY";
    ; ! Get mesh bounding box min z coordinate.
    sgd_GetMeshBoundsMinZ.f(mesh.i);
    ; ! Get mesh bounding box max x coordinate.
    sgd_GetMeshBoundsMaxX.f(mesh.i) As "sgd_GetMeshBoundsMaxX";
    ; ! Get mesh bounding box max y coordinate.
    sgd_GetMeshBoundsMaxY.f(mesh.i) As "sgd_GetMeshBoundsMaxY";
    ; ! Get mesh bounding box max z coordinate.
    sgd_GetMeshBoundsMaxZ.f(mesh.i) As "sgd_GetMeshBoundsMaxZ";
    ; ! Create a new custom mesh. See also @ref SGD_MeshFlags.
    sgd_CreateMesh(vertexCount.i, flags.i) As "sgd_CreateMesh";
    ; ! ADD uninitialized vertices To a mesh, returning index of the first new vertex.
    sgd_ResizeVertices(mesh.i, count.i) As "sgd_ResizeVertices";
    ; ! Get number of vertices IN mesh.
    sgd_GetVertexCount(mesh.i) As "sgd_GetVertexCount";
    ; ! ADD a vertex To a mesh, returning index of new vertex.
    sgd_AddVertex(mesh.i, x.f, y.f, z.f, nx.f, ny.f, nz.f, s.f, t.f) As "sgd_AddVertex";
    ; ! Set vertex.
    sgd_SetVertex(mesh.i, vertex.i, x.f, y.f, z.f, nx.f, ny.f, nz.f, s.f, t.f) As "sgd_SetVertex";
    ; ! Set vertex position.
    sgd_SetVertexPosition(mesh.i, vertex.i, x.f, y.f, z.f) As "sgd_SetVertexPosition";
    ; ! Set vertex normal.
    sgd_SetVertexNormal(mesh.i, vertex.i, nx.f, ny.f, nz.f) As "sgd_SetVertexNormal";
    ; ! Set vertex tangent.
    sgd_SetVertexTangent(mesh.i, vertex.i, tx.f, ty.f, tz.f, tw.f) As "sgd_SetVertexTangent";
    ; ! Set vertex color.
    sgd_SetVertexColor(mesh.i, vertex.i, r.f, g.f, b.f, a.f) As "sgd_SetVertexColor";
    ; ! Set vertex texture coordinate 0.
    sgd_SetVertexTexCoord0(mesh.i, vertex.i, u0.f, v0.f) As "sgd_SetVertexTexCoord0";
    ; ! Get vertex position x coordinate.
    sgd_GetVertexX.f(mesh.i, vertex.i)As "sgd_GetVertexX";
    ; ! Get vertex position y coordinate.
    sgd_GetVertexY.f(mesh.i, vertex.i)As "sgd_GetVertexY";
    ; ! Get vertex position z coordinate.
    sgd_GetVertexZ.f(mesh.i, vertex.i)As "sgd_GetVertexZ";
    ; ! Get vertex normal x component.
    sgd_GetVertexNX.f(mesh.i, vertex.i)As "sgd_GetVertexNX";
    ; ! Get vertex normal y component.
    sgd_GetVertexNY.f(mesh.i, vertex.i)As "sgd_GetVertexNY";
    ; ! Get vertex normal z component.
    sgd_GetVertexNZ.f(mesh.i, vertex.i)As "sgd_GetVertexNZ";
    ; ! Get vertex tangent x component.
    sgd_GetVertexTX.f(mesh.i, vertex.i)As "sgd_GetVertexTX";
    ; ! Get vertex tangent y component.
    sgd_GetVertexTY.f(mesh.i, vertex.i)As "sgd_GetVertexTY";
    ; ! Get vertex tangent z component.
    sgd_GetVertexTZ.f(mesh.i, vertex.i)As "sgd_GetVertexTZ";
    ; ! Get vertex tangent w component.
    sgd_GetVertexTW.f(mesh.i, vertex.i)As "sgd_GetVertexTW";
    ; ! Get vertex color red component.
    sgd_GetVertexRed.f(mesh.i, vertex.i)As "sgd_GetVertexRed";
    ; ! Get vertex color green component.
    sgd_GetVertexGreen.f(mesh.i, vertex.i)As "sgd_GetVertexGreen";
    ; ! Get vertex color blue component.
    sgd_GetVertexBlue.f(mesh.i, vertex.i)As "sgd_GetVertexBlue";
    ; ! Get vertex color alpha component.
    sgd_GetVertexAlpha.f(mesh.i, vertex.i)As "sgd_GetVertexAlpha";
    ; ! Get vertex texture coordinate 0 u component.
    sgd_GetVertexU0(mesh.i, vertex.i)As "sgd_GetVertexU0";
    ; ! Get vertex tangent coorindate 1 y component.
    sgd_GetVertexV0.f(mesh.i, vertex.i)As "sgd_GetVertexV0";
    ; ! Create a new Surface And ADD it To mesh.
    sgd_CreateSurface(mesh.i, material.i, triangleCount.i)As "sgd_CreateSurface";
    ; ! Get mesh surface count.
    sgd_GetSurfaceCount(mesh.i)As "sgd_GetSurfaceCount";
    ; ! Get mesh surface.
    sgd_GetSurface(mesh.i, surface.i)As "sgd_GetSurface";
    ; ! Get surface material.
    sgd_GetMaterial(surface.i)As "sgd_GetMaterial";
    ; ! ADD empty triangles To surface, returning index of first new triangle.
    sgd_ResizeTriangles(surface.i, count.i)As "sgd_ResizeTriangles";
    ; ! Get number of triangles IN surface.
    sgd_GetTriangleCount(surface.i)As "sgd_GetTriangleCount";
    ; ! ADD triangle To surface, returning index of new triangle.
    sgd_AddTriangle(surface.i, v0.i, v1.i, v2.i)As "sgd_AddTriangle";
    ; ! Update existing triangle vertices IN surface.
    sgd_SetTriangle(surface.i,triangle.i, v0.i, v1.i, v2.i)As "sgd_SetTriangle";
    ; ! Get mesh vertex index of a triangle corner. Vertex must be 0, 1 Or 2.
    sgd_GetTriangleVertex(surface.i, triangle.i, vertex.i) As "sgd_GetTriangleVertex";
    
    ;-! @defgroup Font Font
    ; ! Load a new font.
    sgd_LoadFont(path.SGD_String, height.f) As "sgd_LoadFont";
    ; ! Get width of text.
    sgd_GetTextWidth.f(font.i, text.SGD_String) As "sgd_GetTextWidth";
    ; ! get height of font.
    sgd_GetFontHeight.f(font.i) As "sgd_GetFontHeight";

    ;-! @defgroup Image Image
    ; ! Load an image For use With 3D sprites Or Draw2DImage.
    sgd_LoadImage(path.SGD_String) As "sgd_LoadImage";
    ; ! Load an Array image For use With 3D sprites Or Draw2DImage.
    sgd_LoadArrayImage(path.SGD_String , frameCount.i, framesX.i, framesY.i, frameSpacing.i) As "sgd_LoadArrayImage";
    ; ! Create an image With an existing texture.
    sgd_CreateImage(texture.i ) As "sgd_CreateImage";
    ; ! Set view mode For use With 3D sprites.
    sgd_SetImageViewMode(image.i, viewMode.i) As "sgd_SetImageViewMode";
    ; ! Set image blend mode.
    sgd_SetImageBlendMode(image.i, blendMode.i) As "sgd_SetImageBlendMode";
    ; ! Set rect For use With 3D sprites.
    sgd_SetImageRect(image.i, minX.f, minY.f, maxX.f, maxY.f) As "sgd_SetImageRect";
    ; ! Get texture used To create image.
    sgd_GetImageTexture(image.i) As "sgd_GetImageTexture";
        
    ;-! @defgroup Overlay Overlay
    ; ! Set current fill color For drawing shapes.
    sgd_Set2DFillColor(red.f, green.f, blue.f, alpha.f) As "sgd_Set2DFillColor";
    ; ! Set current fill material For drawing shapes.
    sgd_Set2DFillMaterial(material.i) As "sgd_Set2DFillMaterial";
    ; ! SetCurrent file enabled flag For drawing shapes.
    sgd_Set2DFillEnabled(enabled.i) As "sgd_Set2DFillEnabled";
    ; ! Set current outline color For drawing shapes.
    sgd_Set2DOutlineColor(red.f, green.f, blue.f, alpha.f) As "sgd_Set2DOutlineColor";
    ; ! Set current outline width, defaults To 3.
    sgd_Set2DOutlineWidth(width.f) As "sgd_Set2DOutlineWidth";
    ; ! SetCurrent outline enabled flag For drawing shapes.
    sgd_Set2DOutlineEnabled(enabled.i) As "sgd_Set2DOutlineEnabled";
    ; ! Set current line width, defaults To 3.
    sgd_Set2DLineWidth(width.f) As "sgd_Set2DLineWidth";
    ; ! Set current point size, defaults To 3.
    sgd_Set2DPointSize(size.f) As "sgd_Set2DPointSize";
    ; ! Set current font.
    sgd_Set2DFont(font.f) As "sgd_Set2DFont";
    ; ! Set current text color.
    sgd_Set2DTextColor(red.f, green.f, blue.f, alpha.f) As "sgd_Set2DTextColor";
    ; ! Get width of 2d text IN the current 2D font.
    sgd_Get2DTextWidth.f(text.SGD_String) As "sgd_Get2DTextWidth";
    ; ! Get height of current 2d font.
    sgd_Get2DFontHeight() As "sgd_Get2DFontHeight";
    ; ! Clear the current 2d overlay.
    sgd_Clear2D() As "sgd_Clear2D";
    ; ! PUSH current draw List To layer stack, effectively 'freezing' it As a background layer Until popped.
    sgd_Push2DLayer() As "sgd_Push2DLayer";
    ; ! POP layer stack.
    sgd_Pop2DLayer() As "sgd_Pop2DLayer";
    ; ! Draw point using current fill And outline colors.
    sgd_Draw2DPoint(x0.f, y0.f) As "sgd_Draw2DPoint";
    ; ! Draw line using current fill And outline colors.
    sgd_Draw2DLine(x0.f, y0.f, x1.f, y1.f) As "sgd_Draw2DLine";
    ; ! Draw rect using current fill And outline colors.
    sgd_Draw2DRect(minX.f, minY.f, maxX.f, maxY.f) As "sgd_Draw2DRect";
    ; ! Draw image using current fill color.
    sgd_Draw2DImage(image.i, x.f, y.f, frame.f) As "sgd_Draw2DImage";
    ; ! Draw oval using current fill And outline colors.
    sgd_Draw2DOval(minX.f, minY.f, maxX.f, maxY.f) As "sgd_Draw2DOval";
    ; ! Draw text using current text color.
    sgd_Draw2DText(text.SGD_String, x.f, y.f) As "sgd_Draw2DText";
    
    ;-! @defgroup Scene Scene
    ; ! Destroy all active entities.
    sgd_ClearScene() As "sgd_ClearScene";
    ; ! Reset scene To Default state.
    ; ! Destroys all active entities IN the scene.
    sgd_ResetScene(releaseAllHandles.i) As "sgd_ResetScene";
    ; ! Experimental JSON loader!
    sgd_LoadScene( path.SGD_String) As "sgd_LoadScene";
    ; ! Experimental JSON saver!
    sgd_SaveScene( path.SGD_String) As "sgd_SaveScene";
    ; ! Set scene ambient light color.
    sgd_SetAmbientLightColor(red.f,green.f, blue.f, alpha.f) As "sgd_SetAmbientLightColor";
    ; ! Set scene clear color.
    sgd_SetClearColor(red.f, green.f, blue.f, alpha.f) As "sgd_SetClearColor";
    ; ! Set scene clear depth.
    sgd_SetClearDepth(depth.f) As "sgd_SetClearDepth";
    ; ! Set scene environment texture.
    sgd_SetEnvTexture( texture.i) As "sgd_SetEnvTexture";
    ; ! Update scene shadow mapping config from config vars.
    ; ! This function will update shadow mapping config variables from the current config vars, see sgd_SetConfigVar.
    ; !
    ; ! Config Var         | Type  | Default                | Description
    ; ! -------------------|-------|------------------------|------------
    ; ! csm.textureSize    | INT   | "2048"                 | Texture size of each of the 4 cascading shadow Map textures.
    ; ! csm.maxLights      | INT   | "4"                    | Max directional light shadow casters.
    ; ! csm.clipRange      | float | "330.0"                | Max offscreen distance To render shadow casters.
    ; ! csm.depthBias      | float | "0.0001"               | Depth bias For cascading shadow maps.
    ; ! csm.SplitDistances | Vec4f | "15,60,250,1000"       | Cascading shadow Map split distances from the eye.
    ; ! psm.textureSize    | INT   | "1024"                 | Texture size of point light cube shadow textures.
    ; ! psm.maxLights      | INT   | "32"                   | Max point light shadow casters.
    ; ! psm.clipNear       | float | "0.25"                 | Near clipping plane For point light shadow maps.
    ; ! psm.depthBias      | float | "0.0001"               | Depth bias value For p[oint light shadow maps.
    ; ! ssm.textureSize    | INT   | "1024"                 | Texture size of each spot light 2D shadow Map.
    ; ! ssm.maxLights      | INT   | "16"                   | Max spot light shadow casters.
    ; ! ssm.clipNear       | float | "0.25"                 | Max distance To render shadow casters.
    ; ! ssm.depthBias      | float | "0.0001"               | Depth bias value To prevent shadow acne.
    sgd_UpdateShadowMappingConfig() As "sgd_UpdateShadowMappingConfig";
    ; ! Render scene.
    sgd_RenderScene() As "sgd_RenderScene";
    ; ! Present.
    sgd_Present() As "sgd_Present";
    ; ! Return frames per second.
    sgd_GetFPS.f() As "sgd_GetFPS";
    ; ! Return renders per second.
    sgd_GetRPS.f() As "sgd_GetRPS";
    
    ;-! @defgroup Entity Entity
    ; ! Set entity enabled state. An entity is only enabled IN the scene If both it And all its ancestors are enabled.
    sgd_SetEntityEnabled(entity.i, enabled.i) As "sgd_SetEntityEnabled";
    ; ! Get entity enabled state.
    sgd_IsEntityEnabled(entity.i) As "sgd_IsEntityEnabled";
    ; ! Set entity visible state. An entity is only visible IN the scene If both it And all its ancestors are visible.
    sgd_SetEntityVisible(entity.i, visible.i) As "sgd_SetEntityVisible";
    ; ! Get entity visible state.
    sgd_IsEntityVisible(entity.i) As "sgd_IsEntityVisible";
    ; ! Destroy entity And children recursively.
    sgd_DestroyEntity(entity.i) As "sgd_DestroyEntity";
    ; ! Reset entity collision state.
    sgd_ResetEntity(entity.i) As "sgd_ResetEntity";
    ; ! Copy entity And children recursively.
    sgd_CopyEntity(entity.i) As "sgd_CopyEntity";
    ; ! Set entity name
    sgd_SetEntityName(entity.i, name.SGD_String) As "sgd_SetEntityName";
    ; ! Get entity name. The returned string will remain valid Until the Next CALL To sgd_GetEntityName.
    sgd_GetEntityName(entity.i) As "sgd_GetEntityName";
    ; ! Set entity's parent.
    sgd_SetEntityParent(entity.i, parent.i) As "sgd_SetEntityParent";
    ; ! Get entity's parent.
    sgd_GetEntityParent(entity.i) As "sgd_GetEntityParent";
    ; ! Get entity number of children
    sgd_GetEntityChildCount(entity.i) As "sgd_GetEntityChildCount";
    ; ! Get entity child by index. childIndex must be >= 0 And < sgd_GetEntityChildCount(entity)
    sgd_GetEntityChild(entity.i, childIndex.i) As "sgd_GetEntityChild";
    ; ! Recursively search For an entity by name. If parent is 0, the entire scene is searched.
    sgd_FindEntityChild(entity.i, childName.SGD_String) As "sgd_FindEntityChild";
    ; ! Set entity's world space position.
    sgd_SetEntityPosition(entity.i, tx.SGD_Real, ty.SGD_Real, tz.SGD_Real ) As "sgd_SetEntityPosition";
    ; ! Set entity's world space rotation.
    sgd_SetEntityRotation(entity.i, rx.SGD_Real, ry.SGD_Real, rz.SGD_Real) As "sgd_SetEntityRotation";
    ; ! Set entity world space scale.
    sgd_SetEntityScale(entity.i, sx.SGD_Real, sy.SGD_Real, sz.SGD_Real) As "sgd_SetEntityScale";
    ; ! Translate entity IN world space.
    sgd_TranslateEntity(entity.i, tx.SGD_Real, ty.SGD_Real, tz.SGD_Real) As "sgd_TranslateEntity";
    ; ! Rotate entity IN world space.
    sgd_RotateEntity(entity.i, rx.SGD_Real, ry.SGD_Real, rz.SGD_Real) As "sgd_RotateEntity";
    ; ! Scale entity IN world space.
    sgd_ScaleEntity(entity.i, sx.SGD_Real, sy.SGD_Real, sz.SGD_Real) As "sgd_ScaleEntity";
    ; ! Move entity relative To it's current orientation.
    sgd_MoveEntity(entity.i, tx.SGD_Real,ty.SGD_Real, tz.SGD_Real) As "sgd_MoveEntity";
    ; ! Turn entity relative To it's current orientation.
    sgd_TurnEntity(entity.i, rx.SGD_Real, ry.SGD_Real, rz.SGD_Real) As "sgd_TurnEntity";
    ; ! Get the X component of entity's world space position.
    sgd_GetEntityX.SGD_Real(entity.i) As "sgd_GetEntityX";
    ; ! Get the Y component of entity's world space position.
    sgd_GetEntityY.SGD_Real(entity.i) As "sgd_GetEntityY";
    ; ! Get the Z component of entity's world space position.
    sgd_GetEntityZ.SGD_Real(entity.i) As "sgd_GetEntityZ";
    ; ! Get the X rotation component (ie: 'pitch') of entity's world space orientation.
    sgd_GetEntityRX.SGD_Real(entity.i) As "sgd_GetEntityRX";
    ; ! Get the Y rotation component (ie: 'yaw') of entity's world space orientation.
    sgd_GetEntityRY.SGD_Real(entity.i) As "sgd_GetEntityRY";
    ; ! Get the Z rotation component (ie: 'roll') of entity's world space orientation.
    sgd_GetEntityRZ.SGD_Real(entity.i) As "sgd_GetEntityRZ";
    ; ! Get the X component of entity's world space scale factor.
    sgd_GetEntitySX.SGD_Real(entity.i) As "sgd_GetEntitySX";
    ; ! Get the Y component of entity's world space scale factor.
    sgd_GetEntitySY.SGD_Real(entity.i) As "sgd_GetEntitySY";
    ; ! Get the Z component of entity's world space scale factor.
    sgd_GetEntitySZ.SGD_Real(entity.i) As "sgd_GetEntitySZ";
    ; ! Get the X component of entity's world space basis matrix right vector.
    sgd_GetEntityIX.SGD_Real(entity.i) As "sgd_GetEntityIX";
    ; ! Get the Y component of entity's world space basis matrix right vector.
    sgd_GetEntityIY.SGD_Real(entity.i) As "sgd_GetEntityIY";
    ; ! Get the Z component of entity's world space basis matrix right vector.
    sgd_GetEntityIZ.SGD_Real(entity.i) As "sgd_GetEntityIZ";
    ; ! Get the X component of entity's world space basis matrix up vector.
    sgd_GetEntityJX.SGD_Real(entity.i) As "sgd_GetEntityJX";
    ; ! Get the Y component of entity's world space basis matrix up vector.
    sgd_GetEntityJY.SGD_Real(entity.i) As "sgd_GetEntityJY";
    ; ! Get the Z component of entity's world space basis matrix up vector.
    sgd_GetEntityJZ.SGD_Real(entity.i) As "sgd_GetEntityJZ";
    ; ! Get the X component of entity's world space basis matrix forward vector.
    sgd_GetEntityKX.SGD_Real(entity.i) As "sgd_GetEntityKX";
    ; ! Get the Y component of entity's world space basis matrix forward vector.
    sgd_GetEntityKY.SGD_Real(entity.i) As "sgd_GetEntityKY";
    ; ! Get the Z component of entity's world space basis matrix forward vector.
    sgd_GetEntityKZ.SGD_Real(entity.i) As "sgd_GetEntityKZ";
    ; ! Aim entity at entity.
    sgd_AimEntityAtEntity(entity.i, target.i, roll.f) As "sgd_AimEntityAtEntity";
    ; ! Aim entity at point IN world space.
    sgd_AimEntityAtPoint(entity.i, x.SGD_Real, y.SGD_Real, z.SGD_Real, roll.f) As "sgd_AimEntityAtPoint";
    ; ! Transform 3d point from one entity coordinate space To another.
    sgd_TransformPoint(x.SGD_Real, y.SGD_Real, z.SGD_Real, srcEntity.i, dstEntity.i) As "sgd_TransformPoint";
    ; ! Transform 3d vector from one entity coordinate space To another.
    sgd_TransformVector(x.SGD_Real, y.SGD_Real, z.SGD_Real, srcEntity.i, dstEntity.i) As "sgd_TransformVector";
    ; ! Transform 3d normal from one entity coordinate space To another.
    sgd_TransformNormal(x.SGD_Real,y.SGD_Real, z.SGD_Real, srcEntity.i, dstEntity.i) As "sgd_TransformNormal";
    ; ! X component of most recent sgd_TransformPoint result.
    sgd_GetTransformedX.SGD_Real() As "sgd_GetTransformedX";
    ; ! Y component of most recent sgd_TransformPoint result.
    sgd_GetTransformedY.SGD_Real() As "sgd_GetTransformedY";
    ; ! Z component of most recent sgd_TransformPoint result.
    sgd_GetTransformedZ.SGD_Real() As "sgd_GetTransformedZ";
    
    ;-! @defgroup Camera Camera
    ; ! Create a new perspective camera.
    sgd_CreatePerspectiveCamera() As "sgd_CreatePerspectiveCamera";
    ; ! Create a new orthographic camera.
    sgd_CreateOrthographicCamera() As "sgd_CreateOrthographicCamera";
    ; ! Get camera type.
    sgd_GetCameraType(camera.i) As "sgd_GetCameraType";
    ; ! Set camera vertical field of view IN degrees. Defaults To 90.
    sgd_SetCameraFOV(camera.i, fovY.f) As "sgd_SetCameraFOV";
    ; ! Set camera near clipping plane. Defaults To 0.1.
    sgd_SetCameraNear(camera.i, near.f) As "sgd_SetCameraNear";
    ; ! Set camera far clipping plane. Defaults To 1000.
    sgd_SetCameraFar(camera.i, far.f) As "sgd_SetCameraFar";
    ; ! Project 3d point IN world space To window coordinates.
    sgd_CameraProject(camera.f, x.SGD_Real, y.SGD_Real, z.SGD_Real) As "sgd_CameraProject";
    ; ! X coordinate of projected point IN window coordinates.
    sgd_GetProjectedX.f() As "sgd_GetProjectedX";
    ; ! Y coordinate of projected point IN window coordinates.
    sgd_GetProjectedY.f() As "sgd_GetProjectedY";
    ; ! Unproject 3d point IN wndow coordinates To world coordinates.
    sgd_CameraUnproject(camera.i, windowX.f, windowY.f, viewZ.f) As "sgd_CameraUnproject";
    ; ! X coordinate of projected point IN window coordinates.
    sgd_GetUnprojectedX.SGD_Real() As "sgd_GetUnprojectedX";
    ; ! Y coordinate of projected point IN window coordinates.
    sgd_GetUnprojectedY.SGD_Real() As "sgd_GetUnprojectedY";
    ; ! Z coordinate of projected point IN window coordinates.
    sgd_GetUnprojectedZ.SGD_Real() As "sgd_GetUnprojectedZ";

    ;-! @defgroup Light Light
    ; ! Create a new directional light.
    ; ! A maximum of 4 directional lights are supported by the renderer. If you create more than that, the 4 With the highest
    ; ! priority will be used. See @ref sgd_SetLightPriority.
    sgd_CreateDirectionalLight() As "sgd_CreateDirectionalLight";
    ; ! Create a new point light.
    ; ! A maximum of 32 point lights are supported by the renderer. If you create more than that, the 32 With the highest priority
    ; ! will be used. See @ref sgd_SetLightPriority. If there are more than 32 With the highest priority, the 32 nearest the camera
    ; ! will be used.
    sgd_CreatePointLight() As "sgd_CreatePointLight";
    ; ! Create a new spot light.
    ; ! A maximum of 16 spot lights are supported by the renderer. If you create more than that, the 16 With the highest priority
    ; ! will be used. See @ref sgd_SetLightPriority. If there are more than 16 With the highest priority, the 16 nearest the camera
    ; ! will be used.
    sgd_CreateSpotLight() As "sgd_CreateSpotLight";
    ; ! Get Light type.
    sgd_GetLightType(light.i) As "sgd_GetLightType";
    ; ! Set light shadow mapping enabled, defaults To false.
    sgd_SetLightShadowsEnabled(light.i, enabled.i) As "sgd_SetLightShadowsEnabled";
    ; ! Get light shadow mapping enabled.
    sgd_IsLightShadowsEnabled(light.i) As "sgd_IsLightShadowsEnabled";
    ; ! Set light priority, defaults To 0.
    sgd_SetLightPriority(light.i, priority.i) As "sgd_SetLightPriority";
    ; ! Get light priority.
    sgd_GetLightPriority(light.i) As "sgd_GetLightPriority";
    ; ! Set light color.
    sgd_SetLightColor(light.i, red.f, green.f, blue.f, alpha.f) As "sgd_SetLightColor";
    ; ! Set point/spot light range.
    sgd_SetLightRange(light.i, range.f) As "sgd_SetLightRange";
    ; ! Set point/spot light falloff.
    sgd_SetLightFalloff(light.i, falloff.f) As "sgd_SetLightFalloff";
    ; ! Set spot light inner cone angle IN degrees.
    sgd_SetLightInnerConeAngle(light.i, angle.f) As "sgd_SetLightInnerConeAngle";
    ; ! Set spot light outer cone angle IN degrees.
    sgd_SetLightOuterConeAngle(light.i, angle.f) As "sgd_SetLightOuterConeAngle";

    
    ;-! @defgroup Model Model
    ; ! Load a model.
    sgd_LoadModel(path.SGD_String ) As "sgd_LoadModel";
    ; ! Load a boned model.
    sgd_LoadBonedModel(path.SGD_String , skinned.i) As "sgd_LoadBonedModel";
    ; ! Create a new model.
    sgd_CreateModel(mesh.i) As "sgd_CreateModel";
    ; ! Set model mesh.
    sgd_SetModelMesh(model.i, mesh.i) As "sgd_SetModelMesh";
    ; ! Get model mesh.
    sgd_GetModelMesh(model.i) As "sgd_GetModelMesh";
    ; ! Set model color.
    sgd_SetModelColor(model.i, red.f, green.f, blue.f, alpha.f) As "sgd_SetModelColor";
    ; ! Animate a model.
    sgd_AnimateModel(model.i, animation.i, time.f, animationMode.i,weight.f) As "sgd_AnimateModel";

    ;-! @defgroup Skybox Skybox
    ; ! Load a skybox.
    sgd_LoadSkybox(path.SGD_String, roughness.f) As "sgd_LoadSkybox";
    ; ! Create a new skybox.
    sgd_CreateSkybox(texture.i) As "sgd_CreateSkybox";
    ; ! Set skybox texture.
    sgd_SetSkyboxTexture(skybox.i, texture.i) As "sgd_SetSkyboxTexture";
    ; ! Set skybox roughness IN the range 0 To 1.
    sgd_SetSkyboxRoughness(skybox.i, roughness.f) As "sgd_SetSkyboxRoughness";
    
    ;-! @defgroup Plane Plane
    ; ! Create a new Plane entity.
    sgd_CreatePlane(material.i) As "sgd_CreatePlane";
    ; ! Set plane material.
    sgd_SetPlaneMaterial(plane.i, material.i) As "sgd_SetPlaneMaterial";
    ; ! Get plane material.
    sgd_GetPlaneMaterial(plane.i) As "sgd_GetPlaneMaterial";

    ;-! @defgroup Terrain Terrain
    ; ! Create a new terrain.
    sgd_CreateTerrain() As "sgd_CreateTerrain";
    ; ! Set terrain size.
    sgd_SetTerrainSize(terrain.i, size.i) As "sgd_SetTerrainSize";
    ; ! Set terrain level-of-details.
    sgd_SetTerrainLODs(terrain.i, Loods.i) As "sgd_SetTerrainLODs";
    ; ! Set terrain material.
    sgd_SetTerrainMaterial(terrain.i,material.i) As "sgd_SetTerrainMaterial";
    ; ! Set terrain material size.
    sgd_SetTerrainMaterialSize(terrain.i, materialSize.i) As "sgd_SetTerrainMaterialSize";
    ; ! Set terrain height texture.
    sgd_SetTerrainHeightTexture(terrain.i, texture.i) As "sgd_SetTerrainHeightTexture";
    ; ! Set terrain normal texture.
    sgd_SetTerrainNormalTexture(terrain.i, texture.i) As "sgd_SetTerrainNormalTexture";
    ; ! Set terrain Debug mode.
    sgd_SetTerrainDebugMode(terrain.i, debugMode.i) As "sgd_SetTerrainDebugMode";

    ;-! @defgroup Sprite Sprite
    ; ! Create a new sprite.
    sgd_CreateSprite(image.i) As "sgd_CreateSprite";
    ; ! Set sprite material.
    sgd_SetSpriteImage(sprite.i, image.i) As "sgd_SetSpriteImage";
    ; ! Set sprite color.
    sgd_SetSpriteColor(sprite.i, red.f, green.f, blue.f, alpha.f) As "sgd_SetSpriteColor";
    ; ! Set sprite animation frame.
    sgd_SetSpriteFrame(sprite.i, frame.f) As "sgd_SetSpriteFrame";
    
    ;-! @defgroup Collision Collision
    ; ! Create a new sphere collider And attach it To entity.
    sgd_CreateSphereCollider(entity.i, colliderType.i, radius.f) As "sgd_CreateSphereCollider";
    ; ! Create a new ellipsoid collider And attach it To entity.
    sgd_CreateEllipsoidCollider(entity.i, colliderType.i, radius.f, height.f) As "sgd_CreateEllipsoidCollider";
    ; ! Create a new mesh collider And attach it To entity.
    sgd_CreateMeshCollider(entity.i, colliderType.i, mesh.i) As "sgd_CreateMeshCollider";
    ; ! Create a new plane collider And attach it To entity.
    sgd_CreatePlaneCollider(entity.i, colliderType.i) As "sgd_CreatePlaneCollider";
    ; ! Return entity a collider is attached To.
    sgd_GetColliderEntity(collider.i) As "sgd_GetColliderEntity";
    ; ! Get collider type.
    sgd_GetColliderType(collider.i) As "sgd_GetColliderType";
    ; ! Set sphere Or ellipsoid collider radius.
    sgd_SetColliderRadius(collider.i, radius.f) As "sgd_SetColliderRadius";
    ; ! Set ellipsoid collider height.
    sgd_SetColliderHeight(collider.i, height.f) As "sgd_SetColliderHeight";
    ; ! Enable collisons between 2 collider types.
    sgd_EnableCollisions(srcColliderType.i, dstColliderType.i, response.i) As "sgd_EnableCollisions";
    ; ! Update enabled colliders.
    sgd_UpdateColliders() As "sgd_UpdateColliders";
    ; ! Get collisions generated by sgd_UpdateColliders For moving collider.
    sgd_GetCollisionCount(collider.i) As "sgd_GetCollisionCount";
    ; ! Get the collider a collision was With.
    sgd_GetCollisionCollider(collider.i, index.i) As "sgd_GetCollisionCollider";
    ; ! Get collision X coordinate.
    sgd_GetCollisionX.SGD_Real(collider.i, index.i) As "sgd_GetCollisionX";
    ; ! Get collision Y coordinate.
    sgd_GetCollisionY.SGD_Real(collider.i, index.i) As "sgd_GetCollisionY";
    ; ! Get collision Z coordinate.
    sgd_GetCollisionZ.SGD_Real(collider.i, index.i) As "sgd_GetCollisionZ";
    ; ! Get collision normal X component.
    sgd_GetCollisionNX.SGD_Real(collider.i, index.i) As "sgd_GetCollisionNX";
    ; ! Get collision normal Y component.
    sgd_GetCollisionNY.SGD_Real(collider.i, index.i) As "sgd_GetCollisionNY";
    ; ! Get collision normal Z component.
    sgd_GetCollisionNZ.SGD_Real(collider.i, index.i) As "sgd_GetCollisionNZ";

    ;-! @defgroup Picking Picking
    ; ! Pick first collider along ray passing from camera eye through window coordinates.
    ; ! Note that the colliderMask parameter is a 'bitmask' value, where each '1' bit IN the value's binary representation
    ; ! repesents a collider type you want To be included IN the pick, allowing you To pick more than 1 collider type IN a single
    ; ! pick.
    ; ! For example, If you want the pick To include collider types 0 And 3, you would set bits 0 And 3 IN the colliderMask,
    ; ! resuling IN a value of 2^0 | 2^3 == 9.
    ; ! If you want the pick To include *all* collider types, use a colliderMask of -1, a bitmask value With all bits set.
    sgd_CameraPick(camera.i, windowX.f, windowY.f, colliderMask.i) As "sgd_CameraPick";
    ; ! Pick first collider along line.
    ; ! Please see @ref sgd_CameraPick For more information about the colliderMask parameter.
    sgd_LinePick(x0.SGD_Real ,y0.SGD_Real , z0.SGD_Real , x1.SGD_Real , y1.SGD_Real , z1.SGD_Real ,radius.SGD_Real, colliderMask.i) As "sgd_LinePick";
    ; ! X coordinate of pick contact point IN world space.
    sgd_GetPickedX.SGD_Real() As "sgd_GetPickedX";
    ; ! Y coordinate of pick contact point IN world space.
    sgd_GetPickedY.SGD_Real() As "sgd_GetPickedY";
    ; ! Z coordinate of pick contact point IN world space.
    sgd_GetPickedZ.SGD_Real() As "sgd_GetPickedZ";
    ; ! X compnent of pick contact normal IN world space.
    sgd_GetPickedNX.SGD_Real() As "sgd_GetPickedNX";
    ; ! Y component of pick contact normal IN world space.
    sgd_GetPickedNY.SGD_Real() As "sgd_GetPickedNY";
    ; ! Z component of pick contact normal IN world space.
    sgd_GetPickedNZ.SGD_Real() As "sgd_GetPickedNZ";

    ;-! @defgroup RenderEffect RenderEffect
    ; ! Create a new bloom effect And ADD it To the scene.
    sgd_CreateBloomEffect() As "sgd_CreateBloomEffect";
    ; ! Set bloom render effect radius, should be IN the range 1 To 31 inclusive, defaults To 2.
    sgd_SetBloomEffectRadius(effect.i, radius.i) As "sgd_SetBloomEffectRadius";
    ; ! Get bloom render effect radius.
    sgd_GetBloomEffectRadius(effect.i) As "sgd_GetBloomEffectRadius";
    ; ! Create a new blur render effect And ADD it To the scene.
    sgd_CreateBlurEffect() As "sgd_CreateBlurEffect";
    ; ! Set blur render effect radius, should be IN the range 1 To 31 inclusive, defaults To 2.
    sgd_SetBlurEffectRadius(effect.i, radius.i) As "sgd_SetBlurEffectRadius";
    ; ! Get blur render effect radius.
    sgd_GetBlurEffectRadius(effect.i) As "sgd_GetBlurEffectRadius";
    ; ! Create a new fog render effect And ADD it To the scene.
    sgd_CreateFogEffect() As "sgd_CreateFogEffect";
    ; ! Set fog render effect color. Defaults To .8, .9, 1, 1
    sgd_SetFogEffectColor(effect.i, red.f, green.f, blue.f, alpha.f) As "sgd_SetFogEffectColor";
    ; ! Set fog render effect range. Defaults To .1, 1000
    sgd_SetFogEffectRange(effect.i, near.f, far.f) As "sgd_SetFogEffectRange";
    ; ! Set fog render effect power. Defaults To 2.
    sgd_SetFogEffectPower(effect.i, power.f) As "sgd_SetFogEffectPower";
    ; ! Create a new monocolor render effect And ADD it To the scene.
    sgd_CreateMonocolorEffect() As "sgd_CreateMonocolorEffect";
    ; ! Set monocolor render effect color, defaults To 1,1,1,1.
    sgd_SetMonocolorEffectColor(effect.i, red.f, green.f, blue.f, alpha.f) As "sgd_SetMonocolorEffectColor";
    ; ! Set render effect enabled.
    sgd_SetRenderEffectEnabled(effect.i, enabled.i) As "sgd_SetRenderEffectEnabled";
    ; ! Is render effect enabled.
    sgd_IsRenderEffectEnabled(effect.i) As "sgd_IsRenderEffectEnabled";

    ;-! @defgroup Audio Audio
    ; ! Load a new sound.
    sgd_LoadSound(path.SGD_String ) As "sgd_LoadSound";
    ; ! Play a sound, returning an audio stream..
    sgd_PlaySound(sound.i) As "sgd_PlaySound";
    ; ! Cue a sound. The returned audio stream must be unpaused before it will start.
    sgd_CueSound(sound.i) As "sgd_CueSound";
    ; ! Set audio volume.
    sgd_SetAudioVolume(audio.i, volume.f) As "sgd_SetAudioVolume";
    ; ! Set audio pan.
    sgd_SetAudioPan(audio.i, pan,f) As "sgd_SetAudioPan";
    ; ! Set audio pitch scale.
    sgd_SetAudioPitchScale(audio.i, scale.f) As "sgd_SetAudioPitchScale";
    ; ! Set audio looping flag.
    sgd_SetAudioLooping(audio.i, looping.i) As "sgd_SetAudioLooping";
    ; ! Set audio paused flag.
    sgd_SetAudioPaused(audio.i, paused.i) As "sgd_SetAudioPaused";
    ; ! Get audio valid flag. Audio is valid If it is playing Or paused.
    sgd_IsAudioValid(audio.i) As "sgd_IsAudioValid";
    ; ! Stop audio.
    sgd_StopAudio(audio.i) As "sgd_StopAudio" ;
    ; ! Set 3D audio config. All paremters Default To 1.
    sgd_Set3DAudioConfig(rolloffScale.f, dopplerScale.f, distanceScale.f) As "sgd_Set3DAudioConfig";
    ; ! Create 3D audio listener attached To entity. Only one audio listener is currently supported.
    sgd_Create3DAudioListener(entity.i) As "sgd_Create3DAudioListener";
    ; ! Play 3D sound at entity position And velocity.
    sgd_Play3DSound(sound.i, entity.i) As "3D";
    ; ! Update 3D audio. Must be called To update 3D rolloff And doppler effects.
    sgd_Update3DAudio() As "sgd_Update3DAudio";

    ;sgd_ImGui_ImplSGD_Init() As "sgd_ImGui_ImplSGD_Init"                      ; intern? 
    ;sgd_ImGui_ImplSGD_NewFrame() As "sgd_ImGui_ImplSGD_NewFrame"              ; intern?
    ;sgd_ImGui_ImplSGD_RenderDrawData() As "sgd_ImGui_ImplSGD_RenderDrawData"  ; intern?
    ;sgd_ImGui_ImplSGD_Shutdown() As "sgd_ImGui_ImplSGD_Shutdown"              ; intern?
    
  
  EndImport

  
EndImport

start.pb

Code: Alles auswählen


XIncludeFile "keycodes.pb"
XIncludeFile "sgd.pb"

XIncludeFile "sgd_dynamic.pbi"

Procedure.s myAscii(string1$)
 ; Umwandlung Text in ASCII Code
 Static myString.s
 myString.s = Space(256)
 PokeS (@myString.s, string1$, -1, #PB_Ascii)
  
 ProcedureReturn myString
EndProcedure

Global player
Global player_rvx.f,player_rvy.f
Global player_vx.f,player_vy,player_vz.f

Global camera
Global camera_rx.f,camera_ry.f

Procedure CreatePlayer(mesh)

	player = sgd_CreateModel(mesh)
	
	camera = sgd_CreatePerspectiveCamera()
	sgd_SetEntityParent (camera,player)
	
EndProcedure

Procedure PlayerWalk(speed.f)

	If sgd_IsKeyDown(#KEY_LEFT)
		player_rvy = player_rvy + (1.5-player_rvy) * 0.3
	ElseIf sgd_IsKeyDown(#KEY_RIGHT)
		player_rvy = player_rvy + (-1.5-player_rvy) * 0.3
	Else
		player_rvy = player_rvy * 0.9
	EndIf
	sgd_RotateEntity (player,0,player_rvy,0)

	If sgd_IsKeyDown(#KEY_DOWN)
		camera_rx = camera_rx + (-45-camera_rx) * 0.025
	ElseIf sgd_IsKeyDown(KEY_UP)
		camera_rx = camera_rx + (45-camera_rx) * 0.025
	Else 
		camera_rx = camera_rx * 0.9
	EndIf
	sgd_SetEntityRotation (camera,camera_rx,0,0)
	
	If sgd_IsKeyDown(#KEY_W)
		player_vz = player_vz + (speed-player_vz) * 0.3
	ElseIf sgd_IsKeyDown(#KEY_S)
		player_vz = player_vz + (-speed-player_vz) * 0.3
	Else
		player_vz = player_vz * 0.9
	EndIf
	
	If sgd_IsKeyDown(#KEY_A)
		player_vx = player_vx + (-speed-player_vx) * 0.3
	ElseIf sgd_IsKeyDown(#KEY_D)
		player_vx = player_vx + (speed-player_vx) * 0.3
	Else
		player_vx = player_vx * 0.9
	EndIf
	
	sgd_MoveEntity (player,player_vx,0,player_vz)
	
EndProcedure

Procedure PlayerFly(speed.f)

	If sgd_IsKeyDown(#KEY_LEFT)
		player_rvy = player_rvy + (1.25-player_rvy) * 0.2
	ElseIf sgd_IsKeyDown(#KEY_RIGHT)
		player_rvy = player_rvy + (-1.25-player_rvy) * 0.2
	Else
		player_rvy = player_rvy * 0.9
	EndIf
	sgd_RotateEntity (player,0,player_rvy,0)
	sgd_SetEntityRotation (camera,0,0,player_rvy*-12)
	
	If sgd_IsKeyDown(#KEY_UP)
		player_rvx = player_rvx + (-1.25-player_rvx) * 0.2
	ElseIf sgd_IsKeyDown(#KEY_DOWN)
		player_rvx = player_rvx + (1.25-player_rvx) * 0.2
	Else 
		player_rvx = player_rvx * 0.9
	EndIf
	sgd_TurnEntity (player,player_rvx,0,0)

	If sgd_IsKeyDown(#KEY_W)
		player_vz = player_vz + (speed-player_vz) * 0.3
	ElseIf sgd_IsKeyDown(#KEY_S)
		player_vz = player_vz + (-speed-player_vz) * 0.3
	Else
		player_vz = player_vz * 0.9
	EndIf
	sgd_MoveEntity ( player,0,0,player_vz)

	If sgd_IsKeyDown(#KEY_A)
		player_vx = player_vx + (-speed-player_vx) * 0.3
	ElseIf sgd_IsKeyDown(#KEY_D)
		player_vx = player_vx + (speed-player_vx) * 0.3
	Else
		player_vx = player_vx * 0.9
	EndIf
	sgd_MoveEntity (player,player_vx,0,0)

EndProcedure

Procedure PlayerFly2(speed.f,maxSpeed.f,minSpeed.f)

	If sgd_IsKeyDown(#KEY_LEFT)
		player_rvy = player_rvy + (1.5-player_rvy) * 0.3
	ElseIf sgd_IsKeyDown(#KEY_RIGHT)
		player_rvy = player_rvy + (-1.5-player_rvy) * 0.3
	Else
		player_rvy = player_rvy * 0.9
	EndIf
	sgd_RotateEntity (player,0,player_rvy,0)
	sgd_SetEntityRotation (camera,0,0,player_rvy*-15)
	
	If sgd_IsKeyDown(#KEY_UP)
		player_rvx = player_rvx + (-1.5-player_rvx) * 0.3
	ElseIf sgd_IsKeyDown(#KEY_DOWN)
		player_rvx = player_rvx + (1.5-player_rvx) * 0.3
	Else 
		player_rvx = player_rvx * 0.9
	EndIf
	sgd_TurnEntity (player,player_rvx,0,0)

	If sgd_IsKeyDown(#KEY_W)
		player_vz = player_vz + (maxSpeed-player_vz) * 0.3
	ElseIf sgd_IsKeyDown(#KEY_S)
		player_vz = player_vz + (minSpeed-player_vz) * 0.3
	Else
		player_vz = player_vz + (speed-player_vz) * 0.3
	EndIf
	sgd_MoveEntity (player,0,0,player_vz)

	If sgd_IsKeyDown(#KEY_A)
		player_vx = player_vx + (-speed-player_vx) * 0.3
	ElseIf sgd_IsKeyDown(#KEY_D)
		player_vx = player_vx + (speed-player_vx) * 0.3
	Else
		player_vx = player_vx * 0.9
	EndIf
	sgd_MoveEntity (player,player_vx,0,0)

EndProcedure
Zuletzt geändert von mpz am 10.11.2024 12:51, insgesamt 2-mal geändert.
Working on :lol: - LibSGD - MP3D Engine - 8)
Benutzeravatar
mpz
Beiträge: 505
Registriert: 14.06.2005 15:53
Computerausstattung: Win 11 Pro, 48 GB Ram, Intel I7 CPU und RX4070 Grafikkarte, PB (4/5) 6.12LT
Wohnort: Berlin, Tempelhof

Re: LibSGD (vom Blitz3d Programmierer)

Beitrag von mpz »

Hallo,


4) Hier Demos (hab noch ein paar mehr wer will)

Gruss Michael


Demo "helmet.pb" 3d OBjekt

Code: Alles auswählen

; First Test of the sgd_Library

XIncludeFile "start.pb"

Titel.s = "Helmet!"
Pfad.s = "sgd://envmaps/sunnysky-cube.png"

sgd_init()

ExamineDesktops()
sgd_CreateWindow (DesktopWidth(0)/2 , DesktopHeight(0)/2 , myAscii(Titel), #WINDOW_FLAGS_CENTERED)

env = sgd_LoadCubeTexture(myAscii(Pfad),#TEXTURE_FORMAT_ANY,#TEXTURE_FLAGS_DEFAULT)

sgd_SetEnvTexture(env)

skybox = sgd_CreateSkybox(env)
sgd_SetSkyboxRoughness (skybox, 0.3)

light = sgd_CreateDirectionalLight()
sgd_TurnEntity (light,-45,0,0	) ; Tilt light down 45 degrees 

material = sgd_LoadPBRMaterial(myAscii("sgd://materials/Tiles019_1K-JPG"))
mesh = sgd_CreateBoxMesh(-10,-3,-10,10,-2,10,material)
sgd_TransformTexCoords (mesh,3,3,0,0)
ground = sgd_CreateModel(mesh)

mesh = sgd_LoadMesh(myAscii("sgd://models/helmet.glb"))
model=sgd_CreateModel(mesh)
sgd_MoveEntity (model,0,0,3)

While Not sgd_PollEvents()

	If sgd_IsKeyDown(263)
		sgd_TurnEntity (model,0,3,0)
	ElseIf sgd_IsKeyDown(262)
		sgd_TurnEntity (model,0,-3,0)
	EndIf
	
	If sgd_IsKeyDown(264)
		sgd_TurnEntity (model,3,0,0)
	ElseIf sgd_IsKeyDown(265)
		sgd_TurnEntity (model,-3,0,0)
	EndIf
	
	sgd_RenderScene()
	
	sgd_Present()
	
Wend
Demo "terrain.pb" Unser geliebtes deadvally als flug

Code: Alles auswählen

XIncludeFile  "start.pb"

sgd_init()

ExamineDesktops()
sgd_CreateWindow (DesktopWidth(0)/2 , DesktopHeight(0)/2 , myAscii("Canyon!"), #WINDOW_FLAGS_CENTERED)

sgd_SetEnvTexture (sgd_LoadCubeTexture(myAscii("sgd://envmaps/sunnysky-cube.png"),#TEXTURE_FORMAT_ANY,#TEXTURE_FLAGS_DEFAULT))


sgd_SetAmbientLightColor (1,0.9,0.8,0.1)

light = sgd_CreateDirectionalLight()
sgd_SetEntityRotation (light,-45,-45,0)

fog = sgd_CreateFogEffect()
sgd_SetClearColor (0.5,0.8,1,1)
sgd_SetFogEffectColor (fog,0.5,0.8,1,1)
sgd_SetFogEffectRange (fog,0.2,2000)
sgd_SetFogEffectPower (fog,2.5)

heightTexture = sgd_Load2DTexture(myAscii("sgd://terrains/canyon/height.exr"), #TEXTURE_FORMAT_ANY, #TEXTURE_FLAGS_DEFAULT)
normalTexture = sgd_Load2DTexture(myAscii("sgd://terrains/canyon/normal.png"), #TEXTURE_FORMAT_RGBA8, #TEXTURE_FLAGS_DEFAULT)
albedoTexture = sgd_Load2DTexture(myAscii("sgd://terrains/canyon/albedo.png"), #TEXTURE_FORMAT_ANY, #TEXTURE_FLAGS_DEFAULT)

;Local heightTexture = Load2DTexture("~/Desktop/rocky/height.exr", TEXTURE_FORMAT_ANY, TEXTURE_FLAGS_IMAGE)
;Local normalTexture = Load2DTexture("~/Desktop/rocky/normal.png", TEXTURE_FORMAT_RGBA8, TEXTURE_FLAGS_IMAGE)
;Local albedoTexture = Load2DTexture("~/Desktop/rocky/albedo.png", TEXTURE_FORMAT_ANY, TEXTURE_FLAGS_IMAGE)

material=sgd_CreatePBRMaterial()
sgd_SetMaterialTexture (material,myAscii("albedo"),albedoTexture)

terrain = sgd_CreateTerrain()
sgd_SetEntityScale (terrain,1,512,1)
sgd_SetTerrainSize (terrain,4096)
sgd_SetTerrainLODs (terrain,5)
sgd_SetTerrainMaterialSize (terrain,4096)
sgd_SetTerrainHeightTexture (terrain,heightTexture)
sgd_SetTerrainNormalTexture (terrain,normalTexture)
sgd_SetTerrainMaterial (terrain,material)

createPlayer(0)
sgd_MoveEntity (player,0,512,-1024)

sgd_SetCameraNear (camera,0.2)
sgd_SetCameraFar (camera,2000)

De_bug=0

While (sgd_PollEvents() And 1)<>1

;	PlayerFly2(.75,1.25,.25)
	PlayerFly2(0.25,0.5,0.125)
	
	If sgd_IsKeyHit(#KEY_SPACE)
		De_bug=1-De_bug
		sgd_SetTerrainDebugMode (terrain,De_bug)
	EndIf
	
	sgd_Clear2D()
	sgd_Draw2DText (myAscii("Camera: "+sgd_GetEntityX(camera)+","+sgd_GetEntityY(camera)+","+sgd_GetEntityZ(camera)),0,0)
	sgd_Draw2DText (myAscii("Debug (space to toggle): "+De_bug),0,16)
	sgd_Draw2DText (myAscii("FPS:"+StrF(sgd_GetFPS(),1)),0,32)
	;sgd_Draw2DText "FPS: "+GetFPS(),0,32
	
	sgd_RenderScene()
	
	sgd_Present()
Wend
Demo "tower.pb" fliegen um den Eifelturm mit collisionserkennung

Code: Alles auswählen

XIncludeFile  "start.pb"

sgd_init()

ExamineDesktops()
sgd_CreateWindow (DesktopWidth(0)/2 , DesktopHeight(0)/2 , myAscii("Sprite Grass"), #WINDOW_FLAGS_CENTERED)

;Create fog
fog = sgd_CreateFogEffect()
sgd_SetFogEffectColor (fog,0.3,0.6,1,1)
sgd_SetFogEffectPower (fog,2)

light = sgd_CreateDirectionalLight()
sgd_SetLightShadowsEnabled (light,#True)
sgd_SetEntityRotation (light,-30,0,0)

env =  sgd_LoadCubeTexture(myAscii("sgd://envmaps/sunnysky-cube.png"),#TEXTURE_FORMAT_ANY,#TEXTURE_FLAGS_DEFAULT)
sgd_SetEnvTexture (env)

sgd_SetClearColor (0.3,0.6,1,1)

; Actual height of eiffel tower, fact fans!
sz.f=330

sgd_SetConfigVar (myAscii("csm.clipRange"),myAscii(StrF (sz*2)))
sgd_UpdateShadowMappingConfig()

groundMaterial = sgd_LoadPBRMaterial(myAscii("sgd://misc/grass1K.jpg"))
sgd_SetMaterialFloat (groundMaterial,myAscii("roughness"),1)

groundMesh = sgd_CreateBoxMesh(-sz,0,-sz,sz,0,sz,groundMaterial)
sgd_TransformTexCoords (groundMesh,sz,sz,0,0)
ground = sgd_CreateModel(groundMesh)
sgd_CreateMeshCollider(ground, 0, 0)

towerMesh = sgd_LoadMesh(myAscii("sgd://models/eiffel_tower.glb"))
sgd_SetMeshShadowsEnabled (towerMesh,True)
sgd_FitMesh(towerMesh,-sz/2,0,-sz/2,sz/2,sz,sz/2,True)
tower = sgd_CreateModel(towerMesh)
sgd_CreateMeshCollider(tower, 0, 0)

createPlayer(0)
sgd_MoveEntity( player,0,1,0)
sgd_CreateSphereCollider(player, 1, 1);

sgd_EnableCollisions (1,0,2)

While (sgd_PollEvents() And 1)<>1

	PlayerFly(0.25)
	
	sgd_RotateEntity (light,0,0.025,0)
	
	sgd_UpdateColliders()
	
	sgd_Clear2D()
	;Draw2DText "FPS:"+GetFPS(),0,0
	sgd_Draw2DText (myAscii("FPS:"+StrF(sgd_GetFPS(),1)),0,0)
	sgd_RenderScene()
	
	sgd_Present()
Wend
Working on :lol: - LibSGD - MP3D Engine - 8)
Benutzeravatar
mpz
Beiträge: 505
Registriert: 14.06.2005 15:53
Computerausstattung: Win 11 Pro, 48 GB Ram, Intel I7 CPU und RX4070 Grafikkarte, PB (4/5) 6.12LT
Wohnort: Berlin, Tempelhof

Re: LibSGD (vom Blitz3d Programmierer)

Beitrag von mpz »

hi,

Habe jetzt alle Demos und files auf Github raufgeladen

https://github.com/MPzCodes/LibSGD

Gruss
Working on :lol: - LibSGD - MP3D Engine - 8)
Benutzeravatar
dige
Beiträge: 1235
Registriert: 08.09.2004 08:53

Re: LibSGD (vom Blitz3d Programmierer)

Beitrag von dige »

Hallo Micha, ich kann die Bilder im ersten Beitrag leider nicht sehen und habe daher Schwierigkeiten, das Thema zu verstehen. Auch auf den LibSDG-Seiten habe ich dazu keine weiteren Informationen gefunden. Für mich wäre es hilfreich, mehr darüber zu erfahren, um einschätzen zu können, ob es sich lohnt, mich damit zu beschäftigen.

Ciao Dige
"Papa, ich laufe schneller - dann ist es nicht so weit."
Benutzeravatar
mpz
Beiträge: 505
Registriert: 14.06.2005 15:53
Computerausstattung: Win 11 Pro, 48 GB Ram, Intel I7 CPU und RX4070 Grafikkarte, PB (4/5) 6.12LT
Wohnort: Berlin, Tempelhof

Re: LibSGD (vom Blitz3d Programmierer)

Beitrag von mpz »

Hi Dige,

ich habe die mal hier die Bilder als links fertig gemacht

Bilder als link

https://c.web.de/@334971174352067001/M2 ... UCO9XENgWQ

https://c.web.de/@334971174352067001/_F ... 3-vHyccBPQ

https://c.web.de/@334971174352067001/pJ ... p8eqz52g2g

Hier 3 ausführbare Dateien die ich mit Blitz3D (ja ist wirklich OpenGL nicht DX7) und der Engine als exe fertig gemacht habe. Unter Purebasic sieht es genauso aus.

P.S. Ich weiss hat was mit Vertrauen zu tun. Bin aber hier schon 20 Jahre dabei...

animblender.exe
https://c.web.de/@334971174352067001/ho ... Ea5zJMaPuw

colide.exe
https://c.web.de/@334971174352067001/5O ... y1OwoAL2tw

tower.exe
https://c.web.de/@334971174352067001/XR ... GfnjqAHEaA

Alternativ 2,8 Euro für patreon investieren und mit der runterladbaren dll selber mit meinen Quellcodes testen...

Versuch der Erklärung: Die Engine ist für mich wie Weihnachten, also back to the roots aber modern...

Gruss
Working on :lol: - LibSGD - MP3D Engine - 8)
xperience2003
Beiträge: 972
Registriert: 04.10.2004 18:42
Computerausstattung: Amiga, LinuxMint, Windows7
Wohnort: gotha
Kontaktdaten:

Re: LibSGD (vom Blitz3d Programmierer)

Beitrag von xperience2003 »

wie genial, hab das dingen schon gesucht

danke
amiga rulez...
Rebirth Software
Benutzeravatar
dige
Beiträge: 1235
Registriert: 08.09.2004 08:53

Re: LibSGD (vom Blitz3d Programmierer)

Beitrag von dige »

mpz hat geschrieben: 10.11.2024 19:04 Hi Dige,

ich habe die mal hier die Bilder als links fertig gemacht
[..]
Danke! :D
"Papa, ich laufe schneller - dann ist es nicht so weit."
Benutzeravatar
mpz
Beiträge: 505
Registriert: 14.06.2005 15:53
Computerausstattung: Win 11 Pro, 48 GB Ram, Intel I7 CPU und RX4070 Grafikkarte, PB (4/5) 6.12LT
Wohnort: Berlin, Tempelhof

Re: LibSGD (vom Blitz3d Programmierer)

Beitrag von mpz »

Marc Sibley ist leider verstorben, siehe erster Post

Gruss Michael
Working on :lol: - LibSGD - MP3D Engine - 8)
Benutzeravatar
mpz
Beiträge: 505
Registriert: 14.06.2005 15:53
Computerausstattung: Win 11 Pro, 48 GB Ram, Intel I7 CPU und RX4070 Grafikkarte, PB (4/5) 6.12LT
Wohnort: Berlin, Tempelhof

Re: LibSGD (vom Blitz3d Programmierer)

Beitrag von mpz »

Hi,

Ich habe die neuste Version libSGD v0.18 für Purebasic zum sofortigen vewenden angepasst und auch die Assets Dateien zum download bereitgestellt.

Link, siehe erster Post

Gruss
Working on :lol: - LibSGD - MP3D Engine - 8)
Antworten