@@ -158,7 +158,7 @@ Your folder structure should now look like this:
158158 In the ``src `` folder, we'll start with creating our header file for the
159159GDExtension node we'll be creating. We will name it ``gdexample.h ``:
160160
161- .. code-block :: C++
161+ .. code-block :: cpp
162162
163163 #ifndef GDEXAMPLE_H
164164 #define GDEXAMPLE_H
@@ -211,7 +211,7 @@ as the ``_process`` function you're used to in GDScript.
211211
212212Let's implement our functions by creating our ``gdexample.cpp `` file:
213213
214- .. code-block :: C++
214+ .. code-block :: cpp
215215
216216 #include "gdexample.h"
217217 #include <godot_cpp/core/class_db.hpp>
@@ -250,7 +250,7 @@ and source file like we've implemented ``GDExample`` up above. What we need now
250250is a small bit of code that tells Godot about all the classes in our
251251GDExtension plugin.
252252
253- .. code-block :: C++
253+ .. code-block :: cpp
254254
255255 #include "register_types.h"
256256
@@ -303,7 +303,7 @@ Furthermore, it sets the level of initialization (core, servers, scene, editor,
303303At last, we need the header file for the ``register_types.cpp `` named
304304``register_types.h ``.
305305
306- .. code-block :: C++
306+ .. code-block :: cpp
307307
308308 #ifndef GDEXAMPLE_REGISTER_TYPES_H
309309 #define GDEXAMPLE_REGISTER_TYPES_H
@@ -466,7 +466,7 @@ Lets add a property that allows us to control the amplitude of our wave.
466466In our ``gdexample.h `` file we need to add a member variable and getter and setter
467467functions:
468468
469- .. code-block :: C++
469+ .. code-block :: cpp
470470
471471 ...
472472 private:
@@ -481,7 +481,7 @@ functions:
481481 In our ``gdexample.cpp `` file we need to make a number of changes, we will only
482482show the methods we end up changing, don't remove the lines we're omitting:
483483
484- .. code-block :: C++
484+ .. code-block :: cpp
485485
486486 void GDExample::_bind_methods() {
487487 ClassDB::bind_method(D_METHOD("get_amplitude"), &GDExample::get_amplitude);
@@ -523,7 +523,7 @@ Let's do the same but for the speed of our animation and use a setter and getter
523523function. Our ``gdexample.h `` header file again only needs a few more lines of
524524code:
525525
526- .. code-block :: C++
526+ .. code-block :: cpp
527527
528528 ...
529529 double amplitude;
@@ -537,7 +537,7 @@ code:
537537 This requires a few more changes to our ``gdexample.cpp `` file, again we're only
538538showing the methods that have changed so don't remove anything we're omitting:
539539
540- .. code-block :: C++
540+ .. code-block :: cpp
541541
542542 void GDExample::_bind_methods() {
543543 ...
@@ -594,7 +594,7 @@ would need to showcase a far more complete example.
594594
595595This is the required syntax:
596596
597- .. code-block :: C++
597+ .. code-block :: cpp
598598
599599 some_other_node->connect("the_signal", this, "my_method");
600600
@@ -607,7 +607,7 @@ emit a signal every time a second has passed and pass the new location along.
607607
608608In our ``gdexample.h `` header file, we need to define a new member ``time_emit ``:
609609
610- .. code-block :: C++
610+ .. code-block :: cpp
611611
612612 ...
613613 double time_passed;
@@ -622,7 +622,7 @@ constructor. We'll look at the other 2 needed changes one by one.
622622In our ``_bind_methods `` method, we need to declare our signal. This is done
623623as follows:
624624
625- .. code-block :: C++
625+ .. code-block :: cpp
626626
627627 void GDExample::_bind_methods() {
628628 ...
@@ -643,7 +643,7 @@ of type ``Vector2``, respectively named "node" and "new_pos".
643643
644644Next, we'll need to change our ``_process `` method:
645645
646- .. code-block :: C++
646+ .. code-block :: cpp
647647
648648 void GDExample::_process(double delta) {
649649 time_passed += speed * delta;
0 commit comments