Writing /net/www/auesnard/teaching/data/meta/projtec/sdl2.meta failed
projtec:sdl2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
projtec:sdl2 [2017/02/14 09:07] – orel | projtec:sdl2 [2024/03/18 15:06] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 51: | Line 51: | ||
#define PRINT(STR, ...) do { SDL_Log(STR, | #define PRINT(STR, ...) do { SDL_Log(STR, | ||
#define ERROR(STR, ...) do { SDL_Log(STR, | #define ERROR(STR, ...) do { SDL_Log(STR, | ||
- | // #define LOG(TAG, STR, ...) __android_log_print(ANDROID_LOG_VERBOSE, | ||
# else | # else | ||
#define PRINT(STR, ...) do { printf(STR, ## | #define PRINT(STR, ...) do { printf(STR, ## | ||
Line 75: | Line 74: | ||
// SDL2 Demo by aurelien.esnard@u-bordeaux.fr | // SDL2 Demo by aurelien.esnard@u-bordeaux.fr | ||
- | #include <SDL2/SDL.h> | + | #include < |
- | #include <SDL2/SDL_image.h> | + | #include < |
- | #include <SDL2/SDL_ttf.h> | + | #include < |
#include < | #include < | ||
#include < | #include < | ||
Line 87: | Line 86: | ||
{ | { | ||
/* initialize SDL2 and some extensions */ | /* initialize SDL2 and some extensions */ | ||
- | if(SDL_Init(SDL_INIT_VIDEO) != 0) ERROR(" | + | if(SDL_Init(SDL_INIT_VIDEO) != 0) ERROR(" |
- | if(IMG_Init(IMG_INIT_PNG & IMG_INIT_PNG) != IMG_INIT_PNG) ERROR(" | + | if(IMG_Init(IMG_INIT_PNG & IMG_INIT_PNG) != IMG_INIT_PNG) ERROR(" |
- | if(TTF_Init() != 0) ERROR(" | + | if(TTF_Init() != 0) ERROR(" |
/* create window and renderer */ | /* create window and renderer */ | ||
SDL_Window * win = SDL_CreateWindow(APP_NAME, | SDL_Window * win = SDL_CreateWindow(APP_NAME, | ||
SCREEN_WIDTH, | SCREEN_WIDTH, | ||
- | if(!win) ERROR(" | + | if(!win) ERROR(" |
SDL_Renderer * ren = SDL_CreateRenderer(win, | SDL_Renderer * ren = SDL_CreateRenderer(win, | ||
- | if(!ren) ERROR(" | + | if(!ren) ERROR(" |
/* initialize your environment */ | /* initialize your environment */ | ||
Line 142: | Line 141: | ||
// SDL2 Demo by aurelien.esnard@u-bordeaux.fr | // SDL2 Demo by aurelien.esnard@u-bordeaux.fr | ||
- | #include <SDL2/SDL.h> | + | #include < |
- | #include <SDL2/SDL_image.h> | + | #include < |
- | #include <SDL2/SDL_ttf.h> | + | #include < |
#include < | #include < | ||
Line 205: | Line 204: | ||
==== Portage sous Android | ==== Portage sous Android | ||
- | Le code proposé ci-dessus est 100% portable sous Android... Plus dé détails bientôt. | + | Le code proposé ci-dessus est 100% portable sous Android |
projtec/sdl2.1487063265.txt.gz · Last modified: 2024/03/18 15:05 (external edit)