Forum Replies Created
Also, the following no longer works in the latest build either:Monkey1234567891011121314Namespace test#Import "<std>"Using std..Function Main()Print(Int(TestGenericMethod<Int>()))EndFunction TestGenericMethod<T>:Bool() Where T Implements INumericReturn TrueEnd
Get error: Can’t find overload for ‘TestGenericMethod<int>(…)’ with argument types ()
Again, this used to work in v1.0.5, and works in 1.0.6 if I remove the Where clause
Extension methods fail to build at all with the latest code, whether as a module or not.
Lots of “Blah:T?(T?) must be a generic class type” errors.
The code built fine in v1.0.5
Have attached if you want to have a look.
Actually, it looks like I’m not on the latest version. I’ll update later and give it a try.
Hmmm … do extension methods not work in modules?
The module builds but I’m getting pretty much empty .cpp source files in my windows_debug folder and if I try to use any of the extension methods I get “undefined reference” errors.
It all works fine when built as an app where the .cpp source files contain everything I’d expect to see.
If I build the app without actually referencing or using any of the extension methods I get the same empty .cpp source files as I’m seeing in the module. This makes sense for building an app ‘cos it’s only building what it needs to, but I wouldn’t have thought a module would do that?
Am I missing something about building modules?
I do have Linq-like extension methods for List<T> and Stack<T> that I would like to upload to the module manager. Might work on that a bit today.
Here’s the xml parser.
I might upload it as a module later, but between adding a demo app and adding documentation it’s actually a fair amount of work.
Edit: Especially as it’s not originally my code so documenting it might be “fun” 🙂
I converted skn3’s Monkey X xml module to Monkey 2. It’s pure Monkey 2 code with no dependencies. I don’t have it on this PC, but I could post it later if you’re interested.
TinyXML looks good though 🙂
I haven’t been able to track the MAV down yet, but it appears that I can mitigate it by changing the #Include order.
If I #Include the extension classes at the very end, after all other classes, then they work.
If I #Include them earlier (e.g. I originally had them in alphabetical order) then I get the MAV.
But it’s not as simple as just order, as I can also fix the MAV by commenting out some of my other includes, so it’s some combination of my code and #Include order … will keep looking.
I’ll try – so far my extension-only project is working fine and my large project gives the MAV on the simplest extension, but I’m not sure what it is about it that causes it.
Related question – any chance of allowing extension overload methods? E.g. an alternative List<T>.Count() method with parameters? At present it compiles the overloaded method but gives “can’t find overload for ‘Count(…)’ with argument types (bool(string))” when you try to call it.
Hmm … works in a little project of it’s own, but not in the middle of my game project 🙁
Works fine for me for both 1.03 and 1.05 – haven’t specifically tried 1.04 but sounds like it should be fine.
I’ve just been moving the one copy of devtools\i686-5.3.0-posix-dwarf-rt_v4-rev0 around as I download new builds.
Bool worked that way in v1.03
I’ve just switched from 1.03 to 1.05 and String(booleanValue) worked in 1.03 but has stopped working in 1.05 (and presumably 1.04)
Cast<String>(booleanValue) isn’t working either 🙁
Typical! I found the solution immediately after posting the problem:
Place a copy of mingw32\bin\libwinpthread-1.dll in the same folder as cc1plus.exe
Don’t know why this is different on Windows 7 than 10, but guess this might help someone else out in the future 🙂
Actually, I found the file and am currently making my own.August 26, 2016 at 7:49 am in reply to: FPS, Delta, FixedFPS, Timing, Animation Topic (almost done) #3466
As far as I know:
[fact 1] Yes
[fact 2] Yes
[fact 3] Yes
[fact 4] Yes- with a clarification – App.RequestRender() seems to be telling the app to call OnRender() for the next frame (so it’s too late to stop the current frame as it’s already underway, but you could avoid calling it for subsequent frames if you wanted – e.g. if the window had lost focus). So as long as you call App.RequestRender() somewhere in the OnRender() method you’re good – I don’t think the order matters.
Also, I confirmed the SwapInterval behaviour last night with an old 19″ 75hz monitor I have at home – just using SwapInterval = 1 and not setting an explicit resolution it’s updating 75 times a second as I suspected.