reorganizing milepost directory tree into app, graphics, platfrom, ui, util

This commit is contained in:
Martin Fouilleul 2023-08-09 17:30:35 +02:00
parent 11dde9fea3
commit bfadcad7f3
51 changed files with 11159 additions and 11155 deletions

View File

@ -10,7 +10,7 @@
#define __OSX_APP_H_
#include"mp_app.h"
#include"graphics.h"
#include"graphics/graphics.h"
#ifdef __OBJC__
#import<Cocoa/Cocoa.h>

View File

@ -18,7 +18,7 @@
#include"macro_helpers.h"
#include"platform_log.h"
#include"platform_clock.h"
#include"graphics_surface.h"
#include"graphics/graphics_surface.h"
#include"mp_app.c"

View File

@ -1075,7 +1075,7 @@ MP_API str8 mp_clipboard_copy_string(str8 backing)
// win32 surfaces
//--------------------------------------------------------------------------------
#include"graphics_surface.h"
#include"graphics/graphics_surface.h"
vec2 mg_win32_surface_contents_scaling(mg_surface_data* surface)
{

View File

@ -10,7 +10,7 @@
#define EGL_EGLEXT_PROTOTYPES
#include<EGL/egl.h>
#include<EGL/eglext.h>
#include"mp_app_internal.h"
#include"app/mp_app_internal.h"
#include"graphics_surface.h"
#include"gl_loader.h"

View File

@ -10,7 +10,7 @@
#define __EGL_SURFACE_H_
#include"graphics_surface.h"
#include"mp_app.h"
#include"app/mp_app.h"
mg_surface_data* mg_egl_surface_create_for_window(mp_window window);
mg_surface_data* mg_egl_surface_create_remote(u32 width, u32 height);

View File

@ -11,7 +11,7 @@
#include"util/typedefs.h"
#include"platform/platform.h"
#include"mp_app.h"
#include"app/mp_app.h"
//------------------------------------------------------------------------------------------
//NOTE(martin): backends selection

View File

@ -9,7 +9,7 @@
#define __GRAPHICS_SURFACE_H_
#include"graphics_common.h"
#include"mp_app_internal.h"
#include"app/mp_app_internal.h"
#ifdef __cplusplus
extern "C" {

View File

@ -10,10 +10,10 @@
#import<QuartzCore/CAMetalLayer.h>
#include<simd/simd.h>
#include"graphics_surface.h"
#include"macro_helpers.h"
#include"osx_app.h"
#include"util/macro_helpers.h"
#include"app/osx_app.h"
#include"graphics_surface.h"
#include"mtl_renderer.h"
const int MG_MTL_INPUT_BUFFERS_COUNT = 3,

View File

@ -12,8 +12,8 @@
#include<simd/simd.h>
#include"graphics_surface.h"
#include"macro_helpers.h"
#include"osx_app.h"
#include"util/macro_helpers.h"
#include"app/osx_app.h"
typedef struct mg_mtl_surface
{

View File

@ -6,12 +6,12 @@
* @revision:
*
*****************************************************************/
#include"win32_app.h"
#include"app/win32_app.h"
#include"graphics_surface.h"
#include"gl_loader.h"
#include<GL/wglext.h>
#include"macro_helpers.h"
#include"util/macro_helpers.h"
#define WGL_PROC_LIST \
WGL_PROC(WGLCHOOSEPIXELFORMATARB, wglChoosePixelFormatARB) \

View File

@ -60,24 +60,24 @@
//---------------------------------------------------------------
#if PLATFORM_WINDOWS
#include"win32_app.c"
#include"graphics_common.c"
#include"graphics_surface.c"
#include"app/win32_app.c"
#include"graphics/graphics_common.c"
#include"graphics/graphics_surface.c"
#if MG_COMPILE_GL || MG_COMPILE_GLES
#include"gl_loader.c"
#include"graphics/gl_loader.c"
#endif
#if MG_COMPILE_GL
#include"wgl_surface.c"
#include"graphics/wgl_surface.c"
#endif
#if MG_COMPILE_CANVAS
#include"gl_canvas.c"
#include"graphics/gl_canvas.c"
#endif
#if MG_COMPILE_GLES
#include"egl_surface.c"
#include"graphics/egl_surface.c"
#endif
#elif PLATFORM_MACOS
@ -86,5 +86,5 @@
#error "Unsupported platform"
#endif
#include"input_state.c"
#include"ui.c"
#include"ui/input_state.c"
#include"ui/ui.c"

View File

@ -38,15 +38,13 @@
//----------------------------------------------------------------
// application/graphics layer
//----------------------------------------------------------------
#include"mp_app.h"
#include"graphics.h"
#include"input_state.h"
#include"ui.h"
#include"app/mp_app.h"
#include"graphics/graphics.h"
#include"ui/input_state.h"
#include"ui/ui.h"
#ifdef MG_INCLUDE_GL_API
#include"gl_api.h"
#include"graphics/gl_api.h"
#endif
//#include"ui.h"
#endif //__MILEPOST_H_

View File

@ -7,20 +7,20 @@
*
*****************************************************************/
#include"osx_path.m"
#include"osx_app.m"
#include"graphics_common.c"
#include"graphics_surface.c"
#include"platform/osx_path.m"
#include"app/osx_app.m"
#include"graphics/graphics_common.c"
#include"graphics/graphics_surface.c"
#if MG_COMPILE_METAL
#include"mtl_surface.m"
#include"graphics/mtl_surface.m"
#endif
#if MG_COMPILE_CANVAS
#include"mtl_renderer.m"
#include"graphics/mtl_renderer.m"
#endif
#if MG_COMPILE_GLES
#include"gl_loader.c"
#include"egl_surface.c"
#include"graphics/gl_loader.c"
#include"graphics/egl_surface.c"
#endif

View File

@ -12,7 +12,7 @@
#include"util/typedefs.h"
#include"util/strings.h"
#include"util/utf8.h"
#include"mp_app.h"
#include"app/mp_app.h"
typedef struct mp_key_state
{

View File

@ -12,7 +12,7 @@
#include"util/typedefs.h"
#include"util/lists.h"
#include"input_state.h"
#include"graphics.h"
#include"graphics/graphics.h"
#ifdef __cplusplus
extern "C" {

View File

@ -1,5 +1,4 @@
#include <keys.h>
#include <graphics.h>
#include <math.h>
#include <orca.h>

View File

@ -11,6 +11,7 @@ else
CLANG=clang
fi
ORCA_DIR=../..
STDLIB_DIR=../../cstdlib
ORCA_SDK_DIR=../../sdk
MILEPOST_DIR=../../milepost
@ -25,6 +26,7 @@ wasmFlags="--target=wasm32 \
-mbulk-memory \
-D__ORCA__ \
-I $STDLIB_DIR/include \
-I $ORCA_DIR/ext \
-I $ORCA_SDK_DIR \
-I $MILEPOST_DIR/ext -I $MILEPOST_DIR -I $MILEPOST_DIR/src"

View File

@ -1,5 +1,4 @@
#include <keys.h>
#include <graphics.h>
#include <math.h>
#include <orca.h>

View File

@ -11,6 +11,8 @@ else
CLANG=clang
fi
ORCA_DIR=../..
wasmFlags="--target=wasm32 \
--no-standard-libraries \
-fno-builtin \
@ -20,6 +22,7 @@ wasmFlags="--target=wasm32 \
-O2 \
-mbulk-memory \
-D__ORCA__ \
-I $ORCA_DIR/ext \
-isystem ../../cstdlib/include -I ../../sdk -I../../milepost/ext -I ../../milepost -I ../../milepost/src"
$CLANG $wasmFlags -o ./module.wasm ../../sdk/orca.c ../../cstdlib/src/*.c src/main.c

View File

@ -1,6 +1,4 @@
#include"keys.h"
#include"graphics.h"
#include"ui.h"
#include"orca.h"

View File

@ -168,7 +168,7 @@ def build_milepost_lib_mac(release):
# TODO: shaderFlagParam
"-fno-fast-math", "-c",
"-o", "../build/mtl_renderer.air",
"src/mtl_renderer.metal",
"src/graphics/mtl_renderer.metal",
], check=True)
subprocess.run([
"xcrun", "-sdk", "macosx", "metallib",
@ -302,7 +302,8 @@ def build_orca_win(release):
includes = [
"/I", "src",
"/I", "sdk",
"/I", "ext"
"/I", "ext",
"/I", "ext/angle/include",
"/I", "ext/wasm3/source",
"/I", "milepost/src"
]
@ -332,6 +333,7 @@ def build_orca_mac(release):
"-Imilepost/src/util",
"-Imilepost/src/platform",
"-Iext",
"-Iext/angle/include",
"-Iext/wasm3/source"
]
libs = ["-Lbuild/bin", "-Lbuild/lib", "-lmilepost", "-lwasm3"]
@ -380,12 +382,12 @@ def gen_all_bindings():
bindgen("canvas", "src/canvas_api.json",
guest_stubs="sdk/orca_surface.c",
guest_include="graphics.h",
guest_include="graphics/graphics.h",
wasm3_bindings="src/canvas_api_bind_gen.c",
)
bindgen("clock", "src/clock_api.json",
guest_stubs="sdk/orca_clock.c",
guest_include="platform_clock.h",
guest_include="platform/platform_clock.h",
wasm3_bindings="src/clock_api_bind_gen.c",
)
bindgen("io", "src/io_api.json",

View File

@ -18,10 +18,10 @@
#include"util/strings.c"
#include"util/utf8.c"
#include"graphics_common.c"
#include"input_state.c"
#include"graphics/graphics_common.c"
#include"ui/input_state.c"
#include"ui/ui.c"
#include"orca_exports.c"
#include"orca_surface.c"
#include"ui.c"
#include"io_stubs.c"

View File

@ -21,7 +21,10 @@
#include"math.h"
#include"graphics.h"
#include"graphics/graphics.h"
#include"ui/input_state.h"
#include"ui/ui.h"
#include"gl31.h"
#if COMPILER_CLANG

View File

@ -11,7 +11,7 @@
#define MG_INCLUDE_GL_API
#include"milepost.h"
#include"graphics_common.h"
#include"graphics/graphics_common.h"
#include"orca_app.h"