diff --git a/.vscode/launch.json b/.vscode/launch.json index 2e8b567..6d2a420 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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", + } } ] } \ No newline at end of file diff --git a/examples/demo_sdl2_gpu.nim b/examples/demo_sdl2_gpu.nim index 05251c7..0de0cb3 100644 --- a/examples/demo_sdl2_gpu.nim +++ b/examples/demo_sdl2_gpu.nim @@ -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") diff --git a/nanovg.nimble b/nanovg.nimble index 06e28bd..940d858 100644 --- a/nanovg.nimble +++ b/nanovg.nimble @@ -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"