Skip to content

Commit

Permalink
feat(docs): docs more accurate
Browse files Browse the repository at this point in the history
  • Loading branch information
Milerius committed Oct 3, 2019
1 parent 39c713d commit 2610ff0
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 57 deletions.
1 change: 1 addition & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ add_custom_command(OUTPUT ${SPHINX_INDEX_FILE}
${CMAKE_CURRENT_SOURCE_DIR}/source/tutorials/tutorials.rst
${CMAKE_CURRENT_SOURCE_DIR}/source/tutorials/ecs.rst
${CMAKE_CURRENT_SOURCE_DIR}/source/tutorials/getting_started.rst
${CMAKE_CURRENT_SOURCE_DIR}/source/tutorials/basic_setup.rst
${CMAKE_CURRENT_SOURCE_DIR}/source/tutorials/quick_and_dirty.rst
${DOXYGEN_INDEX_FILE}
MAIN_DEPENDENCY ${SPHINX_SOURCE}/conf.py
Expand Down
1 change: 0 additions & 1 deletion docs/source/helpers/alternative_README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.. role:: raw-html-m2r(raw)
:format: html


antara-gaming-sdk
=================

Expand Down
54 changes: 54 additions & 0 deletions docs/source/tutorials/basic_setup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Setup
^^^^^

In this tutorial I will assume that you want to write a system for a project outside the gaming SDK. (An External Game Project)

Firstly we will need a **CMakeLists.txt**:

.. code-block:: cmake
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the source code and call cmake from there")
endif ()
cmake_minimum_required(VERSION 3.14)
set(CMAKE_CXX_STANDARD 17)
project(my_game_project DESCRIPTION "my_game_description" LANGUAGES CXX)
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message(FATAL_ERROR "Only Clang is supported (minimum LLVM 8.0)")
endif ()
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(${PROJECT_NAME} my_example_system.cpp)
target_link_libraries(${PROJECT_NAME} PUBLIC antara::world)
As the ``CMakeLists.txt`` suggests we also need a **C++** files named ``my_example_system.cpp`` with the following contents:

.. literalinclude:: ../../../examples/common/step_basis_world_compiling.cpp
:language: cpp

And now we can successfully build the setup project that we just made:

.. raw:: html

<embed>
<script id="asciicast-RuOAzT29eEl51cOrsnX1yEFyo" src="https://asciinema.org/a/RuOAzT29eEl51cOrsnX1yEFyo.js" async data-speed="3" data-size="small"></script>
</embed>

59 changes: 4 additions & 55 deletions docs/source/tutorials/ecs.rst
Original file line number Diff line number Diff line change
@@ -1,60 +1,9 @@
Tutorial: antara gaming systems
Tutorial: Antara Gaming Systems
===============================

If you have not read the :doc:`getting started<getting_started>` part yet, I invite you to do it now for the rest of this tutorial.

How to create your own system step by step ?
--------------------------------------------

Setup
^^^^^

In this tutorial I will assume that you want to write a system for a project outside the gaming SDK. (An External Game Project)

Firstly we will need a **CMakeLists.txt**:

.. code-block:: cmake
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the source code and call cmake from there")
endif ()
cmake_minimum_required(VERSION 3.14)
set(CMAKE_CXX_STANDARD 17)
project(my_game_project DESCRIPTION "my_game_description" LANGUAGES CXX)
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message(FATAL_ERROR "Only Clang is supported (minimum LLVM 8.0)")
endif ()
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(${PROJECT_NAME} my_example_system.cpp)
target_link_libraries(${PROJECT_NAME} PUBLIC antara::world)
As the ``CMakeLists.txt`` suggests we also need a **C++** files named ``my_example_system.cpp`` with the following contents:

.. literalinclude:: ../../../examples/common/step_basis_world_compiling.cpp
:language: cpp

And now we can successfully build the setup project that we just made:

.. raw:: html

<embed>
<script id="asciicast-RuOAzT29eEl51cOrsnX1yEFyo" src="https://asciinema.org/a/RuOAzT29eEl51cOrsnX1yEFyo.js" async data-speed="3" data-size="small"></script>
</embed>

.. include:: basic_setup.rst
2 changes: 1 addition & 1 deletion docs/source/tutorials/quick_and_dirty.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Tutorial: Quick And Dirty
============================================

If you have not done the :doc:`getting started<getting_started>` part yet, I invite you to do it now for the rest of this tutorial.
If you have not read the :doc:`getting started<getting_started>` part yet, I invite you to do it now for the rest of this tutorial.

prerequisites
-----------------------
Expand Down

0 comments on commit 2610ff0

Please sign in to comment.