69
There is more to C 26.11.2013 FI MUNI, Brno Juraj Michálek http://georgik.sinusgear.com

There is more to C 2013

Embed Size (px)

DESCRIPTION

Talks @FI MUNI Brno about C programming language and libraries. Topic of SDL2 library, Gradle build for C/C++

Citation preview

Page 1: There is more to C 2013

There is more to C

26.11.2013FI MUNI, Brno

Juraj Michálekhttp://georgik.sinusgear.com

Page 2: There is more to C 2013

Grab the source codehttps://github.com/georgik/fimuni-c-cpp-examples.git

Page 3: There is more to C 2013

Who am I?

Page 4: There is more to C 2013

Fairy tale of C kingdom

VS 2013 - tools

SDL

Automation Evolved

Page 5: There is more to C 2013

Once upon a time

Page 6: There is more to C 2013

there lived a mighty king

Page 7: There is more to C 2013

His name was C

Page 8: There is more to C 2013

He ruled nearly everythingtelecom, medicine, banks, games

Page 9: There is more to C 2013

King was getting older and paunchy

Page 10: There is more to C 2013

World was changing

Page 11: There is more to C 2013

Changing so fast..

Page 12: There is more to C 2013

New rivals have arrived

Page 13: There is more to C 2013

Caravane with nomads from the land of Perl

Page 14: There is more to C 2013

Lords of snakes from the land of Python

Page 15: There is more to C 2013

Jewelers from the the land of Ruby

Page 16: There is more to C 2013

Sharp warriors from the land of .Net

Page 17: There is more to C 2013

Coffee magnates from the land of Java

Page 18: There is more to C 2013

Cocoa drinkers from the land of Apple trees

Page 19: There is more to C 2013

Old kingdom of C fell into oblivion

Page 20: There is more to C 2013

People were scared to enter the realm of old C

Page 21: There is more to C 2013

Beware SIGSEGV dragons!

Page 22: There is more to C 2013

Memory leak swamps!

Page 23: There is more to C 2013

Zombies of legacy code!

Page 24: There is more to C 2013

Evil MACROmancers#define true false

Page 25: There is more to C 2013

Insidious multi-threaded bugs.

Page 26: There is more to C 2013

Scary place for life

Page 27: There is more to C 2013

The era of Cloud has emerged

Page 28: There is more to C 2013

Technologies influencing each other

Page 29: There is more to C 2013

Breeze of fresh ideas starts blowingfrom NodeJS, AngularJS and others

Page 30: There is more to C 2013

Old rust is falling apart

New shiny tools and libraries

Page 31: There is more to C 2013

ScalablePortable

DistributedPerformance

AsynchronousMemory and energy efficiet

Page 32: There is more to C 2013

tiobe.com - programming lang. index

Page 33: There is more to C 2013
Page 34: There is more to C 2013

NuGet - http://www.nuget.org

Page 35: There is more to C 2013
Page 36: There is more to C 2013
Page 37: There is more to C 2013
Page 38: There is more to C 2013

Made with SDL

Page 39: There is more to C 2013

Made with SDL

Page 40: There is more to C 2013

Multiplatform

SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.

Support for other platforms may be found in the source code.

Page 41: There is more to C 2013

SDL versions

1.2 stable - rock solid

2.x development - new features

Page 42: There is more to C 2013

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 43: There is more to C 2013

Quit application

SDL_quit()

Page 44: There is more to C 2013

Window

SDL_CreateWindow("Hello World!", 100, 100, 640, 480, SDL_WINDOW_SHOWN);

Page 45: There is more to C 2013

Load bitmap

SDL_Surface *bmp = nullptr;bmp = SDL_LoadBMP("smajlik.bmp");

Page 46: There is more to C 2013

Visual data

SDL_RendererSDL_Texture

Page 47: There is more to C 2013

Keyboard

SDL_PollEvent(SDL_Event *event)

event.key.keysym.sym

Page 48: There is more to C 2013

Timer

SDL_TimerID SDL_AddTimer( Uint32 interval, SDL_TimerCallback callback, void* param)

Page 49: There is more to C 2013

Mouse

SDL_GetMouseState(*x, *y);

Page 50: There is more to C 2013

Text

Not implemented

Page 51: There is more to C 2013

Extensions

extension for many languages:

C++, Java, Lua, Perl, PHP, Python, Ruby

Page 52: There is more to C 2013

PyGame

Power of C and Power of Pythonhttp://www.pygame.org

Page 53: There is more to C 2013
Page 54: There is more to C 2013

Allegro

Page 55: There is more to C 2013
Page 56: There is more to C 2013

Allegro 5.1

Win, Lin, Mac

iOS, Android

http://alleg.sourceforge.net/a5docs/refman/

Page 57: There is more to C 2013

Initialization

al_init();

Page 58: There is more to C 2013

Graphic environment

al_create_display(int w, int h)

Page 59: There is more to C 2013

Autiomation Evolved

Page 60: There is more to C 2013

Gradle - cpp-exe

Page 61: There is more to C 2013

Gradle wrapperDownload and prepare infrastructure

Page 62: There is more to C 2013

Gradle - compile with debug

Page 63: There is more to C 2013

Cppcheck

Page 64: There is more to C 2013

L10N - verify your translations

http://www.microsoft.com/Language

Page 65: There is more to C 2013
Page 66: There is more to C 2013

Continuous integration

Page 67: There is more to C 2013
Page 68: There is more to C 2013

Opportunity for innovative students

Bachelor and master thesis @Y Soft

Contact person: [email protected]

Page 69: There is more to C 2013

Thanks to artistsimages used in this presentation were published under creative commons license. Links to originals:

http://www.flickr.com/photos/fatboyke/3405148748/ http://www.flickr.com/photos/teveve/6301993588/ http://www.flickr.com/photos/stevewilhelm/6242822362/ http://en.wikipedia.org/wiki/Chess http://www.flickr.com/photos/akosma/9486807123/ http://www.flickr.com/photos/charlestilford/6362884553/ http://www.flickr.com/photos/ciat/6917871707/ http://www.flickr.com/photos/anieto2k/4455227465/ http://www.geograph.ie/photo/1113036 http://commons.wikimedia.org/wiki/File:Dark_Sky_(3274525313).jpg http://www.elfwood.com/~arknott/Red-Dragon.2539297.html http://commons.wikimedia.org/wiki/File:Wolf-River-swamp-North-Mississippi.jpg http://pako0007.deviantart.com/art/Zombie-Imp-2-267822507 http://www.flickr.com/photos/bogenfreund/367091428/ http://www.flickr.com/photos/infinite-magic/4016608841/ http://www.flickr.com/photos/lennysan/4403695597/ http://www.flickr.com/photos/avaverino/4870587458/