-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): more documentation (#73)
* feat(docs): more documentation * fix: remove unwanted file
- Loading branch information
Showing
9 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
breathe | ||
sphinx>=2.0 | ||
sphinx>=2.0 | ||
m2r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
tutorial: Quick And Dirty | ||
============================================ | ||
|
||
prerequisites | ||
----------------------- | ||
|
||
You'll need to have a basic ``CMakeLists.txt`` to able to compile your code: | ||
|
||
.. literalinclude:: ../../../examples/quick_and_dirty/CMakeLists.txt | ||
:language: cmake | ||
|
||
And below a cpp file with the primitives needed to launch your game: | ||
|
||
.. literalinclude:: ../../../examples/quick_and_dirty/quick_and_dirty.cpp | ||
:language: cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Tutorials | ||
============================================ | ||
|
||
.. toctree:: | ||
:caption: Antara Gaming SDK Tutorials | ||
:name: tutorialtoc | ||
:maxdepth: 2 | ||
|
||
quick_and_dirty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
add_subdirectory(quick_and_dirty) | ||
if (USE_SFML_ANTARA_WRAPPER) | ||
add_subdirectory(sfml) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
##! Uncomment those lines if you use the gaming sdk as an external project | ||
#if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | ||
# set(LINUX TRUE) | ||
#endif () | ||
|
||
#include(FetchContent) | ||
|
||
#FetchContent_Declare( | ||
# antara-gaming-sdk | ||
# URL https://github.com/KomodoPlatform/antara-gaming-sdk/archive/master.zip | ||
#) | ||
|
||
#FetchContent_MakeAvailable(antara-gaming-sdk) | ||
#init_apple_env() | ||
|
||
add_executable(quick_and_dirty quick_and_dirty.cpp) | ||
target_link_libraries(quick_and_dirty PUBLIC antara::world) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/****************************************************************************** | ||
* Copyright © 2013-2019 The Komodo Platform Developers. * | ||
* * | ||
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * | ||
* the top-level directory of this distribution for the individual copyright * | ||
* holder information and the developer policies on copyright and licensing. * | ||
* * | ||
* Unless otherwise agreed in a custom licensing agreement, no part of the * | ||
* Komodo Platform software, including this file may be copied, modified, * | ||
* propagated or distributed except according to the terms contained in the * | ||
* LICENSE file * | ||
* * | ||
* Removal or modification of this copyright notice is prohibited. * | ||
* * | ||
******************************************************************************/ | ||
|
||
#include <iostream> | ||
#include <antara/gaming/core/safe.refl.hpp> | ||
#include <antara/gaming/world/world.app.hpp> | ||
|
||
class example_system final : public antara::gaming::ecs::post_update_system<example_system> | ||
{ | ||
public: | ||
example_system(entt::registry& entity_registry, entt::dispatcher& dispatcher) noexcept : system(entity_registry, | ||
dispatcher) | ||
{ | ||
//! Here you can initialize your systems, adding entities etc | ||
} | ||
|
||
void update() noexcept final | ||
{ | ||
//! Your game logic here | ||
nb_iteration += 1; | ||
std::cout << "nb_iteration: " << nb_iteration << "\n"; | ||
if (nb_iteration == 10ull) { | ||
std::cout << "Maximum iteration reached, leaving game now\n"; | ||
this->dispatcher_.trigger<antara::gaming::event::quit_game>(0); | ||
} | ||
} | ||
|
||
private: | ||
std::size_t nb_iteration{0ull}; | ||
}; | ||
|
||
REFL_AUTO(type(example_system)); | ||
|
||
class my_world_example : public antara::gaming::world::app | ||
{ | ||
public: | ||
my_world_example() | ||
{ | ||
this->system_manager_.create_system<example_system>(); //! Here we load our system to use it. | ||
} | ||
}; | ||
|
||
int main() | ||
{ | ||
my_world_example world; | ||
return world.run(); | ||
} |
29 changes: 29 additions & 0 deletions
29
examples/sfml/flappy-bird-scripted/assets/scripts/scenes/lua/game_scene.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
local function enter() | ||
print("enter game scene") | ||
end | ||
|
||
local function leave() | ||
print("leave game scene") | ||
end | ||
|
||
local function on_key_released(evt) | ||
print("key released: " .. evt.key) | ||
end | ||
|
||
local function on_key_pressed(evt) | ||
print("key pressed: " .. evt.key) | ||
end | ||
|
||
local function update() | ||
print("game scene update") | ||
end | ||
|
||
return { | ||
enter = enter, | ||
leave = leave, | ||
update = update, | ||
on_key_released = on_key_released, | ||
on_key_pressed = on_key_pressed, | ||
scene_active = true | ||
} | ||
|