Update main.c
This commit is contained in:
		
							
								
								
									
										21
									
								
								src/main.c
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								src/main.c
									
									
									
									
									
								
							| @@ -31,9 +31,9 @@ struct point { | ||||
|   u32 y; | ||||
| }; | ||||
|  | ||||
| Point point_from_index(u32 index, u32 w); | ||||
| void write_debug_ppm6(const Image *img); | ||||
| SDL_Texture *image_to_texture(SDL_Renderer *renderer, const Image *img); | ||||
| internal void write_debug_ppm6(const Image *img); | ||||
| internal SDL_Texture *image_to_texture(SDL_Renderer *renderer, | ||||
|                                        const Image *img); | ||||
|  | ||||
| int main(int argc, char *argv[]) { | ||||
|   int exit_code = EXIT_SUCCESS; | ||||
| @@ -125,17 +125,7 @@ MAIN_DESTROY_ARENA: | ||||
|   return exit_code; | ||||
| } | ||||
|  | ||||
| Point point_from_index(u32 index, u32 w) { | ||||
|   Point out = {0}; | ||||
|  | ||||
|   out.x = index % w; | ||||
|  | ||||
|   out.y = (index - (index % w)) / w; | ||||
|  | ||||
|   return out; | ||||
| } | ||||
|  | ||||
| void write_debug_ppm6(const Image *img) { | ||||
| internal void write_debug_ppm6(const Image *img) { | ||||
|   FILE *out = fopen("test.ppm", "wb"); | ||||
|  | ||||
|   char magic[] = {'P', '6', '\n'}; | ||||
| @@ -156,7 +146,8 @@ void write_debug_ppm6(const Image *img) { | ||||
|   fclose(out); | ||||
| } | ||||
|  | ||||
| SDL_Texture *image_to_texture(SDL_Renderer *renderer, const Image *img) { | ||||
| internal SDL_Texture *image_to_texture(SDL_Renderer *renderer, | ||||
|                                        const Image *img) { | ||||
|   SDL_Texture *output = NULL; | ||||
|   if (!renderer || !img) { | ||||
|     goto IMAGE_TO_TEXTURE_RETURN; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user