Mark Sibly 9 anni fa
parent
commit
0aaffd6f40

+ 5 - 5
bin/env_linux.txt

@@ -31,19 +31,19 @@ MX2_CPP_OPTS_DESKTOP_RELEASE=-O3 -DNDEBUG
 
 '***** EMSCRIPTEN *****
 
+MX2_MSERVER="${MX2_HOME}/devtools/MonkeyXFree86c/bin/mserver_linux"
+
 MX2_BUILD_DIR_EMSCRIPTEN_DEBUG=emscripten_debug
 MX2_BUILD_DIR_EMSCRIPTEN_RELEASE=emscripten_release
 
-MX2_MSERVER="${MX2_HOME}/devtools/MonkeyXFree86c/bin/mserver_linux"
-
-MX2_LD_OPTS_EMSCRIPTEN=-s TOTAL_MEMORY=33554432 -s DISABLE_EXCEPTION_CATCHING=0
+MX2_LD_OPTS_EMSCRIPTEN=-s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=67108864 -s DISABLE_EXCEPTION_CATCHING=1 ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1
 MX2_LD_OPTS_EMSCRIPTEN_DEBUG=-O2
 MX2_LD_OPTS_EMSCRIPTEN_RELEASE=-O3
 
-MX2_CC_OPTS_EMSCRIPTEN=-std=gnu99 -Wno-undefined-bool-conversion -s TOTAL_MEMORY=33554432 -s DISABLE_EXCEPTION_CATCHING=0
+MX2_CC_OPTS_EMSCRIPTEN=-std=gnu99 -I. -s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=67108864 -s DISABLE_EXCEPTION_CATCHING=1 -Wno-warn-absolute-paths ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1 -Wno-undefined-bool-conversion -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-warn-absolute-paths 
 MX2_CC_OPTS_EMSCRIPTEN_DEBUG=-O2
 MX2_CC_OPTS_EMSCRIPTEN_RELEASE=-O3
 
-MX2_CPP_OPTS_EMSCRIPTEN=-std=c++11 -Wno-undefined-bool-conversion -s TOTAL_MEMORY=33554432 -s DISABLE_EXCEPTION_CATCHING=0
+MX2_CPP_OPTS_EMSCRIPTEN=-std=c++11 -I. -s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=67108864 -s DISABLE_EXCEPTION_CATCHING=1 -Wno-warn-absolute-paths ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1 -Wno-undefined-bool-conversion
 MX2_CPP_OPTS_EMSCRIPTEN_DEBUG=-O2
 MX2_CPP_OPTS_EMSCRIPTEN_RELEASE=-O3

+ 3 - 6
bin/env_macos.txt

@@ -46,17 +46,14 @@ PATH=/usr/local/bin:${PATH}
 MX2_BUILD_DIR_EMSCRIPTEN_DEBUG=emscripten_debug
 MX2_BUILD_DIR_EMSCRIPTEN_RELEASE=emscripten_release
 
-'LD options
-MX2_LD_OPTS_EMSCRIPTEN=-s TOTAL_MEMORY=33554432 -s DISABLE_EXCEPTION_CATCHING=0 -s USE_PTHREADS=1
+MX2_LD_OPTS_EMSCRIPTEN=-s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=67108864 -s DISABLE_EXCEPTION_CATCHING=1 ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1
 MX2_LD_OPTS_EMSCRIPTEN_DEBUG=-O2
 MX2_LD_OPTS_EMSCRIPTEN_RELEASE=-O3
 
-'C compiler options
-MX2_CC_OPTS_EMSCRIPTEN=-std=gnu99 -s TOTAL_MEMORY=33554432 -s DISABLE_EXCEPTION_CATCHING=0 -s USE_PTHREADS=1 -Wno-undefined-bool-conversion -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-warn-absolute-paths
+MX2_CC_OPTS_EMSCRIPTEN=-std=gnu99 -s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=67108864 -s DISABLE_EXCEPTION_CATCHING=1 -Wno-warn-absolute-paths ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1 -Wno-undefined-bool-conversion -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-warn-absolute-paths 
 MX2_CC_OPTS_EMSCRIPTEN_DEBUG=-O2
 MX2_CC_OPTS_EMSCRIPTEN_RELEASE=-O3
 
-'C++ compiler options
-MX2_CPP_OPTS_EMSCRIPTEN=-std=c++11 -s TOTAL_MEMORY=33554432 -s DISABLE_EXCEPTION_CATCHING=0 -s USE_PTHREADS=1 -Wno-undefined-bool-conversion -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-warn-absolute-paths
+MX2_CPP_OPTS_EMSCRIPTEN=-std=c++11 -s USE_SDL=2 -s FULL_ES2=1 -s TOTAL_MEMORY=67108864 -s DISABLE_EXCEPTION_CATCHING=1 -Wno-warn-absolute-paths ' -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=1 -Wno-undefined-bool-conversion
 MX2_CPP_OPTS_EMSCRIPTEN_DEBUG=-O2
 MX2_CPP_OPTS_EMSCRIPTEN_RELEASE=-O3

