Forum Replies Created
-
AuthorPosts
-
Close…you’re just missing #Import “<windows.h>”, ie:
Monkey123456789101112131415#Import "<libuser32.a>"#Import "<windows.h>"ExternFunction MessageBoxA:Int (hWnd:Int, lpText:CString, lpCaption:CString, uType:Int)PublicFunction Main:Void ()MessageBoxA (Null, "Test", "Test", 0)Endwhich version statically links against openal?
Openal is lgpl licensed so it must be dynamically linked unless you’re writing gpl licensed code (I believe).
The OpenAL32.dll that ships with Ted2 is in the bin/ted2_windows dir, ditto the angle dlls and wget. I can’t see any reason why Windows 7 wouldn’t load these as they’re in the same dir as the exe that requires them and I’ve never known that to fail.
I’ve had problems in the past with accidentally linking angle and/or openal with dynamic c runtime libs (which results in the ‘msvcruntime_blah.dll’ not found error) but thought I had that sussed. Will have another look soon.
Had me going for a while there…
Fiber.Current and Fiber.Main are functions, not fibers so I need to go:
Assert( Fiber.Current()<>Fiber.Main(),…. )
I think I would rather see Fiber.GetCurrent() and Fiber.GetMain() here. Static properties are not supported, so I don’t think these should ‘look’ like properties.
Anyway, fixed the stuff in requesters.monkey2 and pushed to develop, let me know if you find any more.
Fix pushed to develop branch.
Yes, emscripten can be challenging to install!
Things are getting better though – try the instructions here:
https://github.com/juj/emsdk/blob/master/README.md
(might want to cleanup/delete existing installation).
This installs binaries for all platforms, and you shouldn’t need to install anything else like node or python (it installs them for you in private dirs).
The important bit is this once you’ve ‘installed latest’:
emsdk activate –global latest
This adds emscripten dirs to your global paths/env vars.
If you’re still having problems, you might want to ask here:
https://groups.google.com/forum/#!forum/emscripten-discuss
Or even simpler…will fix.
Monkey1234567Struct SField s:SEndFunction Main()EndAnyways, this is just speculation from my part though…
Pretty much correct. Yes, shaders will be standard glsl source code to start with, and there will be some useful ‘stock’ shaders provided.
A ‘node graph->glsl’ tool is certainly a possibility for the future, but v1.0 probably wont contain any gui tools, just the ‘backend’ for any such tools.
There’s a good chance I will write some plugins for ted2 – in mx23d – that will allow you to at least ‘view’ 3d media files though – and if there’s ever anythng like a Maplet2, this will also probably end up in the form of a Ted2 plugin.
It’s just kinda confusing, especially without any proper documentation or examples.
There’s a sample for each view type in the mojox/tests dir, but yeah, docs could be better.
Mojox is a little more complex than MaxGUI as it aims for an algorithmic layout approach instead of using ‘hard coded’ coords/sizes everywhere ala MaxGUI. This is mainly to make it easier to write GUIs that work on a wide range of devices/resolutions, but it also helps when dealing with resizable windows and dynamic themes.
Alas, there is not a great deal of variety when it comes to layout style views. It really needs something like a GridView for arranging simple tool palettes etc, a FlowView for quick ‘n’ nasty ‘add some buttons to a windows’ functionality, and likely a bunch more! DockingView is flexible, but it can be cumbersome to use in some situations.
I’ll probably be getting back into some mojox soon, but in the meantime, here’s a little GridView that might be useful for situations such as the above:
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161#Import "<std>"#Import "<mojo>"#Import "<mojox>"Using std..Using mojo..Using mojox..Class GridView Extends ViewMethod New( width:Int,height:Int )_gridw=width_gridh=heightEndMethod Clear()For Local cell:=Eachin _cellsRemoveChildView( cell.view )Next_cells.Clear()RequestRender()EndMethod AddView( view:View,x:Int,y:Int,width:Int=1,height:Int=1 )_cells.Add( New Cell( view,x,y,width,height ) )AddChildView( view )RequestRender()EndMethod ReplaceView( view:View,with:View )For Local cell:=Eachin _cellsIf cell.view<>view ContinueRemoveChildView( view )AddChildView( with )cell.view=withRequestRender()ReturnNextEndMethod RemoveView( view:View )For Local cell:=Eachin _cellsIf cell.view<>view ContinueRemoveChildView( view )_cells.Remove( cell )RequestRender()ReturnNextEndProtectedMethod OnMeasure:Vec2i() OverrideLocal maxw:=0Local maxh:=0For Local cell:=Eachin _cellsLocal size:=cell.view.MeasuredSizemaxw=Max( maxw,Int( Ceil( size.x/cell.w ) ) )maxh=Max( maxh,Int( Ceil( size.y/cell.h ) ) )NextReturn New Vec2i( maxw * _gridw,maxh * _gridh )EndMethod OnLayout() OverrideFor Local cell:=Eachin _cellsLocal x0:=cell.x * Width / _gridwLocal x1:=(cell.x+cell.w) * Width / _gridwLocal y0:=cell.y * Height / _gridwLocal y1:=(cell.y+cell.h) * Height / _gridhcell.view.Frame=New Recti( x0,y0,x1,y1 )NextEndPrivateStruct CellField view:ViewField x:IntField y:IntField w:IntField h:IntMethod New( view:View,x:Int,y:Int,w:Int,h:Int )Self.view=viewSelf.x=xSelf.y=ySelf.w=wSelf.h=hEndEndField _cellw:IntField _cellh:IntField _gridw:IntField _gridh:IntField _cells:=New Stack<Cell>EndClass MyWindow Extends WindowField mainView:GridViewField gameView:TextViewField view1:TextViewField view2:TextViewMethod New()Super.New( "GridView",640,480,WindowFlags.Resizable )gameView=New TextViewgameView.Text="GameView"Local gameViewStyle:=gameView.Style.Copy()gameViewStyle.BackgroundColor=Color.RedgameView.Style=gameViewStyleview1=New TextViewview1.Text="View1"Local view1Style:=view1.Style.Copy()view1Style.BackgroundColor=Color.Greenview1.Style=view1Styleview2=New TextViewview2.Text="View2"Local view2Style:=view2.Style.Copy()view2Style.BackgroundColor=Color.Blueview2.Style=view2StylemainView=New GridView( 8,8 ) 'create 8x8 gridmainView.AddView( gameView,0,0,8,4 ) 'top half is gameViewmainView.AddView( view1,0,4,4,4 ) 'lower left quarter is view1mainView.AddView( view2,4,4,4,4 ) 'lower right quarter is view2ContentView=mainViewEndEndFunction Main()New AppInstanceNew MyWindowApp.Run()End…that was pretty fun to write – think I’ll add this to mojox right now!
Mojox just doesn’t work.
Works fine here.
Mojox could definitely do with more layout views, like GridView, FlowView etc. These’ll happen one day, but DockingView is a very flexible alternative for now.
Wish I could spend more time on mojox, but it’s still relatively low priority…
…thanks for that Impixi, fixing now.
And BeginFullscreen isn’t even docced yet! Fixing that too…in general, if you notice something @hidden in the docs that looks like it shouldn’t be, please let me know.
This is a known issue with ted2go – the process’s it starts up to parse code are somehow preventing it from closing. I can live with this for now…
But I’ve not had this problem with other apps, eg: if I run spacechimps and terminate it by closing the window, I can’t find any instances of mx2cc_windows.exe in task manager (or conhost.exe).
Once you close the window, do you get ‘Finished debugging app.’ in ted2go ‘Output’ panel? Are the buttons on the ‘debug’ pane disabled?
I’m also on windows 10.
There’s actually a bunch of useful sample info (like length, pitch, channels etc) in the AudioData class. mojo.audio uses this internally when loading Sounds – but then it just throws the audio data away! It would of course be super convenient to keep this sample info around, even if actual sample data isn’t directly needed anymore (ie: its been transferred to openal).
Currently, mojo is designed very much around ‘one permanent window’ style game coding. Multiple windows are very untested (although the basic framework for support is in there and they will eventually happen) and yes, closing window=closing app, something that will also change in future.
handling changing resolutions?
The Window.BeginFullscreen() and Window.EndFullscreen() methods allow you to dynamically enter/leave fullscreen mode at runtime. With no params, BeginFullscreen enters ‘desktop mode’ fullscreen, or you can specify width,height,hertz to actually change display mode. Note you can also provide a virtual resolution via OnMeasure:Vec2i() so desktop mode fullscreen is often fine.
See bananas/spacehimps for a demo of Alt-Enter fullscreen toggling. See bananas/viewlayout for a demo of virtual resolution.
There’s still no way to enum display modes cleanly though (excluding SDL) – coming soon-ish.
To manually change position/size of a window (in ‘desktop’ coords) use the Window.Frame property.
In general, avoid using SDL_* calls if there’s a ‘mojo’ way to do something. SDL_Resize will probably work, but only because mojo currently polls window size for the sake of some platforms. I’d rather not expose this level of mesiness though (ie: In future it may not, or it may not on some platforms etc) so if there’s mojo way to do something, please use that as it should be ‘just work’. And if it doesn’t, or mojo doesn’t have some feature you’re having to resort to SDL for, let me know or better, post an issue at github.
Currently, Audio/Sound classes are pretty bare, and yes, you can really just Play,Pause and Stop right now.
But openal is pretty grunty so the situation can certainly be improved. I’ll see what I can come up with, but I’m sort of guessing what people want (play, pause and stop are fine for me!) so please also post specific feature requests to github issues.
Weird, haven’t seen that before.
Are you using ted2 or ted2go? What version?
How are you terminating the app? By closing the window or with debug ‘stop’ button or something else?
-
AuthorPosts