move and rename private/textures.h to textures/internal_api.h
This commit is contained in:
		
							
								
								
									
										42
									
								
								src/textures/internal_api.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								src/textures/internal_api.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,42 @@
 | 
			
		||||
#ifndef TEXTURES_INTERNAL_API_H
 | 
			
		||||
#define TEXTURES_INTERNAL_API_H
 | 
			
		||||
 | 
			
		||||
#include "../util.h"
 | 
			
		||||
#include "../textures/modes.h"
 | 
			
		||||
 | 
			
		||||
#include <SDL2/SDL.h>
 | 
			
		||||
#include <stb_rect_pack.h>
 | 
			
		||||
#include <glad/glad.h>
 | 
			
		||||
 | 
			
		||||
#include <stdbool.h>
 | 
			
		||||
 | 
			
		||||
struct texture {
 | 
			
		||||
    t_rect srcrect;             /* position in atlas */
 | 
			
		||||
    SDL_Surface *data;          /* original image data */
 | 
			
		||||
    int atlas_index;
 | 
			
		||||
    GLuint loner_texture;       /* stored directly for loners, == 0 means atlas_index should be used */
 | 
			
		||||
    enum texture_mode mode;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct texture_cache_item {
 | 
			
		||||
    char *key;
 | 
			
		||||
    struct texture value;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
struct texture_cache {
 | 
			
		||||
    SDL_Window *window;          /* from context */
 | 
			
		||||
 | 
			
		||||
    struct texture_cache_item *hash;
 | 
			
		||||
 | 
			
		||||
    stbrp_node *node_buffer;     /* used internally by stb_rect_pack */
 | 
			
		||||
 | 
			
		||||
    SDL_Surface **atlas_surfaces;
 | 
			
		||||
    GLuint *atlas_textures;      /* shared by atlas textures */
 | 
			
		||||
    int atlas_index;             /* atlas that is currently being built */
 | 
			
		||||
 | 
			
		||||
    bool is_dirty;               /* current atlas needs to be recreated */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
		Reference in New Issue
	
	Block a user