Page 1
Gradle and build systemsfor C language
28.4.2014FI MUNI, Brno
Juraj Michálekhttp://georgik.sinusgear.com
Page 2
Grab the source codehttps://github.com/georgik/fimuni-c-cpp-examples.git
Page 4
SDL
Gradle
CMake
Nuget
Page 5
tiobe.com - programming lang. index
Page 6
Let’s start with something
cool
Page 7
The Battle for Wesnoth
Page 9
Multiplatform
SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
Page 10
SDL versions
1.2 stable - rock solid
2.x development - new features
Page 11
Some basic concepts
Page 12
SDL_init(flags)
SDL_INIT_TIMER - The timer subsystemSDL_INIT_AUDIO - The audio subsystemSDL_INIT_VIDEO - The video subsystemSDL_INIT_CDROM - The cdrom subsystemSDL_INIT_JOYSTICK - The joystick subsystemSDL_INIT_EVERYTHING - All of the aboveSDL_INIT_NOPARACHUTE - Prevents SDL from catching fatal signalsSDL_INIT_EVENTTHREAD - Runs the event manager in a separate thread
Page 13
Quit application
SDL_quit()
Page 14
Window
SDL_CreateWindow("Hello World!", 100, 100, 640, 480, SDL_WINDOW_SHOWN);
Page 15
Load bitmap
SDL_Surface *bmp = NULL;bmp = SDL_LoadBMP("./smajlik.bmp");
Page 16
Visual data
SDL_RendererSDL_Texture
Page 17
Keyboard
SDL_PollEvent(SDL_Event *event)
event.key.keysym.sym
Page 18
Timer
SDL_TimerID SDL_AddTimer( Uint32 interval, SDL_TimerCallback callback, void* param)
Page 19
Mouse
SDL_GetMouseState(*x, *y);
Page 20
Text
Not implemented
Page 21
Extensions
extension for many languages:
C++, Java, Lua, Perl, PHP, Python, Ruby
Page 23
Autiomation Evolved
Page 24
Domain Specific Language
Page 26
build.gradle gradle tasks
gradle hello
Page 27
Plugin system
● focussed functionality is added by plugins● reuse patterns and practices● avoiding boilerplate build code
Page 28
C language plugin
build.gradle
gradle tasks
Page 29
C build executableDirectory structure
build.gradle
Page 30
gradle tasks
gradle mE
Page 32
Visual Studio plugin
Page 36
Gradle wrapperDownload and prepare infrastructure
Page 38
Download SDL2 (for VS)
Page 42
Helper files for compilers
Page 43
Build Debian/Ubuntu packages
Page 44
Gradle Debian Plugin
https://github.com/gesellix/gradle-debian-plugin.git
Page 45
Further Gradle training
https://github.com/ysoftdevs/gradle-training
Page 46
PyGame
Power of C and Power of Pythonhttp://www.pygame.org
Page 47
Kivy - crossplatform framework for NUI
SDL + PyGamehttp://kivy.org
Page 51
Allegro 5.1
Win, Lin, Mac
iOS, Android
http://alleg.sourceforge.net/a5docs/refman/
Page 52
Initialization
al_init();
Page 53
Graphic environment
al_create_display(int w, int h)
Page 55
NuGet - http://www.nuget.org
Page 59
L10N - verify your translations
http://www.microsoft.com/Language
Page 61
Continuous integration
Page 64
Opportunity for innovative students
Bachelor and master thesis @Y Soft
Contact person: [email protected]