Forum Replies Created
-
AuthorPosts
-
I guess though it would perform as it should on Android and iOs.
But, it would be nice if it would perform great once again on macOS too.. I’d love to have a “classic computer platform” that really REALLY works without any flaws.
Time changes.. this was one year ago, what about now? should I give up on perfect 60 fps with macOS and Monkey2?
Shoulld I buy an old 2015 MacBook and keep it unupdated forever and just use Monkey1 on it for my “strange retro desires” of having a perfectly smooth computer and language? or will the Monkey2 graphics be fixed for macOS?
A stock macbook Air 2015 for instance runs the Monkey1 code 60fps without hiccups for hours.
Well if you don’t move your mouse and keyboard that is.The Monkey2 (You’re forced to use the 1.0.0.7 version bc 1.0.0.8 does not work on stock MacBook wo a xcode/macos update, and you DON’T WANT TO DO THAT YET). Monkey2 works you would think, and it does, but now and then graphical hickups comes around and hit you in the face.
I fixed it, I had missed a asset:: again.
Now to the main question, there performance of Monkey2. I tried to make the examples as similar to eachoother as I could. Compare the Monkey1 and Monkey2.
A good way to try these are on a stock new MacBook of some kind.
The Monkey1 runs perfectly smooth using for example v87e.Monkey2 does *almost* run perfectly smooth using one of the last two versions available.
Why does it not run as smooth? And what to do about it? I’m sure it’s behind the hood so its nothing I could do about it. But why does it happen?
Attachments:
Yes I’m running debug mode, I have no idea why I get the error message though?
Attachments:
“Included File exceeded size”
But I want you to see the M1 equvialent code too, so I put it here.
[/crayon]Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103[crayon-5cba911fe07b8821942199 inline="true" ]#GLFW_WINDOW_WIDTH = 1920 ' 1440#GLFW_WINDOW_HEIGHT = 1080 ' 900#GLFW_WINDOW_FULLSCREEN =TrueImport mojo2Class MyApp Extends AppField canvas:Canvas, icanvas:Canvas,scanvas:Canvas, sourcecanvas:CanvasField image:Image, sourceImage:Image, targetImage:ImageField s:Int = 4, cx:Int, d, wx:Int, wy:IntField tilemap:Int[512*512]Field size:Int=4*4' ---------------------------------------------------------------------------------------Method OnCreate()For Local y:=0 To 511For Local x:=0 To 511tilemap[x + y * 512] = Int(Rnd(127))NextNext' Create empty tilessourceImage=New Image(512,512,0,0,0) ' THISsourcecanvas = New Canvas(sourceImage)sourcecanvas.Clear 0,0,0' or load tiles '' sourceImage=Image.Load("sheet.png",0,0,0)targetImage=New Image(sourceImage.Width,sourceImage.Height,0,0,0) ' THISimage=New Image(512,512,0,0,0) ' THISImage.SetFlagsMask(Image.Managed) ' THISicanvas=New Canvas(image)scanvas=New Canvas(targetImage)canvas=New CanvasEnd' ---------------------------------------------------------------------------------------Method OnUpdate()If KeyHit(KEY_ESCAPE) Then EndAppwx=wx+2EndMethod OnRender()scanvas.Clear 0,0,0scanvas.DrawImage sourceImage,0,0 ' Instead of shader, it copies sourceImage without alteration to targetImage.scanvas.Flush()' Init canvas & imageLocal w=DeviceWidthLocal h=DeviceHeight'canvas.SetViewport 0,0,w,h'canvas.SetScissor 0,0,w,h'canvas.SetProjection2d 0,w,0,hcanvas.Clear 0,0,0'icanvas.SetViewport 0,0,w,h'icanvas.SetScissor 0,0,w,h'icanvas.SetProjection2d 0,w,0,h' Draw to image' Scroll by drawing onto itselficanvas.Clear 0,0,0icanvas.DrawImage sourceImage,0,0icanvas.DrawImage targetImage,256,256cx=(cx+2) Mod 512For Local temp:=0 To 127icanvas.DrawRect 64+temp,0,1,64,targetImage,0+temp+cx,0,1,64Next' Plot something to show how to draw to image after shader have been applied.For Local temp:=1 To 16If Int(Rnd(1)) Then icanvas.SetColor 0,0,0 Else icanvas.SetColor 1,1,1Local xx:= Int(Rnd(7))Local yy:= Int(Rnd(7))icanvas.SetColor 0,1,0icanvas.DrawRect xx*4,yy*4,2*4,2*4Nexticanvas.Flush' Draw to canvas.Local scrx:=wx Mod sizeLocal scry:=wy Mod sizeLocal mapx:=wx / sizeLocal mapy:=wy / sizeLocal cnty:= -scryFor Local y:=mapy To mapy+((h/size)+1)Local cntx:=-scrxFor Local x:=mapx To mapx+((w/size)+1)Local char:= tilemap[x + y * 512] ; Local tilex:= char & 15 ; Local tiley:= char Shr 4canvas.DrawRect cntx,cnty,size,size,image,tilex Shl 5,tiley Shl 5,32,32cntx=cntx+sizeNextcnty=cnty+sizeNextcanvas.FlushEndEnd' ---------------------------------------------------------------------------------------Function Main()New MyAppEndDid you solve this?
I made a temporary solution to save my precocious dock space, I opened up the bin folder and found the icon which apparently was the editor. I copied a png and then opened up info for that file, and pasted the png as the new icon.
Next time I opened Monkey2 I pinned it onto the dock and threw the original.
I could’ve Put the original pink icon there as well I just realised. This was just a test.One icon – one tool, I’m happy.
Attachments:
For those who are interested it runs perfectly on Lenovo Yoga2 with Android Lollipop. This is too cute, getting 1920×1200 64×64 @ 60 fps. If shaders comes equally cheap on Monkey2 then I will dare to throw MonkeyX away for good.
I’m curious to see the quality of HTML5 compiling but installing it is a real bitch so I’m giving up on that one for now.
Ops I didn’t notice the post before mine. Thanks I’ll use that instead.
Monkey2 suddenly became a very attractive productivity tool. I’ll get a heart in 3 months.
But please check into if there is some bug under the hood or not even if this seem to work.
At least now there’s an easy way to compare the two, just add additional layers and see who drops first.For anyone who wanna try it !
still to do is adding input etc, but the skeleton is working in Monkey2. It need a clean up of course.I noticed userinputs makes the window or screen a bit wobbly at times so I might check that out what you can do about that.
Feel free to use this as a banana if you find it useful.
[/crayon]Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115[crayon-5cba912002ea3989753489 inline="true" ]Namespace Myapp#Import "<std>"#Import "<mojo>"#Import "<mojo3d>"#Import "assets/"Using std..Using mojo..Const w:=1920, h:=1080Class Myapp Extends WindowField canvas:CanvasField icanvas:CanvasField scanvas:CanvasField image:ImageField sourceImage:ImageField targetImage:ImageField size:Int=8 ' try 8 16 32 64Field cx:IntField wx:IntField wy:IntField tilemap := New Int[512*512]Field s:Int = 4Method New()Super.New("Myapp", w, h, WindowFlags.Resizable)For Local y:=0 To 511For Local x:=0 To 511tilemap[x + y * 512] = Int(Rnd(127))NextNextsourceImage=Image.Load("asset::32x32sheet.png") ' 0,0,0 in Mx ! PixelFormat.RGBA8,TextureFlags.Dynamic)targetImage=New Image(sourceImage.Width,sourceImage.Height) ' ,,,0) 'MAYBE SAME AS BELOWimage=New Image(512,512,PixelFormat.RGBA8,TextureFlags.Dynamic) ' image=New Image(512,512,0,0,0) & Image.SetFlagsMask(Image.Managed)icanvas=New Canvas(image)scanvas=New Canvas(targetImage)' canvas=New Canvas() NOT NEEDED IN MONKEY2 ' image.Texture.Flags &=~ TextureFlags.FilterMipmapEnd' ---------------------------------------------------------------------------------------Method OnRender( canvas:Canvas ) OverrideApp.RequestRender()wx=wx +1 ' resize and handlers'wx=wx-s*KeyDown(KEY_LEFT)+s*KeyDown(KEY_RIGHT)'wy=wy-s*KeyDown(KEY_UP)+s*KeyDown(KEY_DOWN)'wx=Max(0,Min(10000,wx)) ' Limit wx to 0 through 10000'wy=Max(0,Min(10000,wy)) ' Limit wyx to 0 through 10000' canvas.Alpha=1.0scanvas.Clear(Color.Black) ' INSTEAD OF SHADER (just copies sourceImage to targetImage)scanvas.DrawImage(sourceImage,0,0) ' INSTEAD OF SHADER (just copies sourceImage to targetImage)scanvas.Flush() ' INSTEAD OF SHADER (just copies sourceImage to targetImage)' Init canvas & image'canvas.Viewport(0,0,w,h)'canvas.Scissor(0,0,w,h)'canvas.Projection2d(0,w,0,h)canvas.Clear(Color.Black)'icanvas.Viewport(0,0,w,h)'icanvas.Scissor(0,0,w,h)'icanvas.Projection2d(0,w,0,h)icanvas.Clear(Color.Black)' Draw to image' Scroll (by drawing onto itself)icanvas.Clear(Color.Black)icanvas.DrawImage(sourceImage,0,0)icanvas.DrawImage(targetImage,256,256)cx=(cx+2) Mod 512For Local temp:=0 To 127icanvas.DrawRect(64+temp,0,1,64,targetImage,0+temp+cx,0,1,64)Next' Plots something in the tiles (shows how to draw something to an image *after* shader have been applied)For Local temp:=1 To 16If Int(Rnd(1)) Then icanvas.Color = Color.Black Else icanvas.Color = Color.WhiteLocal xx:= Int(Rnd(7))Local yy:= Int(Rnd(7))icanvas.DrawRect(xx*4,yy*4,2*4,2*4)Nexticanvas.Flush() ' Finished drawing' Draw to canvas' Cookiecut 32x32 tiles from a 512x512 tilesheet and draw as tiles of any sizeLocal scrx:=wx Mod sizeLocal scry:=wy Mod sizeLocal mapx:=wx / sizeLocal mapy:=wy / sizeLocal cnty:= -scryFor Local y:=mapy To mapy+((h/size)+1)Local cntx:=-scrxFor Local x:=mapx To mapx+((w/size)+1)Local char:= tilemap[x + y * 512]Local tilex:= char & 15Local tiley:= char Shr 4canvas.DrawRect(cntx,cnty,size,size,image,tilex Shl 5,tiley Shl 5,32,32)cntx=cntx+sizeNextcnty=cnty+sizeNextcanvas.Flush() ' Finished drawingIf Keyboard.KeyReleased(Key.Escape) Then App.Terminate()End MethodEndFunction Main()New AppInstanceNew MyappApp.Run()End FunctionYes I did managed it by myself such victory !!
Your kidding me? haha boy do I feel stupid, 16 hours straight and I miss that.
Could you list the code because I know not yet how to use “New Int[]”?
I already include Assets the whole directory?No direct X. It’s on macOS. I’ve tried windows (OpenGL via angle) and it shows the same amazing performance there. So both are equally good. It’s the same on both platforms.
-
AuthorPosts

