add gl4d support
This commit is contained in:
parent
0ae47c1c86
commit
6834b41c2f
3 changed files with 35 additions and 4 deletions
8
Makefile
8
Makefile
|
@ -1,6 +1,7 @@
|
|||
CC = gcc
|
||||
CFLAGS = -std=c11
|
||||
CFLAGS = -std=c11 -I. -I/usr/include/SDL2
|
||||
RM = rm
|
||||
LDFLAGS = -lm -lGL -lGL4Dummies -lSDL2
|
||||
|
||||
SOURCES = $(wildcard src/*.c)
|
||||
OBJECTS = $(patsubst %.c,%.c.o,$(notdir $(SOURCES)))
|
||||
|
@ -13,11 +14,12 @@ EXE = othello
|
|||
main: CFLAGS += -O3
|
||||
main: compilation
|
||||
|
||||
dev: CFLAGS += -Wall -Wextra -Wshadow -Wcast-align -Wstrict-prototypes -fanalyzer -fsanitize=undefined -pedantic -g
|
||||
dev: CFLAGS += -Wall -Wextra -Wshadow -Wcast-align -Wstrict-prototypes
|
||||
dev: CFLAGS += -fanalyzer -fsanitize=undefined -pedantic -g
|
||||
dev: compilation
|
||||
|
||||
compilation: $(OBJECTS)
|
||||
$(CC) -o $(EXE) $(OBJECTS)
|
||||
$(CC) -o $(EXE) $(OBJECTS) $(LDFLAGS)
|
||||
|
||||
all:
|
||||
main
|
||||
|
|
1
compile_flags.txt
Normal file
1
compile_flags.txt
Normal file
|
@ -0,0 +1 @@
|
|||
-I/usr/include/SDL2
|
30
src/main.c
30
src/main.c
|
@ -1 +1,29 @@
|
|||
int main(void) {}
|
||||
#include <GL4D/gl4dp.h>
|
||||
#include <GL4D/gl4duw_SDL2.h>
|
||||
#include <SDL2/SDL_video.h>
|
||||
|
||||
static void dessin(void);
|
||||
static void job(void);
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
if (!gl4duwCreateWindow(argc, argv, "GL4Dummies' Hello World", 10, 10, 320,
|
||||
240, GL4DW_SHOWN)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
gl4dpInitScreen();
|
||||
|
||||
gl4duwDisplayFunc(dessin);
|
||||
|
||||
gl4duwMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dessin(void) {
|
||||
gl4dpClearScreen();
|
||||
job();
|
||||
gl4dpUpdateScreen(NULL);
|
||||
}
|
||||
|
||||
void job(void) {}
|
||||
|
|
Reference in a new issue