removed flecs and setted up vulkan building
This commit is contained in:
parent
7be714b81f
commit
1f594fbed7
8 changed files with 24 additions and 127415 deletions
9
assets/shaders/shader.metal
Normal file
9
assets/shaders/shader.metal
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
vertex float4 basic_vertex( // 1
|
||||
const device packed_float3* vertex_array [[ buffer(0) ]], // 2
|
||||
unsigned int vid [[ vertex_id ]]) { // 3
|
||||
return float4(vertex_array[vid], 1.0); // 4
|
||||
}
|
||||
|
||||
fragment half4 basic_fragment() { // 1
|
||||
return half4(1.0); // 2
|
||||
}
|
||||
10
config.mk
10
config.mk
|
|
@ -3,7 +3,7 @@
|
|||
CC := cc
|
||||
CFLAGS := -Wall -Wextra -std=c99 -pedantic -ggdb -O2
|
||||
LIBS := -lm
|
||||
# if this is set to gl, it will use OpenGL, otherwise it will use Vulkan
|
||||
# can be gl or vk
|
||||
BACKEND := gl
|
||||
|
||||
PLATFORM := $(shell uname)
|
||||
|
|
@ -11,14 +11,18 @@ PLATFORM := $(shell uname)
|
|||
ifeq (${BACKEND},gl)
|
||||
CFLAGS += -DBACKEND_GL
|
||||
ifeq (${PLATFORM},Darwin)
|
||||
LIBS += -framework Cocoa -framework CoreVideo -framework OpenGL -framework IOKit
|
||||
LIBS += -framework OpenGL
|
||||
else
|
||||
LIBS += -lGL
|
||||
endif
|
||||
else
|
||||
CFLAGS := -DBACKEND_VK
|
||||
LIBS += -lvulkan
|
||||
CFLAGS += -DBACKEND_VK
|
||||
endif
|
||||
|
||||
ifeq (${PLATFORM},Darwin)
|
||||
CFLAGS += -DPLATFORM_MACOS
|
||||
LIBS += -framework Cocoa -framework CoreVideo -framework IOKit
|
||||
else ifeq (${PLATFORM},Linux)
|
||||
CFLAGS += -DPLATFORM_LINUX
|
||||
endif
|
||||
|
|
|
|||
5
makefile
5
makefile
|
|
@ -2,11 +2,14 @@
|
|||
|
||||
include config.mk
|
||||
|
||||
SRC:=topaz.c linear.c flecs.c
|
||||
SRC:=topaz.c linear.c
|
||||
|
||||
ifeq (${BACKEND},gl)
|
||||
SRC += gl/gl.c gl/platform.c
|
||||
endif
|
||||
ifeq (${BACKEND},vk)
|
||||
SRC += vk/platform.c
|
||||
endif
|
||||
|
||||
OBJ:=${SRC:.c=.o}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ struct mesh {
|
|||
usize size;
|
||||
};
|
||||
|
||||
struct renderer_context;
|
||||
|
||||
struct renderer_context *renderer_create_context(void);
|
||||
struct mesh renderer_build_chunk_mesh();
|
||||
void renderer_draw_mesh(struct mesh);
|
||||
void renderer_draw_chunk(struct mesh);
|
||||
|
|
|
|||
26
rgfw.h
26
rgfw.h
|
|
@ -353,31 +353,7 @@ int main() {
|
|||
|
||||
#define RGFW_HEADER
|
||||
|
||||
#include <stddef.h>
|
||||
#ifndef RGFW_INT_DEFINED
|
||||
#ifdef RGFW_USE_INT /* optional for any system that might not have stdint.h */
|
||||
typedef unsigned char u8;
|
||||
typedef signed char i8;
|
||||
typedef unsigned short u16;
|
||||
typedef signed short i16;
|
||||
typedef unsigned long int u32;
|
||||
typedef signed long int i32;
|
||||
typedef unsigned long long u64;
|
||||
typedef signed long long i64;
|
||||
#else /* use stdint standard types instead of c "standard" types */
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint8_t u8;
|
||||
typedef int8_t i8;
|
||||
typedef uint16_t u16;
|
||||
typedef int16_t i16;
|
||||
typedef uint32_t u32;
|
||||
typedef int32_t i32;
|
||||
typedef uint64_t u64;
|
||||
typedef int64_t i64;
|
||||
#endif
|
||||
#define RGFW_INT_DEFINED
|
||||
#endif
|
||||
#include "types.h"
|
||||
|
||||
typedef ptrdiff_t RGFW_ssize_t;
|
||||
|
||||
|
|
|
|||
1
types.h
1
types.h
|
|
@ -1,5 +1,4 @@
|
|||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#ifndef TYPES_H
|
||||
#define TYPES_H
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue