How To Use and Debug GD Extension With Godot 4.1! Advanced Godot!
FinePointCGI FinePointCGI
18.3K subscribers
14,313 views
0

 Published On Sep 30, 2023

Subscribe and learn more from me about Game Development and Programming!

In this video, we'll explore the process of setting up and utilizing C++ with GDExtension for your Godot projects. Learn how integrating C++ can enhance your game development workflow. Whether you're an experienced developer or just starting out, this video will offer step-by-step guidance to effortlessly set up C++ in Godot using GDExtension. Elevate your game's performance and robustness with the combination of C++ and Godot 4.1. Experience the power of merging the best of both domains!

RESOURCES
Python: https://www.python.org/
CPP Extension: https://github.com/godotengine/godot-cpp

SConstruct file:
#!/usr/bin/env python
import os
import sys

env = SConscript("godot-cpp/SConstruct")

For reference:
- CCFLAGS are compilation flags shared between C and C++
- CFLAGS are for C-specific compilation flags
- CXXFLAGS are for C++-specific compilation flags
- CPPFLAGS are for pre-processor flags
- CPPDEFINES are for pre-processor defines
- LINKFLAGS are for linking flags

tweak this if you want to use different folders, or more folders, to store your source code in.
env.Append(CPPPATH=["src/"])
sources = Glob("src/*.cpp")

if env["platform"] == "macos":
library = env.SharedLibrary(
"demoproject/bin/HelloWorld.{}.{}.framework/helloWorld.{}.{}".format(
env["platform"], env["target"], env["platform"], env["target"]
),
source=sources,
)
else:
library = env.SharedLibrary(
"demoproject/bin/HelloWorld{}{}".format(env["suffix"], env["SHLIBSUFFIX"]),
source=sources,
)

Default(library)

Launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?link...
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"preLaunchTask": "build",
"name": "Debug",
"program": "C:\\Users\\FinePointCGI\\Downloads\\Godot_v4.1.1-stable_mono_win64\\Godot_v4.1.1-stable_mono_win64\\Godot_v4.1.1-stable_mono_win64.exe",
"args": ["--path", "C:\\Users\\FinePointCGI\\Documents\\Godot CPP Tutorial\\demoproject"],
"cwd": "${workspaceFolder}"
}
]
}

Tasks.json:
{
// See https://go.microsoft.com/fwlink/?Link...
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "scons -j12 target=template_debug debug_symbols=yes"
}
]
}

BE MY FRIEND:
🐦Add me on Twitter:   / finepointcgi  
Check out my Website: https://finepointcgi.io/
Where to suggestion Things: https://github.com/finepointcgi/Finep...
You can support me on Patreon:   / finepointcgi  
Hang Out with the Guys on Discord:   / discord  

TIMESTAMPS
00:00:00 – Start
00:00:57 – Installing Pyton
00:02:57 – Installing Scons
00:03:55 – Getting the Godot C++ Project
00:06:14 – Compiling the Godot C++ Project
00:08:43 – Oh Boy Its Compiled!
00:10:48 – Setting Up VS Code for C++
00:11:20 – Creating Our First Header File
00:16:38 – Creating Our C++ File
00:19:20 – Building Out Our Constructor
00:20:13 – Registar Our Plugin With Godots Subsystem
00:24:00 – Explaning Initalization Levels
00:25:58 – Using Extern C to Initalize Our Plugin
00:30:38 – How To Build Your Plugin
00:33:39 – Creating Our Godot Project
00:34:29 – Creating a GD Extension File
00:38:30 – Welp Something Blew Up
00:39:01 – Showing Off Our Node
00:40:53 – How To Stop Your Plugin Running in the Background When Not Playing Th Egame
00:42:32 – Why Godot Needs To Be Closed
00:43:46 – How To Move Stuff Around!
00:46:38 – Exposing Our Variables to the Godot Inspector
00:52:07 – Setting Up Our Player Actions
00:52:44 – Creating Signals and Functions for GD Script
00:55:41 – How To Use Our Node With GD Script
00:58:06 – How Can You Debug in VS Code?
01:04:41 – Outro and Recap

MUSIC
Music provided by TheRelaxedMovement.
Check it out here:    / therelaxedm...​  

HASHTAGS:
#C++ #Godot4 #GDExtension

ABOUT MY CHANNEL:
I've been a software developer for over 9 years. I've worked in the game industry for 3 of those years. This channel is used for news on the gaming\programming industry and for tutorials for game\programming development.

How To Use and Debug GD Extension With Godot 4.1! Advanced Godot 4!

show more

Share/Embed