BIN
bin/mx2cc_linux


BIN
bin/mx2cc_macos


BIN
bin/mx2cc_windows.exe


+ 4 - 4
src/common.sh

@@ -7,12 +7,12 @@ ted2_new=""
 if [ "$OSTYPE" = "linux-gnu" ]
 then
 	mx2cc="../bin/mx2cc_linux"
-	mx2cc_new="mx2new/mx2cc.buildv008/desktop_release_linux/mx2cc"
+	mx2cc_new="mx2new/mx2cc.buildv009/desktop_release_linux/mx2cc"
 	ted2="../bin/ted2_linux"
-	ted2_new="ted2/ted2.buildv008/desktop_release_linux/ted2"
+	ted2_new="ted2/ted2.buildv009/desktop_release_linux/ted2"
 else
 	mx2cc="../bin/mx2cc_macos"
-	mx2cc_new="mx2new/mx2cc.buildv008/desktop_release_macos/mx2cc.app/Contents/MacOS/mx2cc"
+	mx2cc_new="mx2new/mx2cc.buildv009/desktop_release_macos/mx2cc.app/Contents/MacOS/mx2cc"
 	ted2="../bin/ted2.app"
-	ted2_new="ted2/ted2.buildv008/desktop_release_macos/ted2.app"
+	ted2_new="ted2/ted2.buildv009/desktop_release_macos/ted2.app"
 fi

+ 5 - 33
src/mx2new/test.monkey2

@@ -1,41 +1,13 @@
 
-Namespace test
-
-#Import "<std.monkey2>"
-
-Using std..
-
-Enum Mode
-	Opaque
-	Alpha
-End
-
-Struct Line
+Function Main()
 
-	Field state:Int
+	Local p:Void()
 	
-	Property Mode:Mode()
-		Return _mode
+	p=Lambda()
 	End
 	
-	Method update( line:Line )
-		Self=line
-	End
+	Local i:Int Ptr
+	i+=1
 	
-	Field _mode:=test.Mode.Opaque
-
 End
 
-Function Main()
-
-	Local t:=1.5e-2
-	
-	Print t
-
-	Local lines:=New Stack<Line>
-	
-	lines.Push( New Line )
-	
-'	lines[0].state=10
-
-End

+ 26 - 13
src/mx2new/test2.monkey2

@@ -1,22 +1,35 @@
 
-Namespace test
+#Import "<std>"
+#Import "<mojo>"
 
-Struct Vec3f
+Using std..
+Using mojo..
 
-	Field x:Float
-	Field y:Float
-	Field z:Float
-
-End
-
-Class D
-
-	Field x:Int
+Class MyWindow Extends Window
+	Field t:Test
 	
-	Method New()
+	Method New(title:String, width:Int, height:Int)
+		Super.New(title, width, height, WindowFlags.Resizable)
+		ClearColor = Color.Black
+		SwapInterval=1
+		t = New Test()		
+	End
+	
+	Method OnRender( canvas:Canvas ) Override
+		App.RequestRender()
+		canvas.DrawText( "Hello World!",Width/2,Height/2,.5,.5 )
+		Local x:=t.Hop()
 	End
 End
 
-Function Test2()
+Class Test
+	Method Hop()
+		Print "Hop"
+	End
 End
 
+Function Main()
+	New AppInstance
+	New MyWindow("Hello World", 640, 480)
+	App.Run()
+End

+ 1 - 1
src/rebuildmx2cc.bat

@@ -6,4 +6,4 @@ echo ***** Rebuilding mx2cc *****
 echo.
 
 ..\bin\mx2cc_windows makeapp -clean -config=release mx2new/mx2cc.monkey2
-copy mx2new\mx2cc.buildv008\desktop_release_windows\mx2cc.exe ..\bin\mx2cc_windows.exe
+copy mx2new\mx2cc.buildv009\desktop_release_windows\mx2cc.exe ..\bin\mx2cc_windows.exe

+ 1 - 1
src/updatemx2cc.bat

@@ -6,4 +6,4 @@ echo ***** Updating mx2cc *****
 echo.
 
 ..\bin\mx2cc_windows makeapp -config=release mx2new/mx2cc.monkey2
-copy mx2new\mx2cc.buildv008\desktop_release_windows\mx2cc.exe ..\bin\mx2cc_windows.exe
+copy mx2new\mx2cc.buildv009\desktop_release_windows\mx2cc.exe ..\bin\mx2cc_windows.exe