Compare commits

..

No commits in common. "a498acb4d9ea1004b25c23ced10c9f566f14c7f1" and "ee4cde886d40fc205f3a65997a4bd8f60e173801" have entirely different histories.

7 changed files with 6 additions and 36 deletions

View File

@ -1,5 +1,5 @@
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
# 2D_Engine_C_SDL2_Core
# 2D_Engine_C SDL2 Core
## Description
The core made on SDL2 for the multi-platform 2D_Engine_C.

View File

@ -1,6 +1,5 @@
# Source files
CORE_SOURCES := \
asset_manager.c \
texture_manager.c \
event.c \
vector2d.c \
@ -9,7 +8,7 @@ CORE_SOURCES := \
# Compiler and flags
CORE_CC = gcc
CORE_CFLAGS = -Wall -Wextra -std=c17 -fPIC -g -DASSET_FILE=$(ASSET_OUTPUT)
CORE_CFLAGS = -Wall -Wextra -std=c17 -fPIC -g
CORE_INCLUDE_DIRS = $(CORE_DIR)/headers
CORE_LDFLAGS = $(shell sdl2-config --cflags --libs)
@ -27,7 +26,7 @@ core_setup:
@echo "Building libCore.so (1/3)"
$(Q)mkdir -p $(dir $(CORE_OBJECTS))
# Count nb of files to build
# Count files to build
count_core_build:
$(eval export TOTAL_CORE_FILES := $(shell echo $$(($$(make -n $(CORE_OBJECTS) 2>/dev/null | grep -c "Building") + 1))))

View File

@ -1,17 +0,0 @@
#include "asset_manager.h"
#include <SDL2/SDL_render.h>
#include "display.h"
#include "linked_list.h"
static void temporary_extract_asset(const char *path)
{
}
SDL_Texture load_image(const char *path)
{
IMG_LoadTexture(renderer, path);
}

View File

@ -1,7 +1,6 @@
#include "display.h"
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
SDL_Window *window = NULL;
SDL_Renderer *renderer = NULL;
@ -9,8 +8,6 @@ SDL_Renderer *renderer = NULL;
void display_init(void)
{
SDL_Init(SDL_INIT_EVERYTHING);
IMG_Init(IMG_INIT_PNG);
window = SDL_CreateWindow("2D_Engine", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, DISPLAY_WIDTH * DISPLAY_SCALE, DISPLAY_HEIGHT * DISPLAY_SCALE, SDL_WINDOW_SHOWN);
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
}

View File

@ -1,8 +0,0 @@
#ifndef ASSET_MANAGER_H
#define ASSET_MANAGER_H
#include <SDL2/SDL_image.h>
SDL_Texture load_image(const char *path);
#endif // ASSET_MANAGER_H

View File

@ -1,6 +1,6 @@
#ifndef MEMORY_ALLOC_H
#define MEMORY_ALLOC_H
#ifndef MALLOC_H
#define MALLOC_H
#include <stdlib.h>
#endif // MEMORY_ALLOC_H
#endif // MALLOC_H

View File

@ -37,7 +37,6 @@ inline void texture_manager_init(texture_manager_t *texture_manager)
inline void texture_manager_load_texture(texture_manager_t *texture_manager, const char *name)
{
texture_t *texture;
linked_list_push_back(&texture_manager->textures, texture);
}