From: Mike Sheldon Date: Sun, 29 Mar 2009 00:46:18 +0000 (+0000) Subject: Add an entity to refer to the current programming language X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94806e9b34e3521b933d7d90f35b09800bf6cfdb;p=libchamplain Add an entity to refer to the current programming language Add a C version of the initialisation example --- diff --git a/docs/tutorial/en/champlain-tutorial.docbook b/docs/tutorial/en/champlain-tutorial.docbook index a542fb4..7ff5fc4 100644 --- a/docs/tutorial/en/champlain-tutorial.docbook +++ b/docs/tutorial/en/champlain-tutorial.docbook @@ -19,30 +19,24 @@ + PythonPerlC"> ]> - + - Conquering The World With - <phrase condition="python">Python</phrase> - <phrase condition="perl">Perl</phrase> - <phrase condition="c">C</phrase> - And Libchamplain - + Conquering The World With ⟨ And Libchamplain Michael Sheldon - 2009-03-22 - - 0.10.1 + 0.1 - This is a step-by-step tutorial which will introduce champlain concepts and how to make use of them from within Python. It is released under the GNU Free Documentation License a copy of which can be found in Appendix A. + This is a step-by-step tutorial which will introduce champlain concepts and how to make use of them from within ⟨. It is released under the GNU Free Documentation License a copy of which can be found in Appendix A. @@ -50,12 +44,12 @@ Introduction - This tutorial will try introduce most concepts within in champlain and explain how they can be used from within Python. The target audience for this tutorial is programmers with past Python and GTK experience, no experience of either champlain or clutter will be assumed. Chapter 2 will introduce a number of concepts from champlain individually. Chapter 3 will then provide a detailed account of the creation of a simple game from scratch using champlain. Chapter 4 will give an example of creating a plugin for an existing application to add mapping capabilities. + This tutorial will try introduce most concepts within in champlain and explain how they can be used from within ⟨. The target audience for this tutorial is programmers with past ⟨ and GTK experience, no experience of either champlain or clutter will be assumed. Chapter 2 will introduce a number of concepts from champlain individually. Chapter 3 will then provide a detailed account of the creation of a simple game from scratch using champlain. Chapter 4 will give an example of creating a plugin for an existing application to add mapping capabilities. Examples - Each chapter contains a number of examples, the source code for these can be downloaded from the Conquering The World With Python And Champlain website. + Each chapter contains a number of examples, the source code for these can be downloaded from the Conquering The World With ⟨ And Champlain website. @@ -162,6 +156,7 @@ clutter.main() Initialisation + diff --git a/docs/tutorial/examples/c/chapter2/01-initialisation.c b/docs/tutorial/examples/c/chapter2/01-initialisation.c new file mode 100644 index 0000000..d82a08b --- /dev/null +++ b/docs/tutorial/examples/c/chapter2/01-initialisation.c @@ -0,0 +1,29 @@ +#include +#include + +int +main (int argc, char *argv[]) +{ + ClutterActor *view, *stage; + + g_thread_init (NULL); + clutter_init (&argc, &argv); + + stage = clutter_stage_get_default (); + clutter_actor_set_size (stage, 800, 600); + + /* Create the map view */ + actor = champlain_view_new (); + champlain_view_set_size (CHAMPLAIN_VIEW (actor), 800, 600); + clutter_container_add_actor (CLUTTER_CONTAINER (stage), actor); + + /* Create the marker layer */ + layer = champlain_layer_new (); + clutter_actor_show (CLUTTER_ACTOR (layer)); + champlain_view_add_layer (CHAMPLAIN_VIEW (actor), layer); + + clutter_actor_show (stage); + clutter_main (); + + return 0; +}