Add debug for sdl2 gpu

This commit is contained in:
Joey Yakimowich-Payne 2020-04-26 16:06:32 -06:00
commit 1a32967fae
3 changed files with 18 additions and 3 deletions

14
.vscode/launch.json vendored
View file

@ -39,6 +39,20 @@
"cwd": "${workspaceRoot}",
"gdbpath": "${workspaceFolder}\\nim-gdb.bat",
}
},
{
"name": "Nim Debug SDL2 GPU",
"type": "gdb",
"request": "launch",
"valuesFormatting": "parseText",
"target": "${workspaceFolder}/build/demosdl2/demo_sdl2_gpu_debug",
"cwd": "${workspaceRoot}",
"gdbpath": "${workspaceFolder}/nim-gdb.bash",
"windows": {
"target": "${workspaceFolder}\\build\\demosdl2\\demo_sdl2_gpu_debug.exe",
"cwd": "${workspaceRoot}",
"gdbpath": "${workspaceFolder}\\nim-gdb.bat",
}
}
]
}

View file

@ -59,9 +59,6 @@ template generateFbo(width, height: float, code: untyped): gpu.Image =
fb.delete()
res
proc windowID*(target: ptr Target): uint32 {.
cdecl, importc: "GPU_getWindowID".}
proc main() =
let
fps = newGraph(RenderStyle.FPS, "Frame Time")

View file

@ -57,6 +57,10 @@ task buildSDL2ExampleDebug, "Build SDL2 example debug":
exec "nimble c --app:gui --debugger:native -o:" & buildDir & "/" & "demo_sdl2_debug".toExe & " -r examples/demo_sdl2.nim"
task buildSDL2GPUExample, "Build SDL2 GPU example":
let buildDir = setupSDL2()
exec "nimble c --app:gui -d:release -d:danger -o:" & buildDir & "/" & "demo_sdl2_gpu".toExe & " -r examples/demo_sdl2_gpu.nim"
task buildSDL2GPUExampleDebug, "Build SDL2 GPU debug example":
let buildDir = setupSDL2()
exec "nimble c --app:gui --debugger:native -o:" & buildDir & "/" & "demo_sdl2_gpu".toExe & " -r examples/demo_sdl2_gpu.nim"