Forum Replies Created
-
AuthorPosts
-
Is it client/server style?
Fixes now available at github!
Haven’t committed this yet, but it all seems to be working:
http://www.monkey-x.com/mak/simplelight/Simplelight.html
It’s working here:
Monkey1234567891011121314'----- file desktop/test/test2/main.monkey2'#Import "../test.monkey2"Function Main()Here()End'----- file desktop/test/test.monkey2'Function Here()Print "Here!"EndFix coming! Ditto for lights…
Very nice!
Ok, my mistake, you need to use an array of Vec2f’s – see below.
There is ‘help’ in there you know – pretty crappy, but clicking ‘F1’ on ShadowCaster a few times should bring up the ShadowCaster class.
Monkey12345678Local verts:=New Stack<Vec2f>verts.Push( New Vec2f( 0,0 ) )verts.Push( New Vec2f( 32,0 ) )verts.Push( New Vec2f( 32,32 ) )verts.Push( New Vec2f( 0,32 ) )_logo.ShadowCaster=New ShadowCaster( verts.ToArray() )Yep, that’s fine. I use stuff like this all over the place in Ted2 , eg: mojox.Action.
name:String is ‘captured’ by the lamba, which effectively means it’s copied into a private area of the lamba. But since strings are immutable and reference counted, this is very cheap.
October 18, 2016 at 10:05 pm in reply to: Textfield doesn't lose focus when other gadgets are interacted with #4531Bug report:
Ahh, OK, though it was another bug as you didn’t mention a crash originally.
Any way for me to easily reproduce the crash?
October 18, 2016 at 9:15 pm in reply to: Textfield doesn't lose focus when other gadgets are interacted with #4526Sorry I have probably given the impression that I am complaining about monkey2.
No problem, just wanted to make extra sure you realized that mojox is currently a bit , erm, idiosyncratic.
But by the look of the screenshot, you seem to be doing just fine!
The bug report in this thread
Link missing?
Woohoo, that is very, very blue – thanks!
As for changing images, yes, there are several issues there that still need to be resolved….
Monkey123item1.node.Remove()item2.node.InsertBefore(item1.node)Not quite sure what you’re expecting this to do – once you remove item1.node, it’s no longer in a list so inserting things before/after it doesn’t have a lot of meaning. Also, note that nodes can only be in one list at a time.
Incidentally, I don’t get an endless loop here (with new List), both item1 and item2 just ‘disappear’ as expected, as you a) remove node1 (effectively ‘moving’ it from the list to ‘no list’) then insert node2 before node1 (so it’s also gone!).
But again, I recommend avoiding lists altogether if possible – sticks to Stacks, sort them if necessary, whatever. Lists are slow, memory intensive and just generally icky, as the above demonstrates.
Still, probably my fault for semi-popularizing list abuse like this in the first place!
Hi Mark, I don’t know why are there two gl contexts in your design,
A couple of reasons:
- Since I have no idea what GL states custom non-mojo code is modifying, using a single context would mean mojo would have to push/pop/reset (or do something fancy ) with *ALL* GL state before/after any custom GL code runs. This would involved resetting viewport, framebuffer, texture bindings etc which is slow.
- It allows for the possibility of users creating GL3/GL4 contexts (TODO – might not work).
Essentially the BeginGL/EndGL performs that swap.
Yes, but it only happens inside OnRender(). The constructor is still running in mojo’s GL context. Again, not sure why it’s working (your glClearColor should be affecting the mojo GL context) but it looks like creating a GL context is also making it current. This could be an Angle thing though.
October 18, 2016 at 6:20 pm in reply to: Textfield doesn't lose focus when other gadgets are interacted with #4517ListView does not currently respond to key events.
Mojox is still a WIP, so there will be many ‘holes’ like this in it. Things’ll happen over time, but if you’re after a 100% complete GUI system mojox probably isn’t for you!
This works from the IDE when built in console mode, but the resulting executable doesn’t actually print anything when run from command line.
Oops, that’s an old Ted2 bug – just commited a fix.
Also make sure you select ‘Console’ for apptype the first time you build the app. You can change this setting later using Build Target…Target settings (should probably be called product settings).
Also, I notice the resulting build includes all the d3d, libgl, etc, stuff — are these currently required by all exes?
Nope, only exes that #Import mojo (or gles20 etc).
For console apps, the idea is you only need to #Import “<std>”, although you don’t have to.
-
AuthorPosts