diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 3441a3f316..b5079f37a5 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -4309,6 +4309,7 @@ Monkey: extensions: - ".monkey" - ".monkey2" + - ".wx" ace_mode: text tm_scope: source.monkey language_id: 236 diff --git a/samples/Monkey/effects.wx b/samples/Monkey/effects.wx new file mode 100644 index 0000000000..810583d923 --- /dev/null +++ b/samples/Monkey/effects.wx @@ -0,0 +1,107 @@ +Namespace myapp + +#Import "" +#Import "" +#Import "" + +#Import "assets/" + +Using std.. +Using mojo.. +Using mojo3d.. + +Class MyWindow Extends Window + + Field _scene:Scene + + Field _camera:Camera + + Field _light:Light + + Field _donut:Model + + Field _bloom:BloomEffect + + Field _mono:MonochromeEffect + + Field _godrays:GodraysEffect + + Field _fxaa:FXAAEffect + + Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable|WindowFlags.HighDPI ) + + Super.New( title,width,height,flags ) + + _scene=Scene.GetCurrent() + _scene.ClearColor=Color.Sky + + 'create camera + ' + _camera=New Camera( self ) + _camera.Move( 0,10,-10 ) + New FlyBehaviour( _camera ) + + 'create light + ' + _light=New Light + _light.Rotate( 120,0,0 ) + + 'create effects + ' + _godrays=New GodraysEffect + _godrays.Enabled=false + _godrays.Light=_light + + _bloom=New BloomEffect + _bloom.Enabled=False + + _mono=New MonochromeEffect + _mono.Enabled=False + + _fxaa=New FXAAEffect + _fxaa.Enabled=False + + _scene.AddPostEffect( _bloom ) + _scene.AddPostEffect( _mono ) + _scene.AddPostEffect( _godrays ) + _scene.AddPostEffect( _fxaa ) + + Local material:=New PbrMaterial( New Color( 2,.5,0,1 ),0,1 ) + + _donut=Model.CreateTorus( 2,.5,48,24,material ) + _donut.AddComponent().Speed=New Vec3f( .1,.2,.3 ) + + _donut.Move( 0,10,0 ) + End + + Method OnRender( canvas:Canvas ) Override + + RequestRender() + + If Keyboard.KeyHit( Key.Key1 ) _godrays.Enabled=Not _godrays.Enabled + If Keyboard.KeyHit( Key.Key2 ) _bloom.Enabled=Not _bloom.Enabled + If Keyboard.KeyHit( Key.Key3 ) _mono.Enabled=Not _mono.Enabled + If Keyboard.KeyHit( Key.Key4 ) _fxaa.Enabled=Not _fxaa.Enabled + + _scene.Update() + + _scene.Render( canvas ) + + canvas.DrawText( "(1) Godrays="+_godrays.Enabled,0,0 ) + canvas.DrawText( "(2) Bloom="+_bloom.Enabled,0,16 ) + canvas.DrawText( "(3) Monochrome="+_mono.Enabled,0,32 ) + canvas.DrawText( "(4) FXAA="+_fxaa.Enabled,0,48 ) + End + +End + +Function Main() + +' SetConfig( "MOJO_OPENGL_PROFILE","es" ) + + New AppInstance + + New MyWindow + + App.Run() +End diff --git a/samples/Monkey/mojotest.wx b/samples/Monkey/mojotest.wx new file mode 100644 index 0000000000..cb5a4cf032 --- /dev/null +++ b/samples/Monkey/mojotest.wx @@ -0,0 +1,96 @@ + +#Import "" +#Import "" + +#Import "assets/RedbrushAlpha.png" + +Namespace mojotest + +Using std.. +Using mojo.. + +Class MojoTest Extends Window + + Field image:Image + + Field tx:Float,ty:Float + Field r:Float=1,g:Float=1,b:Float=1 + + Method New() + + ClearColor=New Color( 0,0,.5 ) + + image=Image.Load( "asset::RedbrushAlpha.png" ) + image.Handle=New Vec2f( .5,.5 ) + End + + Method OnRender( canvas:Canvas ) Override + + App.RequestRender() + + Local sz:=Sin( Millisecs()*.0007 ) * 32 + Local sx:=32+sz,sy:=32,sw:=Width-(64+sz*2),sh:=Height-(64+sz) + + canvas.Scissor=New Recti( sx,sy,sx+sw,sy+sh ) + canvas.Clear( New Color( 1,32.0/255.0,0,1 ) ) + + canvas.PushMatrix() + + canvas.Translate( tx,ty ) + canvas.Scale( Width/640.0,Height/480.0 ) + canvas.Translate( 320,240 ) + canvas.Rotate( Millisecs()*.0003 ) + canvas.Translate( -320,-240 ) + + canvas.Color=New Color( .5,1,0 ) + canvas.DrawRect( 32,32,640-64,480-64 ) + + canvas.Color=Color.Yellow + For Local y:=0 Until 480 + For Local x:=16 Until 640 Step 32 + canvas.Alpha=Min( Abs( y-240.0 )/120.0,1.0 ) + canvas.DrawPoint( x,y ) + Next + Next + canvas.Alpha=1 + + canvas.Color=New Color( 0,.5,1 ) + canvas.DrawOval( 320,240,320-64,240-64 ) + + canvas.Color=New Color( 1,0,.5 ) + canvas.DrawLine( 32,32,640-32,480-32 ) + canvas.DrawLine( 640-32,32,32,480-32 ) + + canvas.Color=New Color( r,g,b,Sin( Millisecs()*.003 ) *.5 +.5 ) + canvas.DrawImage( image,320,240 ) + + canvas.Color=New Color( 1,0,.5 ) + canvas.DrawPoly( New Float[]( 140.0,232.0, 320.0,224.0, 500.0,232.0, 500.0,248.0, 320.0,256.0, 140.0,248.0 ) ) + + canvas.Color=New Color( 1,.5,0 ) + canvas.DrawText( "The Quick Brown Fox Jumps Over The Lazy Dog",320,240,.5,.5 ) + + canvas.PopMatrix() + + canvas.Scissor=Rect + canvas.Color=Color.Red + canvas.DrawRect( 0,0,Width,1 ) + canvas.DrawRect( Width-1,0,1,Height ) + canvas.DrawRect( 0,Height-1,Width,1 ) + canvas.DrawRect( 0,0,1,Height-1 ) + + canvas.Color=Color.Blue + + End + +End + +Function Main() + + New AppInstance + + New MojoTest + + App.Run() + +End diff --git a/samples/Monkey/particles.wx b/samples/Monkey/particles.wx new file mode 100644 index 0000000000..ada48a5b88 --- /dev/null +++ b/samples/Monkey/particles.wx @@ -0,0 +1,100 @@ +Namespace myapp + +#Import "" +#Import "" +#Import "" + +Using std.. +Using mojo.. +Using mojo3d.. + +Class MyWindow Extends Window + + Field _scene:Scene + + Field _camera:Camera + + Field _light:Light + + Field _ground:Model + + Field _particles:ParticleSystem + + Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable|WindowFlags.HighDPI ) + + Super.New( title,width,height,flags ) + + _scene=Scene.GetCurrent() + +' _scene.SkyTexture=Texture.Load( "asset::miramar-skybox.jpg",TextureFlags.FilterMipmap|TextureFlags.Cubemap ) + + _scene.FogColor=Color.Sky + _scene.FogNear=20 + _scene.FogFar=1000 + + 'create camera + ' + _camera=New Camera( Self ) + _camera.Near=.01 + _camera.Move( 0,1,-1 ) + New FlyBehaviour( _camera ) + + 'create light + ' + _light=New Light + _light.Rotate( 60,45,0 ) 'aim directional light 'down' - Pi/2=90 degrees. + + 'create ground + ' + _ground=Model.CreateBox( New Boxf( -50,-1,-50,50,0,50 ),1,1,1,New PbrMaterial( Color.Green * .5 ) ) + + _particles=New ParticleSystem( 15000 ) + _particles.RotateX( -90 ) 'point upwards! + + Local pmaterial:=_particles.Material +' pmaterial.ColorTexture=Texture.Load( "asset::bluspark.png",TextureFlags.FilterMipmap ) + + Local pbuffer:=_particles.ParticleBuffer + pbuffer.Gravity=New Vec3f( 0,-9.81,0 ) 'gravity in world space in m/s^2. + pbuffer.Duration=2.5 'how long a single particle lasts in seconds. + pbuffer.Fade=0.0 'how long before paticle starts fading out in seconds. + pbuffer.Colors=New Color[]( Color.White,Color.Yellow,Color.Orange,Color.Red ) + pbuffer.ConeAngle=30 'angle of particle emission cone. + pbuffer.MinVelocity=15.0 'min particle velocity. + pbuffer.MaxVelocity=20.0 'max particle velocity. + pbuffer.MinSize=8.0 'min particle size. + pbuffer.MaxSize=12.0 'max particle size. + + For Local an:=0 Until 360 Step 45 + + Local pivot:=New Pivot + pivot.RotateY( an ) + pivot.MoveZ( 20 ) + pivot.Visible=True + + _particles.Copy( pivot ) + Next + + End + + Method OnRender( canvas:Canvas ) Override + + RequestRender() + + _scene.Update() + + _scene.Render( canvas ) + + canvas.DrawText( "Width="+Width+", Height="+Height+", FPS="+App.FPS,0,0 ) + End + +End + +Function Main() + + New AppInstance + + New MyWindow + + App.Run() +End diff --git a/samples/Monkey/pbrspheres.wx b/samples/Monkey/pbrspheres.wx new file mode 100644 index 0000000000..37bb2aea7a --- /dev/null +++ b/samples/Monkey/pbrspheres.wx @@ -0,0 +1,87 @@ + +Namespace myapp + +#Import "" +#Import "" +#Import "" + +#Import "assets/miramar-skybox.jpg" +#Import "assets/spheres.gltf" + +Using std.. +Using mojo.. +Using mojo3d.. + +Class MyWindow Extends Window + + Field _scene:Scene + + Field _camera:Camera + + Field _light:Light + + Field _ground:Model + + Field _spheres:Model + + Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable|WindowFlags.HighDPI ) + + Super.New( title,width,height,flags ) + + _scene=New Scene + + _scene.SkyTexture=Texture.Load( "asset::miramar-skybox.jpg",TextureFlags.FilterMipmap|TextureFlags.Cubemap|TextureFlags.Envmap ) + + 'create camera + ' + _camera=New Camera( Self ) + _camera.Near=.01 + _camera.Move( 0,10,-10 ) + + New FlyBehaviour( _camera ) + + 'create light + ' + _light=New Light + _light.Rotate( 54,144,0 ) 'calibrated so specular highlight matches sun on sky texture! + + Local godrays:=New GodraysEffect( _light ) + _scene.AddPostEffect( godrays ) + + 'create ground + ' + Local mesh:=Mesh.CreateBox( New Boxf( -50,-1,-50,50,0,50 ),1,1,1 ) + + Local material:=New PbrMaterial( Color.Green,0,.5 ) + + _ground=New Model( mesh,material ) + + 'create spheres + + _spheres=Model.Load( "asset::MetalRoughSpheres.gltf" ) + + _spheres.Move( 0,10,0 ) + + End + + Method OnRender( canvas:Canvas ) Override + + RequestRender() + + _scene.Update() + + _scene.Render( canvas ) + + canvas.DrawText( "FPS="+App.FPS,Width,0,1,0 ) + End + +End + +Function Main() + + New AppInstance + + New MyWindow + + App.Run() +End diff --git a/samples/Monkey/sdl2test.wx b/samples/Monkey/sdl2test.wx new file mode 100644 index 0000000000..6b825917de --- /dev/null +++ b/samples/Monkey/sdl2test.wx @@ -0,0 +1,105 @@ + +#import "" +#Import "" + +Namespace sdl2test + +Using sdl2.. +Using opengl.. + +Class SdlWindow + + Field sdlWindow:SDL_Window Ptr + + Field sdlGLContext:SDL_GLContext + + Method New() + + SDL_Init( SDL_INIT_VIDEO ) + + libc.atexit( SDL_Quit ) + + #If __DESKTOP_TARGET__ + SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK,SDL_GL_CONTEXT_PROFILE_COMPATIBILITY ) + #Else + SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK,SDL_GL_CONTEXT_PROFILE_ES ) + #Endif + + SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION,2 ) + SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION,1 ) + SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER,1 ) + SDL_GL_SetAttribute( SDL_GL_RED_SIZE,8 ) + SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE,8 ) + SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE,8 ) + + sdlWindow=SDL_CreateWindow( "SDL2 OpenGL Window",SDL_WINDOWPOS_CENTERED,SDL_WINDOWPOS_CENTERED,640,480,SDL_WINDOW_OPENGL ) + + sdlGLContext=SDL_GL_CreateContext( sdlWindow ) + + SDL_GL_MakeCurrent( sdlWindow,sdlGLContext ) + + wxglInit() + End + + Method Run() + + Repeat + + Local event:SDL_Event + + While( SDL_PollEvent( Varptr event ) ) + + Select event.type + + Case SDL_WINDOWEVENT + + Local wevent:=Cast( Varptr event ) + + Select wevent->event + + Case SDL_WINDOWEVENT_CLOSE + + libc.exit_(0) + + End + + End + + Wend + + OnRender() + + SDL_GL_SwapWindow( sdlWindow ) + + Forever + + End + + Method OnRender() + + glClearColor( 1,1,0,1 ) + + glClear( GL_COLOR_BUFFER_BIT ) + + glEnable( GL_SCISSOR_TEST ) + + For Local y:=0 Until 256 + + glScissor( 0,y,640,1 ) + glClearColor( y/256.0,0,0,1 ) + glClear( GL_COLOR_BUFFER_BIT ) + + Next + + glDisable( GL_SCISSOR_TEST ) + End + +End + + +Function Main() + + Local window:=New SdlWindow + + window.Run() +End diff --git a/samples/Monkey/terrain.wx b/samples/Monkey/terrain.wx new file mode 100644 index 0000000000..20d9924927 --- /dev/null +++ b/samples/Monkey/terrain.wx @@ -0,0 +1,118 @@ + +Namespace myapp + +#Import "" +#Import "" +#Import "" + +#Import "assets/miramar-skybox.jpg" +#Import "assets/terrain_256.png" +#Import "assets/mossy.pbr/@/mossy.pbr" + +Using std.. +Using mojo.. +Using mojo3d.. + +Class MyWindow Extends Window + + Field _scene:Scene + + Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable|WindowFlags.HighDPI ) + + Super.New( title,width,height,flags ) + + CreateScene() + End + + Method CreateTerrain:Model() + + Local box:=New Boxf( -256,0,-256,256,32,256 ) + + Local hmap:=Pixmap.Load( "asset::terrain_256.png",PixelFormat.I8 ) + + Local material:=PbrMaterial.Load( "asset::mossy.pbr" ) + material.ScaleTextureMatrix( 64,64 ) + + 'model+mesh + Local terrain:=Model.CreateTerrain( hmap,box,material ) + terrain.CastsShadow=False + + Local collider:=New TerrainCollider( terrain ) + collider.Heightmap=hmap + collider.Bounds=box + + Local body:=New RigidBody( terrain ) + body.Mass=0 + + Return terrain + End + + Method CreateBodies() + + Local material:=New PbrMaterial( Color.Brown,1,.5 ) + + Local box:=New Boxf( -.5,.5 ) + + Local model:=Model.CreateBox( box,1,1,1,material ) + + Local collider:=model.AddComponent() + collider.Box=box + + Local body:=model.AddComponent() + + For Local i:=0 Until 360 Step 6 + + Local copy:=model.Copy() + + copy.Rotate( 0,i,0 ) + + copy.Move( 0,40+i*.1,Rnd( 5,10 ) ) + Next + + model.Destroy() + End + + Method CreateScene() + + _scene=New Scene + _scene.SkyTexture=Texture.Load( "asset::miramar-skybox.jpg",TextureFlags.FilterMipmap|TextureFlags.Cubemap ) + _scene.FogColor=New Color( .75,1,0 )*.25 + _scene.FogNear=75 + _scene.FogFar=100 + + Local camera:=New Camera( Self ) + camera.Near=.1 + camera.Far=100 + camera.Move( 0,40,0 ) + New FlyBehaviour( camera ) + + Local light:=New Light + light.CastsShadow=True + light.RotateX( 45 ) + + CreateTerrain() + + CreateBodies() + End + + Method OnRender( canvas:Canvas ) Override + + RequestRender() + + _scene.Update() + + _scene.Render( canvas ) + + canvas.DrawText( "FPS="+App.FPS,Width,0,1,0 ) + End + +End + +Function Main() + + New AppInstance + + New MyWindow + + App.Run() +End diff --git a/samples/Monkey/vec2.wx b/samples/Monkey/vec2.wx new file mode 100644 index 0000000000..915fa846e9 --- /dev/null +++ b/samples/Monkey/vec2.wx @@ -0,0 +1,26 @@ +struct Vec2 + field x:T + field y:T + + method new( x:T, y:T ) + self.x = x + self.y = y + end + + operator+:Vec2( v:Vec2 ) + return new Vec2( x + v.x, y + v.y ) + end + + operator to:string() + return "Vec2(" + x + ", " + y + ")" + end +end + +alias Vec2 Vec2f + +'main entry +function main() + local v0:= new Vec2f( 10,20 ) + local v1:= new Vec2f( 30,40 ) + print v0 + v1 +end diff --git a/samples/Monkey/viewlayout.wx b/samples/Monkey/viewlayout.wx new file mode 100644 index 0000000000..e9887c1375 --- /dev/null +++ b/samples/Monkey/viewlayout.wx @@ -0,0 +1,178 @@ +#rem + +A slightly more complicated window example. + +The example implements a resizable window with virtual resolution support via the "letterbox" and "stretch" layout modes, and shows +some simple keyboard/mouse event handling. + +#end + +Namespace test + +#Import "" +#Import "" + +Using std.. +Using mojo.. + +Class MyWindow Extends Window + + Field virtualRes:=New Vec2i( 320,240 ) + + Method New( title:String,width:Int,height:Int,flags:WindowFlags=WindowFlags.Resizable ) + + 'Call super class constructor + ' + Super.New( title,width,height,flags ) + + 'Set initial layout (this is the default for Windows). + ' + Layout="fill" + + 'Window clear color - for "letterbox" and "float" layouts, this is effectively the border color. + ' + ClearColor=Color.Black + + 'Set minimum view size + ' + MinSize=New Vec2i( 200,140 ) + + 'Set view background color. + ' + Style.BackgroundColor=Color.DarkGrey + + End + + Method OnRender( canvas:Canvas ) Override + + 'This is necessary for 'continuous' rendering. + ' + 'Without it, OnRender will only be called when necessary, eg: when window is resized. + ' + App.RequestRender() + + 'Gets mouse location in 'view' coordinates. + ' + Local mouse:=Mouse.Location + + 'Render! + ' + Local h:=canvas.Font.Height + + canvas.DrawText( "Size="+Rect.Size,0,0 ) + canvas.DrawText( "Mouse="+mouse,0,h ) + canvas.DrawText( "Layout=~q"+Layout+"~q ('L' to cycle)",0,h*2 ) + + If Layout="float" + canvas.DrawText( "Resolution="+virtualRes+" ('R' to cycle)",0,h*3 ) + canvas.DrawText( "Gravity="+Gravity+" ('G' to cycle)",0,h*4 ) + Else If Layout="letterbox" + canvas.DrawText( "Resolution="+virtualRes+" ('R' to cycle)",0,h*3 ) + canvas.DrawText( "Gravity="+Gravity+" ('G' to cycle)",0,h*4 ) + Else If Layout="stretch" + canvas.DrawText( "Resolution="+virtualRes+" ('R' to cycle)",0,h*3 ) + Endif + + canvas.DrawText( "Hello World!",Width/2,Height/2,.5,.5 ) + End + + 'Measured out view. + ' + 'This is used by the "float", "letterbox" and "stretch" layouts. + ' + Method OnMeasure:Vec2i() Override + + Return virtualRes + End + + 'Process a KeyEvent. + ' + 'Needed because there's no App.KeyHit yet! + ' + Method OnKeyEvent( event:KeyEvent ) Override + + Select event.Type + Case EventType.KeyDown + Select event.Key + Case Key.L + CycleLayout() + Case Key.G + CycleGravity() + Case Key.R + CycleVirtualRes() + End + End + + End + + 'Process a MouseEvent. + ' + 'Note: event.Location property is in 'view space' coordinates. + ' + Method OnMouseEvent( event:MouseEvent ) Override + End + + Method OnWindowEvent( event:WindowEvent ) Override + Select event.Type + Case EventType.WindowClose + Print "Window close" + App.Terminate() + Case EventType.WindowMoved + Print "Window moved to:"+Frame.Origin + Case EventType.WindowResized + Print "Window resized to:"+Frame.Size + App.RequestRender() 'note: we do this to trigger a render when window is being 'modally resized'. + End + End + + Method CycleLayout() + Select Layout + Case "fill" + Layout="letterbox" + Case "letterbox" + Layout="stretch" + Case "stretch" + Layout="float" + Case "float" + Layout="fill" + End + virtualRes=New Vec2i( 320,240 ) + Gravity=New Vec2f( .5,.5 ) + End + + Method CycleGravity() + Local gravity:=Gravity + gravity.x+=.5 + If gravity.x>1 + gravity.x=0 + gravity.y+=.5 + If gravity.y>1 gravity.y=0 + Endif + Gravity=gravity + End + + Method CycleVirtualRes() + Select virtualRes.x + Case 320 + virtualRes=New Vec2i( 640,480 ) '4:3 + Case 640 + virtualRes=New Vec2i( 1024,768 ) '4:3 + Case 1024 + virtualRes=New Vec2i( 1280,720 ) '16:9 + Case 1280 + virtualRes=New Vec2i( 1920,1080 ) '16:9 + Case 1920 + virtualRes=New Vec2i( 320,240 ) '4:3 + End + End + +End + +Function Main() + + New AppInstance + + New MyWindow( "Simple Window Demo!",640,512 ) + + App.Run() +End diff --git a/samples/Monkey/water.wx b/samples/Monkey/water.wx new file mode 100644 index 0000000000..b494a8610f --- /dev/null +++ b/samples/Monkey/water.wx @@ -0,0 +1,83 @@ +Namespace myapp + +#Import "" +#Import "" +#Import "" + +#Import "assets/miramar-skybox.jpg" +#Import "assets/water_normal0.png" +#Import "assets/water_normal1.png" + +Using std.. +Using mojo.. +Using mojo3d.. + +Class MyWindow Extends Window + + Field _scene:Scene + + Field _camera:Camera + + Field _light:Light + + Field _water:Model + + Method New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=WindowFlags.Resizable|WindowFlags.HighDPI ) + + Super.New( title,width,height,flags ) + + _scene=New Scene + + _scene.SkyTexture=Texture.Load( "asset::miramar-skybox.jpg",TextureFlags.FilterMipmap|TextureFlags.Cubemap|TextureFlags.Envmap ) + + 'create camera + ' + _camera=New Camera( self ) + _camera.Move( 0,10,-10 ) + _camera.AddComponent() + + 'create light + ' + _light=New Light + _light.Rotate( 54,144,0 ) 'calibrated so specular highlight matches sun on sky texture! + + 'create water material + ' + Local waterMaterial:=New WaterMaterial + + waterMaterial.ScaleTextureMatrix( 10,10 ) + + waterMaterial.ColorFactor=Color.SeaGreen + + waterMaterial.NormalTextures=New Texture[]( + Texture.Load( "asset::water_normal0.png",TextureFlags.WrapST|TextureFlags.FilterMipmap ), + Texture.Load( "asset::water_normal1.png",TextureFlags.WrapST|TextureFlags.FilterMipmap ) ) + + waterMaterial.Velocities=New Vec2f[]( + New Vec2f( .01,.03 ), + New Vec2f( .02,.05 ) ) + + 'create water + ' + _water=Model.CreateBox( New Boxf( -50,-1,-50,50,0,50 ),1,1,1,waterMaterial ) + End + + Method OnRender( canvas:Canvas ) Override + + RequestRender() + + _scene.Update() + + _scene.Render( canvas ) + End + +End + +Function Main() + + New AppInstance + + New MyWindow + + App.Run() +End