part: implement some functions (windows & display)

part:
- remove mlx3ds_3dskey.h, instead use hid.h
- add definitions of:
  - mlx_init()
  - mlx_new_window()
  - mlx_clear_window()
  - mlx_destroy_window()
  - mlx_pixel_put()
  - mlx_new_image()
  - mlx_get_data_addr()
  - mlx_put_image_to_window()
  - mlx_destroy_image()

dev:
- Makefile: add rule check_headers
- Makefile: add variable FLAGS
    (call 'make rule FLAGS=flags'
	to add flags to compilation)
- add /dev/norm.sh: nicer norminette
- add tester in main(), and related utilsconsole.*

docs:
- make clear mlx_get_data_addr() docs
This commit is contained in:
Zy 2024-10-06 16:24:31 +02:00
parent c7d0dba4fd
commit 13b93106ee
19 changed files with 766 additions and 141 deletions

View file

@ -56,7 +56,7 @@ RSF := $(TOPDIR)/$(RESOURCES)/template.rsf
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
COMMON := -Wall -O2 -mword-relocations -fomit-frame-pointer -ffunction-sections $(ARCH) $(INCLUDE) -D__3DS__
COMMON := -Wall -O2 -mword-relocations -fomit-frame-pointer -ffunction-sections $(ARCH) $(INCLUDE) -D__3DS__ $(FLAGS)
CFLAGS := $(COMMON) -std=gnu99
CXXFLAGS := $(COMMON) -fno-rtti -fno-exceptions -std=gnu++11
ASFLAGS := $(ARCH)
@ -343,3 +343,27 @@ endef
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------
# Added by Zy
# To check if the headers are protected and if they include everything they need.
check_headers :
@ERROR=0; \
for HEADER in $(wildcard *.h) $(wildcard **/*.h) $(wildcard *.hpp) $(wildcard **/*.hpp); \
do \
echo "check header $$HEADER..."; \
> __tmp_check_header.cpp echo "#include \"$$HEADER\""; \
>> __tmp_check_header.cpp echo "#include \"$$HEADER\""; \
>> __tmp_check_header.cpp echo "int main(void) {}"; \
$(CPP) $(INCLUDE) $(COMMON) $(LIBS) -o __tmp_check_header.out -c __tmp_check_header.cpp; \
if [ $$? -ne 0 ]; \
then \
ERROR=1; \
/bin/echo " ### error :( ###"; \
else \
/bin/echo " ### good :) ###"; \
fi; \
2> /dev/null rm -- "__tmp_check_header.out" "__tmp_check_header.c"; \
done; \
if [ $$ERROR -eq 0 ]; then true; else false; fi;
.PHONY : check_headers