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_ | ||||
| 
 | ||||
| #include"mp_app.h" | ||||
| #include"graphics.h" | ||||
| #include"graphics/graphics.h" | ||||
| 
 | ||||
| #ifdef __OBJC__ | ||||
| 	#import<Cocoa/Cocoa.h> | ||||
|  | @ -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" | ||||
| 
 | ||||
|  | @ -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) | ||||
| { | ||||
|  | @ -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" | ||||
| 
 | ||||
|  | @ -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); | ||||
|  | @ -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
 | ||||
|  | @ -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" { | ||||
|  | @ -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, | ||||
|  | @ -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 | ||||
| { | ||||
|  | @ -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) \ | ||||
|  | @ -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" | ||||
|  |  | |||
|  | @ -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_
 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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 | ||||
| { | ||||
|  | @ -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" { | ||||
|  | @ -1,5 +1,4 @@ | |||
| #include <keys.h> | ||||
| #include <graphics.h> | ||||
| #include <math.h> | ||||
| 
 | ||||
| #include <orca.h> | ||||
|  |  | |||
|  | @ -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" | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,5 +1,4 @@ | |||
| #include <keys.h> | ||||
| #include <graphics.h> | ||||
| #include <math.h> | ||||
| 
 | ||||
| #include <orca.h> | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -1,6 +1,4 @@ | |||
| #include"keys.h" | ||||
| #include"graphics.h" | ||||
| #include"ui.h" | ||||
| 
 | ||||
| #include"orca.h" | ||||
| 
 | ||||
|  |  | |||
|  | @ -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", | ||||
|  |  | |||
|  | @ -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" | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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" | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue