Forum Replies Created
-
AuthorPosts
-
Working fine here from both scripts and ted2 (build->rebuild documentation).
This really is an mx2 bug – the error should be reported by mx2, not c++!
Could you post an issue at github? Just copy and paste the above is fine.
Definitely looks like a mingw version mismatch error, which theoretically shouldn’t happen if you’ve got the correct mingw in devtools.
Perhaps try removing any another mingws you have from your system PATH?
No, you can’t currently make docs for an app but it’s an interesting idea.
The main problem is that makedocs really just produces a pile of html files and an ‘index.js’, which gets merged into the doc system (ie: a jstree etc, iframes etc).
But for an app, there is no doc system – which should happen to the html files and index?
MARK… YOU BROKE THE BLOODY SHIP!
I have tried to make clear in the past that hidden APIs are hidden for a reason, and that mojox was still under active development (which is why it was rolled into Ted2 and not a standalone module) but apparently I didn’t try hard enough. Please keep this in mind for the future – if you use any ‘hidden’ or other experimental stuff that’s not docced, you run the risk of it getting ripped out or changed at a later date.
But what problems are you having anyway? If you’re using your own fork of the old mojox, it should be relatively easy to get going as nothing major has really changed in mojo – perhaps the names of a few internal methods (many of which will now be public), but that should be about it.
This is working here in the latest Ted2, ie: the debugger catches the error, highlights it, stops when you hit ‘stop’, and works again and again.
I have tweaked the guts of DebugView a bit so I may have fixed something along the way…
New stuff should be up tomorrow or Monday – just want to give everything a bit of a thrashing first.
> Also, calling SDL_GL_SetAttribute() before creating a window crashes,
You need to do this after SDL_Init, but before creating the SDL_Window.
If you’re trying to do this in mojo as opposed to raw SDL, you’ll probably have to hack the AppInstance class.
I’d recommend trying with raw SDL first to get things working, eg:
Monkey1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283#import "<libc>"#import "<sdl2>"#import "<gles20>"Namespace sdl2testUsing libc..Using sdl2..Using gles20..Class SdlWindowField sdlWindow:SDL_Window PtrField sdlGLContext:SDL_GLContextMethod New()SDL_Init( SDL_INIT_EVERYTHING )SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE,1 )sdlWindow=SDL_CreateWindow( "SDL2 Window",SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,640,480,SDL_WINDOW_OPENGL )sdlGLContext=SDL_GL_CreateContext( sdlWindow )SDL_GL_MakeCurrent( sdlWindow,sdlGLContext )Local i:IntSDL_GL_GetAttribute( SDL_GL_DEPTH_SIZE,Varptr i )Print "SDL_GL_DEPTH_SIZE="+iEndMethod Run()RepeatLocal event:SDL_EventWhile( SDL_PollEvent( Varptr event ) )Select event.typeCase SDL_WINDOWEVENTLocal wevent:=Cast<SDL_WindowEvent Ptr>( Varptr event )Select wevent->eventCase SDL_WINDOWEVENT_CLOSEexit_( 0 )EndEndWendOnRender()SDL_GL_SwapWindow( sdlWindow )ForeverEndMethod OnRender()glClearColor( 1,1,0,1 )glClear( GL_COLOR_BUFFER_BIT )EndEndFunction Main()Local window:=New SdlWindowwindow.Run()EndAll this does is enable depth buffering, but it’s a start.
but the whole thing is just a bunch of crap.
Eloquently put, but it is what it is. MS won this round, hopefully Vulkan wins the next!
You probably need to use this *before* opening the window.
https://wiki.libsdl.org/SDL_GL_SetAttribute
Also, you may have to change this line in SDL2 include/SDL_config_windows.h
#define SDL_VIDEO_OPENGL 0
…change to ‘1’ then update sdl2 module. Might need some other tweaks too. There are also some additional SDL functions for selecting the preferred video driver you might need to look into.
> I kinda disagree with this, anyway; I’m not convinced that whatever performance boosts could be gained by running in a DirectX emulated environment is worth the stability loss of not actually running the OpenGL on hardware
The main issue here is compatibility – the sad fact is that a random PC has a much better chance of running HW accelerated D3D9/D3D11 decently (without a graphics driver update) than it does OpenGL. Even with a driver update, GL can still be a bit hit and miss…
The angle code is very stable (it’s used by most browsers) and very fast (faster than d3d9 bmx here) so IMO it’s the right choice for a ‘default’ driver..
Interesting that the method can be called on a null object though.
Yeah, I might yet change this, but mx2cc itself currently depends on this behaviour so it wont be for a while yet.
The Json parser definitely needs better error feedback! I’ve been using this to validate my json lately:
http://www.jsoneditoronline.org/
I think the default behaviour of the parser should definitely be ‘standard-valid’ as it ensures your json will work anywhere. but I’m open to the idea of adding some JsonParserFlags that allow things like extra trailing commas, comments in json etc.
Not sure what you’re trying to do there – why is TestGenericClass a method? etc…
Generic methods/functions are supported though, eg:
Monkey1234Function Min<T>:T( x:T,y:T )Return x<y ? x Else yEndYou need the ‘<T>’ after the ‘Min’ so the compiler knows that ‘x:T’ and ‘y:T’ refer to generic types, not just a type ‘T’ that might be declared elsewhere.
August 8, 2016 at 9:16 pm in reply to: Mark: OSX Crash when clicking on a button – error report included #2867Thanks, but that’s totally useless to me without some kind of ‘steps to reproduce’ description.
Actually, the ‘-c’ flag shouldn’t be in there, will remove.
Great stuff!
Had to turn flicker off pretty quickly though…
Local obj:=JsonObject.Load(‘assets/test.json’)
This loads directly from the filesystem, and will work if you’re in the right current directory, eg:
ChangeDir( ExtractDir( AssetsDir() ) ) ‘changedir to parent dir of assets dir.
Local obj:=JsonObject.Load( ‘assets/test.json’ )
But note that if you’re trying to write something that runs everywhere, assets may not even be stored in the filesystem (eg: on android they’re stored in a zip), so it’s safest to use ‘asset::’
#Import “assets/*”
This will be in the next release.
-
AuthorPosts