reorganizing milepost directory tree into app, graphics, platfrom, ui, util
This commit is contained in:
parent
11dde9fea3
commit
bfadcad7f3
|
@ -10,7 +10,7 @@
|
||||||
#define __OSX_APP_H_
|
#define __OSX_APP_H_
|
||||||
|
|
||||||
#include"mp_app.h"
|
#include"mp_app.h"
|
||||||
#include"graphics.h"
|
#include"graphics/graphics.h"
|
||||||
|
|
||||||
#ifdef __OBJC__
|
#ifdef __OBJC__
|
||||||
#import<Cocoa/Cocoa.h>
|
#import<Cocoa/Cocoa.h>
|
|
@ -18,7 +18,7 @@
|
||||||
#include"macro_helpers.h"
|
#include"macro_helpers.h"
|
||||||
#include"platform_log.h"
|
#include"platform_log.h"
|
||||||
#include"platform_clock.h"
|
#include"platform_clock.h"
|
||||||
#include"graphics_surface.h"
|
#include"graphics/graphics_surface.h"
|
||||||
|
|
||||||
#include"mp_app.c"
|
#include"mp_app.c"
|
||||||
|
|
|
@ -1075,7 +1075,7 @@ MP_API str8 mp_clipboard_copy_string(str8 backing)
|
||||||
// win32 surfaces
|
// win32 surfaces
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
|
|
||||||
#include"graphics_surface.h"
|
#include"graphics/graphics_surface.h"
|
||||||
|
|
||||||
vec2 mg_win32_surface_contents_scaling(mg_surface_data* surface)
|
vec2 mg_win32_surface_contents_scaling(mg_surface_data* surface)
|
||||||
{
|
{
|
|
@ -10,7 +10,7 @@
|
||||||
#define EGL_EGLEXT_PROTOTYPES
|
#define EGL_EGLEXT_PROTOTYPES
|
||||||
#include<EGL/egl.h>
|
#include<EGL/egl.h>
|
||||||
#include<EGL/eglext.h>
|
#include<EGL/eglext.h>
|
||||||
#include"mp_app_internal.h"
|
#include"app/mp_app_internal.h"
|
||||||
#include"graphics_surface.h"
|
#include"graphics_surface.h"
|
||||||
#include"gl_loader.h"
|
#include"gl_loader.h"
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#define __EGL_SURFACE_H_
|
#define __EGL_SURFACE_H_
|
||||||
|
|
||||||
#include"graphics_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_for_window(mp_window window);
|
||||||
mg_surface_data* mg_egl_surface_create_remote(u32 width, u32 height);
|
mg_surface_data* mg_egl_surface_create_remote(u32 width, u32 height);
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#include"util/typedefs.h"
|
#include"util/typedefs.h"
|
||||||
#include"platform/platform.h"
|
#include"platform/platform.h"
|
||||||
#include"mp_app.h"
|
#include"app/mp_app.h"
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------
|
||||||
//NOTE(martin): backends selection
|
//NOTE(martin): backends selection
|
|
@ -9,7 +9,7 @@
|
||||||
#define __GRAPHICS_SURFACE_H_
|
#define __GRAPHICS_SURFACE_H_
|
||||||
|
|
||||||
#include"graphics_common.h"
|
#include"graphics_common.h"
|
||||||
#include"mp_app_internal.h"
|
#include"app/mp_app_internal.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
|
@ -10,10 +10,10 @@
|
||||||
#import<QuartzCore/CAMetalLayer.h>
|
#import<QuartzCore/CAMetalLayer.h>
|
||||||
#include<simd/simd.h>
|
#include<simd/simd.h>
|
||||||
|
|
||||||
#include"graphics_surface.h"
|
#include"util/macro_helpers.h"
|
||||||
#include"macro_helpers.h"
|
#include"app/osx_app.h"
|
||||||
#include"osx_app.h"
|
|
||||||
|
|
||||||
|
#include"graphics_surface.h"
|
||||||
#include"mtl_renderer.h"
|
#include"mtl_renderer.h"
|
||||||
|
|
||||||
const int MG_MTL_INPUT_BUFFERS_COUNT = 3,
|
const int MG_MTL_INPUT_BUFFERS_COUNT = 3,
|
|
@ -12,8 +12,8 @@
|
||||||
#include<simd/simd.h>
|
#include<simd/simd.h>
|
||||||
|
|
||||||
#include"graphics_surface.h"
|
#include"graphics_surface.h"
|
||||||
#include"macro_helpers.h"
|
#include"util/macro_helpers.h"
|
||||||
#include"osx_app.h"
|
#include"app/osx_app.h"
|
||||||
|
|
||||||
typedef struct mg_mtl_surface
|
typedef struct mg_mtl_surface
|
||||||
{
|
{
|
|
@ -6,12 +6,12 @@
|
||||||
* @revision:
|
* @revision:
|
||||||
*
|
*
|
||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
#include"win32_app.h"
|
#include"app/win32_app.h"
|
||||||
#include"graphics_surface.h"
|
#include"graphics_surface.h"
|
||||||
#include"gl_loader.h"
|
#include"gl_loader.h"
|
||||||
|
|
||||||
#include<GL/wglext.h>
|
#include<GL/wglext.h>
|
||||||
#include"macro_helpers.h"
|
#include"util/macro_helpers.h"
|
||||||
|
|
||||||
#define WGL_PROC_LIST \
|
#define WGL_PROC_LIST \
|
||||||
WGL_PROC(WGLCHOOSEPIXELFORMATARB, wglChoosePixelFormatARB) \
|
WGL_PROC(WGLCHOOSEPIXELFORMATARB, wglChoosePixelFormatARB) \
|
|
@ -60,24 +60,24 @@
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
|
|
||||||
#if PLATFORM_WINDOWS
|
#if PLATFORM_WINDOWS
|
||||||
#include"win32_app.c"
|
#include"app/win32_app.c"
|
||||||
#include"graphics_common.c"
|
#include"graphics/graphics_common.c"
|
||||||
#include"graphics_surface.c"
|
#include"graphics/graphics_surface.c"
|
||||||
|
|
||||||
#if MG_COMPILE_GL || MG_COMPILE_GLES
|
#if MG_COMPILE_GL || MG_COMPILE_GLES
|
||||||
#include"gl_loader.c"
|
#include"graphics/gl_loader.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MG_COMPILE_GL
|
#if MG_COMPILE_GL
|
||||||
#include"wgl_surface.c"
|
#include"graphics/wgl_surface.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MG_COMPILE_CANVAS
|
#if MG_COMPILE_CANVAS
|
||||||
#include"gl_canvas.c"
|
#include"graphics/gl_canvas.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MG_COMPILE_GLES
|
#if MG_COMPILE_GLES
|
||||||
#include"egl_surface.c"
|
#include"graphics/egl_surface.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif PLATFORM_MACOS
|
#elif PLATFORM_MACOS
|
||||||
|
@ -86,5 +86,5 @@
|
||||||
#error "Unsupported platform"
|
#error "Unsupported platform"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include"input_state.c"
|
#include"ui/input_state.c"
|
||||||
#include"ui.c"
|
#include"ui/ui.c"
|
||||||
|
|
|
@ -38,15 +38,13 @@
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
// application/graphics layer
|
// application/graphics layer
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
#include"mp_app.h"
|
#include"app/mp_app.h"
|
||||||
#include"graphics.h"
|
#include"graphics/graphics.h"
|
||||||
#include"input_state.h"
|
#include"ui/input_state.h"
|
||||||
#include"ui.h"
|
#include"ui/ui.h"
|
||||||
|
|
||||||
#ifdef MG_INCLUDE_GL_API
|
#ifdef MG_INCLUDE_GL_API
|
||||||
#include"gl_api.h"
|
#include"graphics/gl_api.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#include"ui.h"
|
|
||||||
|
|
||||||
#endif //__MILEPOST_H_
|
#endif //__MILEPOST_H_
|
||||||
|
|
|
@ -7,20 +7,20 @@
|
||||||
*
|
*
|
||||||
*****************************************************************/
|
*****************************************************************/
|
||||||
|
|
||||||
#include"osx_path.m"
|
#include"platform/osx_path.m"
|
||||||
#include"osx_app.m"
|
#include"app/osx_app.m"
|
||||||
#include"graphics_common.c"
|
#include"graphics/graphics_common.c"
|
||||||
#include"graphics_surface.c"
|
#include"graphics/graphics_surface.c"
|
||||||
|
|
||||||
#if MG_COMPILE_METAL
|
#if MG_COMPILE_METAL
|
||||||
#include"mtl_surface.m"
|
#include"graphics/mtl_surface.m"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MG_COMPILE_CANVAS
|
#if MG_COMPILE_CANVAS
|
||||||
#include"mtl_renderer.m"
|
#include"graphics/mtl_renderer.m"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MG_COMPILE_GLES
|
#if MG_COMPILE_GLES
|
||||||
#include"gl_loader.c"
|
#include"graphics/gl_loader.c"
|
||||||
#include"egl_surface.c"
|
#include"graphics/egl_surface.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include"util/typedefs.h"
|
#include"util/typedefs.h"
|
||||||
#include"util/strings.h"
|
#include"util/strings.h"
|
||||||
#include"util/utf8.h"
|
#include"util/utf8.h"
|
||||||
#include"mp_app.h"
|
#include"app/mp_app.h"
|
||||||
|
|
||||||
typedef struct mp_key_state
|
typedef struct mp_key_state
|
||||||
{
|
{
|
|
@ -12,7 +12,7 @@
|
||||||
#include"util/typedefs.h"
|
#include"util/typedefs.h"
|
||||||
#include"util/lists.h"
|
#include"util/lists.h"
|
||||||
#include"input_state.h"
|
#include"input_state.h"
|
||||||
#include"graphics.h"
|
#include"graphics/graphics.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
|
@ -1,5 +1,4 @@
|
||||||
#include <keys.h>
|
#include <keys.h>
|
||||||
#include <graphics.h>
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <orca.h>
|
#include <orca.h>
|
||||||
|
|
|
@ -11,6 +11,7 @@ else
|
||||||
CLANG=clang
|
CLANG=clang
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ORCA_DIR=../..
|
||||||
STDLIB_DIR=../../cstdlib
|
STDLIB_DIR=../../cstdlib
|
||||||
ORCA_SDK_DIR=../../sdk
|
ORCA_SDK_DIR=../../sdk
|
||||||
MILEPOST_DIR=../../milepost
|
MILEPOST_DIR=../../milepost
|
||||||
|
@ -25,6 +26,7 @@ wasmFlags="--target=wasm32 \
|
||||||
-mbulk-memory \
|
-mbulk-memory \
|
||||||
-D__ORCA__ \
|
-D__ORCA__ \
|
||||||
-I $STDLIB_DIR/include \
|
-I $STDLIB_DIR/include \
|
||||||
|
-I $ORCA_DIR/ext \
|
||||||
-I $ORCA_SDK_DIR \
|
-I $ORCA_SDK_DIR \
|
||||||
-I $MILEPOST_DIR/ext -I $MILEPOST_DIR -I $MILEPOST_DIR/src"
|
-I $MILEPOST_DIR/ext -I $MILEPOST_DIR -I $MILEPOST_DIR/src"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#include <keys.h>
|
#include <keys.h>
|
||||||
#include <graphics.h>
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <orca.h>
|
#include <orca.h>
|
||||||
|
|
|
@ -11,6 +11,8 @@ else
|
||||||
CLANG=clang
|
CLANG=clang
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ORCA_DIR=../..
|
||||||
|
|
||||||
wasmFlags="--target=wasm32 \
|
wasmFlags="--target=wasm32 \
|
||||||
--no-standard-libraries \
|
--no-standard-libraries \
|
||||||
-fno-builtin \
|
-fno-builtin \
|
||||||
|
@ -20,6 +22,7 @@ wasmFlags="--target=wasm32 \
|
||||||
-O2 \
|
-O2 \
|
||||||
-mbulk-memory \
|
-mbulk-memory \
|
||||||
-D__ORCA__ \
|
-D__ORCA__ \
|
||||||
|
-I $ORCA_DIR/ext \
|
||||||
-isystem ../../cstdlib/include -I ../../sdk -I../../milepost/ext -I ../../milepost -I ../../milepost/src"
|
-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
|
$CLANG $wasmFlags -o ./module.wasm ../../sdk/orca.c ../../cstdlib/src/*.c src/main.c
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
#include"keys.h"
|
#include"keys.h"
|
||||||
#include"graphics.h"
|
|
||||||
#include"ui.h"
|
|
||||||
|
|
||||||
#include"orca.h"
|
#include"orca.h"
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ def build_milepost_lib_mac(release):
|
||||||
# TODO: shaderFlagParam
|
# TODO: shaderFlagParam
|
||||||
"-fno-fast-math", "-c",
|
"-fno-fast-math", "-c",
|
||||||
"-o", "../build/mtl_renderer.air",
|
"-o", "../build/mtl_renderer.air",
|
||||||
"src/mtl_renderer.metal",
|
"src/graphics/mtl_renderer.metal",
|
||||||
], check=True)
|
], check=True)
|
||||||
subprocess.run([
|
subprocess.run([
|
||||||
"xcrun", "-sdk", "macosx", "metallib",
|
"xcrun", "-sdk", "macosx", "metallib",
|
||||||
|
@ -302,7 +302,8 @@ def build_orca_win(release):
|
||||||
includes = [
|
includes = [
|
||||||
"/I", "src",
|
"/I", "src",
|
||||||
"/I", "sdk",
|
"/I", "sdk",
|
||||||
"/I", "ext"
|
"/I", "ext",
|
||||||
|
"/I", "ext/angle/include",
|
||||||
"/I", "ext/wasm3/source",
|
"/I", "ext/wasm3/source",
|
||||||
"/I", "milepost/src"
|
"/I", "milepost/src"
|
||||||
]
|
]
|
||||||
|
@ -332,6 +333,7 @@ def build_orca_mac(release):
|
||||||
"-Imilepost/src/util",
|
"-Imilepost/src/util",
|
||||||
"-Imilepost/src/platform",
|
"-Imilepost/src/platform",
|
||||||
"-Iext",
|
"-Iext",
|
||||||
|
"-Iext/angle/include",
|
||||||
"-Iext/wasm3/source"
|
"-Iext/wasm3/source"
|
||||||
]
|
]
|
||||||
libs = ["-Lbuild/bin", "-Lbuild/lib", "-lmilepost", "-lwasm3"]
|
libs = ["-Lbuild/bin", "-Lbuild/lib", "-lmilepost", "-lwasm3"]
|
||||||
|
@ -380,12 +382,12 @@ def gen_all_bindings():
|
||||||
|
|
||||||
bindgen("canvas", "src/canvas_api.json",
|
bindgen("canvas", "src/canvas_api.json",
|
||||||
guest_stubs="sdk/orca_surface.c",
|
guest_stubs="sdk/orca_surface.c",
|
||||||
guest_include="graphics.h",
|
guest_include="graphics/graphics.h",
|
||||||
wasm3_bindings="src/canvas_api_bind_gen.c",
|
wasm3_bindings="src/canvas_api_bind_gen.c",
|
||||||
)
|
)
|
||||||
bindgen("clock", "src/clock_api.json",
|
bindgen("clock", "src/clock_api.json",
|
||||||
guest_stubs="sdk/orca_clock.c",
|
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",
|
wasm3_bindings="src/clock_api_bind_gen.c",
|
||||||
)
|
)
|
||||||
bindgen("io", "src/io_api.json",
|
bindgen("io", "src/io_api.json",
|
||||||
|
|
|
@ -18,10 +18,10 @@
|
||||||
#include"util/strings.c"
|
#include"util/strings.c"
|
||||||
#include"util/utf8.c"
|
#include"util/utf8.c"
|
||||||
|
|
||||||
#include"graphics_common.c"
|
#include"graphics/graphics_common.c"
|
||||||
#include"input_state.c"
|
#include"ui/input_state.c"
|
||||||
|
#include"ui/ui.c"
|
||||||
|
|
||||||
#include"orca_exports.c"
|
#include"orca_exports.c"
|
||||||
#include"orca_surface.c"
|
#include"orca_surface.c"
|
||||||
#include"ui.c"
|
|
||||||
|
|
||||||
#include"io_stubs.c"
|
#include"io_stubs.c"
|
||||||
|
|
|
@ -21,7 +21,10 @@
|
||||||
|
|
||||||
#include"math.h"
|
#include"math.h"
|
||||||
|
|
||||||
#include"graphics.h"
|
#include"graphics/graphics.h"
|
||||||
|
#include"ui/input_state.h"
|
||||||
|
#include"ui/ui.h"
|
||||||
|
|
||||||
#include"gl31.h"
|
#include"gl31.h"
|
||||||
|
|
||||||
#if COMPILER_CLANG
|
#if COMPILER_CLANG
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
#define MG_INCLUDE_GL_API
|
#define MG_INCLUDE_GL_API
|
||||||
#include"milepost.h"
|
#include"milepost.h"
|
||||||
#include"graphics_common.h"
|
#include"graphics/graphics_common.h"
|
||||||
|
|
||||||
#include"orca_app.h"
|
#include"orca_app.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue