add libft : strlen
This commit is contained in:
		
							parent
							
								
									9022563247
								
							
						
					
					
						commit
						9b08ecfca7
					
				|  | @ -1,3 +1,6 @@ | |||
| [submodule "webgl"] | ||||
| 	path = webgl | ||||
| 	url = https://git.gaetanbrochard.dev/gbrochar/webgl | ||||
| [submodule "libft"] | ||||
| 	path = libft | ||||
| 	url = https://git.gaetanbrochard.dev/gbrochar/libft.git | ||||
|  |  | |||
							
								
								
									
										7
									
								
								Makefile
								
								
								
								
							
							
						
						
									
										7
									
								
								Makefile
								
								
								
								
							|  | @ -41,11 +41,11 @@ SRC =		$(addprefix $(SRC_DIR), $(SRC_FILE)) | |||
| OBJ =		$(addprefix $(OBJ_DIR), $(OBJ_FILE)) | ||||
| INC =		$(addprefix $(INC_DIR), $(INC_FILE)) | ||||
| 
 | ||||
| LIB =		-lm -lGL -lglfw glew-2.2.0/lib/libGLEW.a | ||||
| LIB =		-lm -lGL -lglfw glew-2.2.0/lib/libGLEW.a libft/libft.a | ||||
| 
 | ||||
| CC =		gcc | ||||
| 
 | ||||
| CFLAGS =	-Wall -Werror -Wextra -g3 | ||||
| CFLAGS =	-Wall -Werror -Wextra | ||||
| 
 | ||||
| RED = \033[31m | ||||
| GREEN = \033[32m | ||||
|  | @ -58,6 +58,7 @@ all: $(NAME) | |||
| 
 | ||||
| $(NAME): $(OBJ) $(INC) | ||||
| 	@make -C glew-2.2.0 | ||||
| 	@make -C libft | ||||
| 	@$(CC) $(CFLAGS) -c $(SRC) -I $(INC_DIR) -I glew-2.2.0/include/ | ||||
| 	@mv $(OBJ_FILE) $(OBJ_DIR) | ||||
| 	@$(CC) $(CFLAGS) $(OBJ) -o $(NAME) $(LIB) | ||||
|  | @ -71,11 +72,13 @@ $(OBJ_DIR)%.o: $(SRC_DIR)%.c inc/ | |||
| 	@echo -e "$(CYAN)[CC]$(WHITE) $<" | ||||
| 
 | ||||
| clean: | ||||
| 	@make -C libft clean | ||||
| 	@rm -rf $(OBJ_DIR) | ||||
| 	@echo -e "$(RED)[REMOVED]$(WHITE) obj files" | ||||
| 
 | ||||
| fclean: clean | ||||
| 	@make -C glew-2.2.0 clean | ||||
| 	@make -C libft fclean | ||||
| 	@rm -f $(NAME) | ||||
| 	@echo -e "$(RED)[REMOVED]$(WHITE) $(NAME)" | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,6 +1,7 @@ | |||
| #ifndef SCOP_H | ||||
| # define SCOP_H | ||||
| 
 | ||||
| # include "../libft/libft.h" | ||||
| # include <stdio.h> | ||||
| # include <string.h> | ||||
| # include <ctype.h> | ||||
|  |  | |||
|  | @ -0,0 +1 @@ | |||
| Subproject commit 1ab0cdf1acf97db0cb8d90940c96a6f1ccb3a7af | ||||
|  | @ -107,7 +107,7 @@ void				parse_triangulate_dispatcher(t_env *e, int vertex_count) { | |||
| } | ||||
| 
 | ||||
| void strtrim(char *line) { | ||||
| 	size_t i = strlen(line) - 1; | ||||
| 	size_t i = ft_strlen(line) - 1; | ||||
| 	while (isspace(line[i])) { | ||||
| 		line[i] = '\0'; | ||||
| 		i--; | ||||
|  |  | |||
|  | @ -44,15 +44,15 @@ int					parse_append_data_index(t_env *e, char *phrase) { | |||
| 	int ret; | ||||
| 
 | ||||
| 	while ((token = strtok_r(phrase, "/", &phrase))) { | ||||
| 		if (strlen(token) > 0 && token_count == 0) { | ||||
| 		if (ft_strlen(token) > 0 && token_count == 0) { | ||||
| 			e->object.properties |= VERTEX_FLAG; | ||||
| 			ret = parse_append_data_ui(&(e->object.vertices_indices), token); | ||||
| 		} | ||||
| 		else if (strlen(token) > 0 && token_count == 1) { | ||||
| 		else if (ft_strlen(token) > 0 && token_count == 1) { | ||||
| 			e->object.properties |= UV_FLAG; | ||||
| 			ret = parse_append_data_ui(&(e->object.uvs_indices), token); | ||||
| 		} | ||||
| 		else if (strlen(token) > 0 && token_count == 2) { | ||||
| 		else if (ft_strlen(token) > 0 && token_count == 2) { | ||||
| 			e->object.properties |= NORMAL_FLAG; | ||||
| 			ret = parse_append_data_ui(&(e->object.normals_indices), token); | ||||
| 		} | ||||
|  |  | |||
|  | @ -167,7 +167,7 @@ static void AddShader(GLuint ShaderProgram, const char* pShaderText, GLenum Shad | |||
| 	const GLchar* p[1]; | ||||
| 	p[0] = pShaderText; | ||||
| 	GLint Lengths[1]; | ||||
| 	Lengths[0] = strlen(pShaderText); | ||||
| 	Lengths[0] = ft_strlen(pShaderText); | ||||
| 	glShaderSource(*shader, 1, p, Lengths); | ||||
| 	glCompileShader(*shader); | ||||
| 	GLint success; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue