gale/doc/tutorial.md

43 lines
1.4 KiB
Markdown
Raw Normal View History

2016-04-08 21:04:50 +02:00
Tutorial {#gale_tutorial}
========
@tableofcontents
2016-09-15 22:01:35 +02:00
Base: {#gale_tutorial_declare}
2016-04-08 21:04:50 +02:00
=====
To understand some choise, I designe this software to acces on all system (that provide openGL interface).
But on some embended interface, we have only openGL-es ==> then I limit all the design on OpenGL-ES (need to think to change this maybe)
All is based on the heritage of the single class: gale::Application.
For your fist application you just need to declare an application and create the smallest main that ever exit:
2016-09-15 22:01:35 +02:00
Application declatration: {#gale_tutorial_base_main}
2016-04-08 21:04:50 +02:00
-------------------------
We declare the application:
```{.c}
class MainApplication : public gale::Application {
2016-09-15 22:01:35 +02:00
// application implementation here ...
2016-04-08 21:04:50 +02:00
}
```
We create application on the main()
@snippet basic.cpp gale_declare_main
At this point I need to explain one point on Android:
2016-09-15 22:01:35 +02:00
Android have an internal state engine that can create multiple aplication, then GALE can call a second time the main() if needed...
2016-04-08 21:04:50 +02:00
2016-09-15 22:01:35 +02:00
Then never forget to not use global value and singleton. We provide other mechanism to do it. (for exemple, you can acces at you Application intance everywhere you are).
2016-04-08 21:04:50 +02:00
2016-09-15 22:01:35 +02:00
Compleate Sample: {#gale_tutorial_compleate_sample}
2016-04-08 21:04:50 +02:00
=================
@snippet basic.cpp gale_sample_all