Forum Replies Created
-
AuthorPosts
-
can we now pass by reference to externals? I have some const& that are passing fine now though I tought I would have to remove them from c++ code!
edit: it was not an abstract method so that must be the point.
I could extend struct in the extern section…
didn’t try in public section.
September 19, 2016 at 9:10 pm in reply to: you can't have a field in an extend of 'external extends void' #4032I decided to use the good old global sharing, not elegant but should do the job. And I had better perfs compared to “canvas ptr”…
If you are interested into having a sight on the approach, you can see full code on github: https://github.com/abakobo/Box2D_for_monkey2
thx for the suggestions
September 19, 2016 at 8:38 am in reply to: you can't have a field in an extend of 'external extends void' #4018using a pointer to the global/Field sticked to canvas
[/crayon]Monkey123[crayon-5cba16ba105a4268551579 inline="true" ]b2canvas=canvasDDrawer.CycleInit(Varptr b2canvas,40,viewpoint)world.DrawDebugData()gives the folowing error:
-for Field:
no known conversion for argument 1 from ‘bbGCVar<t_mojo_graphics_Canvas>*’ to ‘t_mojo_graphics_Canvas**’
-for global:
no known conversion for argument 1 from ‘bbGCRootVar<t_mojo_graphics_Canvas>*’ to ‘t_mojo_graphics_Canvas**’but maybe doing the following would “save” the canvas too?
[/crayon]Monkey123[crayon-5cba16ba105ab613058241 inline="true" ]b2canvas=canvasDDrawer.CycleInit(Varptr canvas,40,viewpoint)world.DrawDebugData()September 19, 2016 at 1:52 am in reply to: you can't have a field in an extend of 'external extends void' #4013My aim is to pass the canvas passed to OnRender to my box2D debugdraw.
Is there any chance the gc could reallocate the canvas while OnRender is processing?
If not the pointer to canvas should be way more convenient than a handle. My tests worked fine. I pass the varptr canvas to my debugdraw object just before I ask for a draw. Never had any memory violation or visual incoherence.
Actually I don’t see how to create handles. Would I need to call gcnew myself on the cpp side and understand how gc works?
@Simon Armstrong:
What tools did you use to machine pass/translate the API? I have no idea how it can be done. I’ve had a look at docxygen and clang but it’s very blury to me…
same problem here
Just tried it..
first suggestion works if I use:
b2Draw_ext.SetFlags(b2Draw.e_shapeBit | b2Draw.e_jointBit) for example
or
b2Draw_ext.SetFlags(b2Draw_ext.e_shapeBit | b2Draw_ext.e_jointBit)just e_shapeBit alone won’t work but it’s sufficient for me. May be work on that a bit more but if all goes well like that I’ll keep it so.
thanks!
September 9, 2016 at 7:55 am in reply to: external abstract won't compile in debug mode (w7 and elcapitan) #3815now running in debug mode with latest github download…
September 7, 2016 at 2:31 pm in reply to: external abstract won't compile in debug mode (w7 and elcapitan) #3746I’ve checked twice (w7 and 10) and the src/tanslator_cpp.monkey2 is the new one (line 584 is modified with old code in comment). Rebuildall and dbEmit error.. May be some other modified files are on your side? On the github commit I just see that file marked as modified. (Commit 9e7c7a56)
I can’t try the actual git master as ted2 won’t launch (new issue with w7 and w10). Have not tried on osx with latest git.
Should it work with 1.0.4 with just that modified translator_cpp replaced?
September 7, 2016 at 7:17 am in reply to: external abstract won't compile in debug mode (w7 and elcapitan) #3729It is still giving an error..
W7 message
[/crayon]Monkey12345678910111213141516171819202122232425[crayon-5cba16ba22bc5507759025 inline="true" ]Compiling...Build error: System command 'g++ -std=c++11 -m32 -I"C:/Users/poilux/Desktop/monkey2-abakobo-eol_manag/modules/monkey/native" -I"C:/Users/poilux/Desktop/monkey2-abakobo-eol_manag/modules/" -I"C:/extv/" -c -o "C:/extv/external_v.buildv1.0.5/windows_debug/build/_1src_2external_00v_0external_00v.cpp.o" "C:/extv/external_v.buildv1.0.5/windows_debug/src/external_0v_external_0v.cpp"' failed.g++ -std=c++11 -m32 -I"C:/Users/poilux/Desktop/monkey2-abakobo-eol_manag/modules/monkey/native" -I"C:/Users/poilux/Desktop/monkey2-abakobo-eol_manag/modules/" -I"C:/extv/" -c -o "C:/extv/external_v.buildv1.0.5/windows_debug/build/_1src_2external_00v_0external_00v.cpp.o" "C:/extv/external_v.buildv1.0.5/windows_debug/src/external_0v_external_0v.cpp"C:/extv/external_v.buildv1.0.5/windows_debug/src/external_0v_external_0v.cpp: In member function 'void t_default_nonAbstractFoo::dbEmit()':C:/extv/external_v.buildv1.0.5/windows_debug/src/external_0v_external_0v.cpp:28:3: error: 'dbEmit' is not a member of 'Foo'Foo::dbEmit();^C:/extv/external_v.buildv1.0.5/windows_debug/src/external_0v_external_0v.cpp: In function 'bbString bbDBValue(t_default_nonAbstractFoo**)':C:/extv/external_v.buildv1.0.5/windows_debug/src/external_0v_external_0v.cpp:43:28: error: cannot convert 't_default_nonAbstractFoo*' to 'bbObject*' for argument '1' to 'bbString bbDBObjectValue(bbObject*)'return bbDBObjectValue(*p);^***** Fatal mx2cc error *****Internal mx2cc build errorosx message
[/crayon]Monkey1234567891011121314151617181920212223[crayon-5cba16ba22bda507201758 inline="true" ]Compiling...Build error: System command 'g++ -std=c++11 -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -O0 -I"/Users/koko/Desktop/monkey2-ako105b/modules/monkey/native" -I"/Users/koko/Desktop/monkey2-ako105b/modules/" -I"/Users/koko/Desktop/ext_syn/ext_v_by_pointer/" -c -o "/Users/koko/Desktop/ext_syn/ext_v_by_pointer/external_v_by_ptr.buildv1.0.5/macos_debug/build/_1src_2external_00v_00by_00ptr_0external_00v_00by_00ptr.cpp.o" "/Users/koko/Desktop/ext_syn/ext_v_by_pointer/external_v_by_ptr.buildv1.0.5/macos_debug/src/external_0v_0by_0ptr_external_0v_0by_0ptr.cpp"' failed.g++ -std=c++11 -Wno-deprecated-declarations -Wno-tautological-pointer-compare -Wno-undefined-bool-conversion -Wno-int-to-void-pointer-cast -Wno-inconsistent-missing-override -Wno-logical-op-parentheses -Wno-parentheses-equality -O0 -I"/Users/koko/Desktop/monkey2-ako105b/modules/monkey/native" -I"/Users/koko/Desktop/monkey2-ako105b/modules/" -I"/Users/koko/Desktop/ext_syn/ext_v_by_pointer/" -c -o "/Users/koko/Desktop/ext_syn/ext_v_by_pointer/external_v_by_ptr.buildv1.0.5/macos_debug/build/_1src_2external_00v_00by_00ptr_0external_00v_00by_00ptr.cpp.o" "/Users/koko/Desktop/ext_syn/ext_v_by_pointer/external_v_by_ptr.buildv1.0.5/macos_debug/src/external_0v_0by_0ptr_external_0v_0by_0ptr.cpp"/Users/koko/Desktop/ext_syn/ext_v_by_pointer/external_v_by_ptr.buildv1.0.5/macos_debug/src/external_0v_0by_0ptr_external_0v_0by_0ptr.cpp:31:3: error: no member named 'dbEmit' in 'Foo'; did you mean simply 'dbEmit'?Foo::dbEmit();^~~~~~~~~~~dbEmit/Users/koko/Desktop/ext_syn/ext_v_by_pointer/external_v_by_ptr.buildv1.0.5/macos_debug/src/external_0v_0by_0ptr_external_0v_0by_0ptr.cpp:30:32: note: 'dbEmit' declared herevoid t_default_nonAbstractFoo::dbEmit(){^/Users/koko/Desktop/ext_syn/ext_v_by_pointer/external_v_by_ptr.buildv1.0.5/macos_debug/src/external_0v_0by_0ptr_external_0v_0by_0ptr.cpp:46:10: error: no matching function for call to 'bbDBObjectValue'return bbDBObjectValue(*p);^~~~~~~~~~~~~~~/Users/koko/Desktop/monkey2-ako105b/modules/monkey/native/bbobject.h:65:17: note: candidate function not viable: no known conversion from 't_default_nonAbstractFoo *' to 'bbObject *' for 1st argumentinline bbString bbDBObjectValue( bbObject *p ){^2 errors generated.***** Fatal mx2cc error *****Internal mx2cc build errorWhen I experimented optimization I saw that struct properties are slower than fields.
And I thought the same. in vec2, X and Y properties shouldn’t be there because some people will slow down their loops by choosing (unuselfull)properties instead of field in their calculation.I had forked the repo at the time!
Played a bit with it (box2d) and managed to get a circle bouncing on another! (no gfx…text only for now)
Since the github/nitrologic/m2/modules has disapeared I created a special repo on my github just for the box2d module: https://github.com/abakobo/Box2D_for_monkey2.
@nitrologic: Have you moved your box2d module or has it been cleared? If you moved it i’ll be happy to see what you did and be a volunteer!@nitrologic: I just wanted to look at some box2d examples but there’s no more box2d on your repo… have you moved it?
Anyone has some little examples that runs?thx for the infos dawlane
I did the following on a fresh install of mint 17 and it worked (had to add sdl2-dev to the libs.
open terminal
go to the parent dir of monkey2-master
then type following commands[/crayon]Monkey1234567891011[crayon-5cba16ba2f94c946683655 inline="true" ]chmod +x -R ./monkey2-mastersudo apt-get install g++sudo apt-get -y install g++-multilib libglu1-mesa-dev libopenal-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev libxxf86vm-dev libx11-dev libgl1-mesa-dev libsdl2-devcd monkey2-master/scripts./rebuidall.shOn mint 18 I’ve had problems with “sofware source->cd-rom” that had to be disabled. and I made the apt update because of that thinking it would solve the problem.
I suppose doing a:
[/crayon]Monkey123[crayon-5cba16ba2f951108259966 inline="true" ]sudo apt-get update && sudo apt-get upgradebefore all that would have been better!
-
AuthorPosts