Forum Replies Created
-
AuthorPosts
-
August 25, 2016 at 10:56 am in reply to: FPS, Delta, FixedFPS, Timing, Animation Topic (almost done) #3446
As I say, all SwapInterval does is call SDL_GL_SetSwapInterval(), which just enables vsync – it doesn’t force any particular frequency.
So just setting SwapInterval won’t do what you want, but yes if you explicitly set a 60hz (presumably fullscreen) mode then you’re probably good to go
Edit: that was in response to Simon
August 25, 2016 at 9:19 am in reply to: FPS, Delta, FixedFPS, Timing, Animation Topic (almost done) #3441As peterigz says, given all the different hardware available I don’t think it’s as simple as “default SwapInterval to 1 and never have to do delta timing again”.
Looks like SwapInterval just sets SDL_GL_SetSwapInterval(), which when set to 1 means “updates synchronized with the vertical retrace” – i.e. it enables vsync, so updates are then linked to your monitors refresh rate.
Great if all monitors were 60hz. But monitors that runs at different frequencies will update a different number of times per seconds (e.g. 60hz, 75hz, 120hz, 144hz). So if you write fixed logic assuming 60hz and run it on a non-60hz monitor your game would run at a different speed
Plus there are plenty of examples out there of PCs/GPUs just not honouring vsync, which again would break your game.
I just don’t see how we can avoid delta timing – I see it as a fundamental part of ensuring your game runs properly on “every PC” and I’ve never seen anything magical that would take that burden away, and given the complexity of PCs, I doubt we ever will.
I just added this to flip the image the correct way up:
Monkey1234567891011121314Method VerticallyFlipPixmap:Pixmap(pixmap:Pixmap)Local flipped := New Pixmap(pixmap.Width, pixmap.Height)For Local y := 0 To pixmap.Height -1For Local x := 0 To pixmap.Width -1Local value:UInt = pixmap.GetPixelARGB(x, pixmap.Height - (y + 1))flipped.SetPixelARGB(x, y, value)EndEndReturn flippedEndI’ve also been trying to add “screenshot” code and am seeing the same flipped image.
August 16, 2016 at 1:30 pm in reply to: What do you do if it parses fine but the linker throws up? #3083I’m getting the same error if I have a class who’s methods are not directly called by any static code.
The class in question is created by a factory class which can return one of many implementations of an interface. One of those implementations contains the only call to a particular method in another class. Compilation fails with the same error “source is a pointer to incomplete type”.
If I add a call to the method in question from somewhere else in the codebase then it compiles fine, but that’s a bit daft, and as it stands I can’t proceed with my current design (which worked fine in Monkey X, C# etc)
Unfortunately I can’t replicate in a test harness either
Edit: Having just read MikeHart’s comment above I changed my code to declare the objects without = Null at the end and now it works! Wha?
Edit: Also I can now replicate it with a small test harness (by adding an = Null). Build app.monkey2 in the attached zip and it should fail. If you remove the = Null from the end of the line Field globalState:GlobalState = Null in logic.monkey2 or put all the code together in one file it should work. Any one know why?
Attachments:
Hmmm … I’m getting myself confused …
I was writing tests for a generic class and wanted to test it with various types. To do this I was having to write two methods for each test, sort of like:
Monkey12345678910Method TestSomething:Void()DoSomething<GenericClass<Double>>()DoSomething<GenericClass<Long>>()etc.EndMethod DoSomething<T>:Void()Local instance := New T()' test an aspect of the classEndThis was getting a bit tedious, so I was looking for a way to cut this down a bit.
But thinking about it again there’s two obvious problems with that:
- What I was trying to do was nonsense (I somehow convinced myself that what I was trying to do was possible in C#, but it’s not – total brain-fart)
- I don’t need to test it with different types – one is enough (another brain-fart)
So, sorry to waste your time
Looks like the problem is the call to _process.WriteStdin() in Console.WriteStdin():
Unhandled exception at 0x771161BC (ntdll.dll) in ted2.exe: 0xC0000005: Access violation reading location 0x77D2E2B1.
Unfortunately the Process class is C++ so not sure how to debug any further and I can’t read assembler to save myself
I’ve been trying to write a simple test using the Process class, but I can’t get past “type Process not found”.
I’ll keep trying.
Thanks – I’ll give it a whirl
BendMode is an Enum. Do:
Monkey1Field blend:BlendMode=BlendMode.AlphaNot sure why putting it in an Int ever worked – it shouldn’t have.
Edit: actually, I’m wrong – the Implicit Type Conversions section in the help says putting it in an Int should work.
Okay – figured it out – was spaces in the path.
I had it in “~/development/monkey 2” – removed the space and it now works.
Spaces in the path are fine in Windows 7 and 10.
Nice to get it working on my MacBook
<nods> that makes sense – I had left the handle at 0,0.
Thanks for the explanation
- Monkey2 (Macos).app – yep, using that.
- ~/monkey2 installation folder – my folder is deeper, will try moving it to a shallower folder later.
- Permissions – not convinced – it creates the built app fine, which I can run manually, it just doesn’t run it from Ted and there’s no error, just “Done”. I’ll check later though.
- ~/monkey2/tmp – yep, that’s there.
OSX is 10.11.6 as stated (the latest version).
Latest command line tools installed (at least I ran the command in the readme and it said they were already installed).
I habitually keep all my computers and software up to date (I loooove an update) apart from my work machine, which they’re keeping on Windows 7.
July 23, 2016 at 9:12 pm in reply to: V1.0.1 and V1.0.2 give "VCRUNTIME140.dll is missing" when launching Ted2 #2378Just realised I reflexively downloaded the 64-bit version by mistake. The 32-bit version of https://www.microsoft.com/en-us/download/details.aspx?id=52982 works fine
-
AuthorPosts