├── .gitignore ├── .gitmodules ├── .hlint.yaml ├── .travis.yml ├── .vscode └── tasks.json ├── LICENSE ├── README.md ├── Setup.hs ├── cbits └── util.h ├── classgen ├── README.md ├── app-classgen │ └── Main.hs ├── default.nix ├── godot-haskell-classgen.cabal ├── package.yaml ├── release.nix ├── src-classgen │ └── Classgen │ │ ├── Docs.hs │ │ ├── Module.hs │ │ ├── Spec.hs │ │ └── Utils.hs ├── stack.yaml └── stack.yaml.lock ├── default.nix ├── examples ├── dodge-the-creeps │ ├── .gitignore │ ├── ChangeLog.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── Support.hs │ ├── ffi │ │ ├── cbits │ │ │ └── flib.c │ │ └── flib │ │ │ └── FLib.hs │ ├── game │ │ ├── HUD.gdns │ │ ├── HUD.tres │ │ ├── HUD.tscn │ │ ├── Main.gdns │ │ ├── Main.tscn │ │ ├── Mob.gdns │ │ ├── Mob.tscn │ │ ├── Player.gdns │ │ ├── Player.tscn │ │ ├── dodge_assets │ │ │ ├── art │ │ │ │ ├── House In a Forest Loop.ogg │ │ │ │ ├── enemyFlyingAlt_1.png │ │ │ │ ├── enemyFlyingAlt_2.png │ │ │ │ ├── enemySwimming_1.png │ │ │ │ ├── enemySwimming_2.png │ │ │ │ ├── enemyWalking_1.png │ │ │ │ ├── enemyWalking_2.png │ │ │ │ ├── gameover.wav │ │ │ │ ├── playerGrey_up1.png │ │ │ │ ├── playerGrey_up2.png │ │ │ │ ├── playerGrey_walk1.png │ │ │ │ └── playerGrey_walk2.png │ │ │ └── fonts │ │ │ │ ├── FONTLOG.txt │ │ │ │ ├── LICENSE.txt │ │ │ │ └── Xolonium-Regular.ttf │ │ ├── lib │ │ │ └── libmyproject.gdnlib │ │ └── project.godot │ ├── godot-haskell.nix │ ├── hie.yaml │ ├── myproject.cabal │ ├── package.yaml │ ├── pinned-nixpkgs.nix │ ├── shell.nix │ ├── src │ │ ├── Game │ │ │ ├── HUD.hs │ │ │ ├── Main.hs │ │ │ ├── Mob.hs │ │ │ └── Player.hs │ │ ├── Lib.hs │ │ └── Project │ │ │ ├── Requirements.hs │ │ │ ├── Scenes.hs │ │ │ ├── Scenes │ │ │ ├── HUD.hs │ │ │ ├── Main.hs │ │ │ ├── Mob.hs │ │ │ └── Player.hs │ │ │ └── Support.hs │ ├── stack-shell.nix │ ├── stack.yaml │ └── stack.yaml.lock ├── rss-reader │ ├── .gitignore │ ├── ChangeLog.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── Support.hs │ ├── ffi │ │ ├── cbits │ │ │ └── flib.c │ │ └── flib │ │ │ └── FLib.hs │ ├── game │ │ ├── Rss_reader.gdns │ │ ├── Rss_reader.tscn │ │ ├── export_presets.cfg │ │ ├── lib │ │ │ └── libmyproject.gdnlib │ │ └── project.godot │ ├── godot-haskell.nix │ ├── hie.yaml │ ├── myproject.cabal │ ├── package.yaml │ ├── pinned-nixpkgs.nix │ ├── shell.nix │ ├── src │ │ ├── Game │ │ │ ├── RSSReader.hs │ │ │ └── q │ │ ├── Lib.hs │ │ └── Project │ │ │ ├── Requirements.hs │ │ │ ├── Scenes.hs │ │ │ ├── Scenes │ │ │ └── Rss_reader.hs │ │ │ └── Support.hs │ ├── stack-shell.nix │ ├── stack.yaml │ └── stack.yaml.lock └── top-down-ten-minutes │ ├── .gitignore │ ├── ChangeLog.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── ffi │ ├── cbits │ │ └── flib.c │ └── flib │ │ └── FLib.hs │ ├── game │ ├── Bullet.gdns │ ├── Bullet.tscn │ ├── Enemy.gdns │ ├── Enemy.tscn │ ├── Explosion.tscn │ ├── Player.gdns │ ├── Player.png │ ├── lib │ │ └── libtop-down-ten-minutes.gdnlib │ ├── project.godot │ ├── spotlight.png │ ├── wall.tres │ └── world.tscn │ ├── godot-haskell.nix │ ├── hie.yaml │ ├── package.yaml │ ├── pinned-nixpkgs.nix │ ├── shell.nix │ ├── src │ ├── Game │ │ └── World.hs │ ├── Lib.hs │ └── Project │ │ ├── Requirements.hs │ │ ├── Scenes.hs │ │ ├── Scenes │ │ ├── Bullet.hs │ │ ├── Enemy.hs │ │ ├── Explosion.hs │ │ └── World.hs │ │ └── Support.hs │ ├── stack-shell.nix │ ├── stack.yaml │ ├── stack.yaml.lock │ └── top-down-ten-minutes.cabal ├── godot-haskell.cabal ├── hie.yaml ├── nix ├── pinned │ ├── all-hies.json │ ├── default.nix │ ├── hie.nix │ └── nixpkgs.json └── spacemacs-hie.nix ├── nixpkgs-version.json ├── package.yaml ├── pinned-nixpkgs.nix ├── project-generator └── Main.hs ├── release.nix ├── shell-spacemacs-hie.nix ├── shell.nix ├── src-generate ├── Generate.hs ├── Spec.hs ├── Types.hs └── Types │ └── Internal.hs ├── src ├── Godot.hs └── Godot │ ├── Api.hs │ ├── Api │ └── Types.hs │ ├── Core │ ├── ARVRAnchor.hs │ ├── ARVRCamera.hs │ ├── ARVRController.hs │ ├── ARVRInterface.hs │ ├── ARVRInterfaceGDNative.hs │ ├── ARVROrigin.hs │ ├── ARVRPositionalTracker.hs │ ├── ARVRServer.hs │ ├── AStar.hs │ ├── AStar2D.hs │ ├── AcceptDialog.hs │ ├── AnimatedSprite.hs │ ├── AnimatedSprite3D.hs │ ├── AnimatedTexture.hs │ ├── Animation.hs │ ├── AnimationNode.hs │ ├── AnimationNodeAdd2.hs │ ├── AnimationNodeAdd3.hs │ ├── AnimationNodeAnimation.hs │ ├── AnimationNodeBlend2.hs │ ├── AnimationNodeBlend3.hs │ ├── AnimationNodeBlendSpace1D.hs │ ├── AnimationNodeBlendSpace2D.hs │ ├── AnimationNodeBlendTree.hs │ ├── AnimationNodeOneShot.hs │ ├── AnimationNodeOutput.hs │ ├── AnimationNodeStateMachine.hs │ ├── AnimationNodeStateMachinePlayback.hs │ ├── AnimationNodeStateMachineTransition.hs │ ├── AnimationNodeTimeScale.hs │ ├── AnimationNodeTimeSeek.hs │ ├── AnimationNodeTransition.hs │ ├── AnimationPlayer.hs │ ├── AnimationRootNode.hs │ ├── AnimationTree.hs │ ├── AnimationTreePlayer.hs │ ├── Area.hs │ ├── Area2D.hs │ ├── ArrayMesh.hs │ ├── AtlasTexture.hs │ ├── AudioBusLayout.hs │ ├── AudioEffect.hs │ ├── AudioEffectAmplify.hs │ ├── AudioEffectBandLimitFilter.hs │ ├── AudioEffectBandPassFilter.hs │ ├── AudioEffectChorus.hs │ ├── AudioEffectCompressor.hs │ ├── AudioEffectDelay.hs │ ├── AudioEffectDistortion.hs │ ├── AudioEffectEQ.hs │ ├── AudioEffectEQ10.hs │ ├── AudioEffectEQ21.hs │ ├── AudioEffectEQ6.hs │ ├── AudioEffectFilter.hs │ ├── AudioEffectHighPassFilter.hs │ ├── AudioEffectHighShelfFilter.hs │ ├── AudioEffectInstance.hs │ ├── AudioEffectLimiter.hs │ ├── AudioEffectLowPassFilter.hs │ ├── AudioEffectLowShelfFilter.hs │ ├── AudioEffectNotchFilter.hs │ ├── AudioEffectPanner.hs │ ├── AudioEffectPhaser.hs │ ├── AudioEffectPitchShift.hs │ ├── AudioEffectRecord.hs │ ├── AudioEffectReverb.hs │ ├── AudioEffectSpectrumAnalyzer.hs │ ├── AudioEffectSpectrumAnalyzerInstance.hs │ ├── AudioEffectStereoEnhance.hs │ ├── AudioServer.hs │ ├── AudioStream.hs │ ├── AudioStreamGenerator.hs │ ├── AudioStreamGeneratorPlayback.hs │ ├── AudioStreamMicrophone.hs │ ├── AudioStreamOGGVorbis.hs │ ├── AudioStreamPlayback.hs │ ├── AudioStreamPlaybackResampled.hs │ ├── AudioStreamPlayer.hs │ ├── AudioStreamPlayer2D.hs │ ├── AudioStreamPlayer3D.hs │ ├── AudioStreamRandomPitch.hs │ ├── AudioStreamSample.hs │ ├── BackBufferCopy.hs │ ├── BakedLightmap.hs │ ├── BakedLightmapData.hs │ ├── BaseButton.hs │ ├── BitMap.hs │ ├── BitmapFont.hs │ ├── Bone2D.hs │ ├── BoneAttachment.hs │ ├── BoxContainer.hs │ ├── BoxShape.hs │ ├── BulletPhysicsDirectBodyState.hs │ ├── BulletPhysicsServer.hs │ ├── Button.hs │ ├── ButtonGroup.hs │ ├── CPUParticles.hs │ ├── CPUParticles2D.hs │ ├── CSGBox.hs │ ├── CSGCombiner.hs │ ├── CSGCylinder.hs │ ├── CSGMesh.hs │ ├── CSGPolygon.hs │ ├── CSGPrimitive.hs │ ├── CSGShape.hs │ ├── CSGSphere.hs │ ├── CSGTorus.hs │ ├── Camera.hs │ ├── Camera2D.hs │ ├── CameraFeed.hs │ ├── CameraServer.hs │ ├── CameraTexture.hs │ ├── CanvasItem.hs │ ├── CanvasItemMaterial.hs │ ├── CanvasLayer.hs │ ├── CanvasModulate.hs │ ├── CapsuleMesh.hs │ ├── CapsuleShape.hs │ ├── CapsuleShape2D.hs │ ├── CenterContainer.hs │ ├── CharFXTransform.hs │ ├── CheckBox.hs │ ├── CheckButton.hs │ ├── CircleShape2D.hs │ ├── ClassDB.hs │ ├── ClippedCamera.hs │ ├── CollisionObject.hs │ ├── CollisionObject2D.hs │ ├── CollisionPolygon.hs │ ├── CollisionPolygon2D.hs │ ├── CollisionShape.hs │ ├── CollisionShape2D.hs │ ├── ColorPicker.hs │ ├── ColorPickerButton.hs │ ├── ColorRect.hs │ ├── ConcavePolygonShape.hs │ ├── ConcavePolygonShape2D.hs │ ├── ConeTwistJoint.hs │ ├── ConfigFile.hs │ ├── ConfirmationDialog.hs │ ├── Container.hs │ ├── Control.hs │ ├── ConvexPolygonShape.hs │ ├── ConvexPolygonShape2D.hs │ ├── Crypto.hs │ ├── CryptoKey.hs │ ├── CubeMap.hs │ ├── CubeMesh.hs │ ├── Curve.hs │ ├── Curve2D.hs │ ├── Curve3D.hs │ ├── CurveTexture.hs │ ├── CylinderMesh.hs │ ├── CylinderShape.hs │ ├── DampedSpringJoint2D.hs │ ├── DirectionalLight.hs │ ├── Directory.hs │ ├── DynamicFont.hs │ ├── DynamicFontData.hs │ ├── EncodedObjectAsID.hs │ ├── Engine.hs │ ├── Environment.hs │ ├── Expression.hs │ ├── File.hs │ ├── FileDialog.hs │ ├── Font.hs │ ├── FuncRef.hs │ ├── GDNative.hs │ ├── GDNativeLibrary.hs │ ├── GDScript.hs │ ├── GDScriptFunctionState.hs │ ├── GIProbe.hs │ ├── GIProbeData.hs │ ├── Generic6DOFJoint.hs │ ├── Geometry.hs │ ├── GeometryInstance.hs │ ├── GlobalConstants.hs │ ├── Gradient.hs │ ├── GradientTexture.hs │ ├── GraphEdit.hs │ ├── GraphNode.hs │ ├── GridContainer.hs │ ├── GridMap.hs │ ├── GrooveJoint2D.hs │ ├── HBoxContainer.hs │ ├── HScrollBar.hs │ ├── HSeparator.hs │ ├── HSlider.hs │ ├── HSplitContainer.hs │ ├── HTTPClient.hs │ ├── HTTPRequest.hs │ ├── HashingContext.hs │ ├── HeightMapShape.hs │ ├── HingeJoint.hs │ ├── IP.hs │ ├── IP_Unix.hs │ ├── Image.hs │ ├── ImageTexture.hs │ ├── ImmediateGeometry.hs │ ├── Input.hs │ ├── InputDefault.hs │ ├── InputEvent.hs │ ├── InputEventAction.hs │ ├── InputEventGesture.hs │ ├── InputEventJoypadButton.hs │ ├── InputEventJoypadMotion.hs │ ├── InputEventKey.hs │ ├── InputEventMIDI.hs │ ├── InputEventMagnifyGesture.hs │ ├── InputEventMouse.hs │ ├── InputEventMouseButton.hs │ ├── InputEventMouseMotion.hs │ ├── InputEventPanGesture.hs │ ├── InputEventScreenDrag.hs │ ├── InputEventScreenTouch.hs │ ├── InputEventWithModifiers.hs │ ├── InputMap.hs │ ├── InstancePlaceholder.hs │ ├── InterpolatedCamera.hs │ ├── ItemList.hs │ ├── JSON.hs │ ├── JSONParseResult.hs │ ├── JSONRPC.hs │ ├── JavaClass.hs │ ├── JavaClassWrapper.hs │ ├── JavaScript.hs │ ├── Joint.hs │ ├── Joint2D.hs │ ├── KinematicBody.hs │ ├── KinematicBody2D.hs │ ├── KinematicCollision.hs │ ├── KinematicCollision2D.hs │ ├── Label.hs │ ├── LargeTexture.hs │ ├── Light.hs │ ├── Light2D.hs │ ├── LightOccluder2D.hs │ ├── Line2D.hs │ ├── LineEdit.hs │ ├── LineShape2D.hs │ ├── LinkButton.hs │ ├── Listener.hs │ ├── MainLoop.hs │ ├── MarginContainer.hs │ ├── Marshalls.hs │ ├── Material.hs │ ├── MenuButton.hs │ ├── Mesh.hs │ ├── MeshDataTool.hs │ ├── MeshInstance.hs │ ├── MeshInstance2D.hs │ ├── MeshLibrary.hs │ ├── MeshTexture.hs │ ├── MobileVRInterface.hs │ ├── MultiMesh.hs │ ├── MultiMeshInstance.hs │ ├── MultiMeshInstance2D.hs │ ├── MultiplayerAPI.hs │ ├── MultiplayerPeerGDNative.hs │ ├── Mutex.hs │ ├── NativeScript.hs │ ├── Navigation.hs │ ├── Navigation2D.hs │ ├── NavigationMesh.hs │ ├── NavigationMeshInstance.hs │ ├── NavigationPolygon.hs │ ├── NavigationPolygonInstance.hs │ ├── NetworkedMultiplayerENet.hs │ ├── NetworkedMultiplayerPeer.hs │ ├── NinePatchRect.hs │ ├── Node.hs │ ├── Node2D.hs │ ├── NoiseTexture.hs │ ├── OS.hs │ ├── Object.hs │ ├── OccluderPolygon2D.hs │ ├── OmniLight.hs │ ├── OpenSimplexNoise.hs │ ├── OptionButton.hs │ ├── PCKPacker.hs │ ├── PHashTranslation.hs │ ├── PackedDataContainer.hs │ ├── PackedDataContainerRef.hs │ ├── PackedScene.hs │ ├── PacketPeer.hs │ ├── PacketPeerGDNative.hs │ ├── PacketPeerStream.hs │ ├── PacketPeerUDP.hs │ ├── Panel.hs │ ├── PanelContainer.hs │ ├── PanoramaSky.hs │ ├── ParallaxBackground.hs │ ├── ParallaxLayer.hs │ ├── Particles.hs │ ├── Particles2D.hs │ ├── ParticlesMaterial.hs │ ├── Path.hs │ ├── Path2D.hs │ ├── PathFollow.hs │ ├── PathFollow2D.hs │ ├── Performance.hs │ ├── PhysicalBone.hs │ ├── Physics2DDirectBodyState.hs │ ├── Physics2DDirectBodyStateSW.hs │ ├── Physics2DDirectSpaceState.hs │ ├── Physics2DServer.hs │ ├── Physics2DServerSW.hs │ ├── Physics2DShapeQueryParameters.hs │ ├── Physics2DShapeQueryResult.hs │ ├── Physics2DTestMotionResult.hs │ ├── PhysicsBody.hs │ ├── PhysicsBody2D.hs │ ├── PhysicsDirectBodyState.hs │ ├── PhysicsDirectSpaceState.hs │ ├── PhysicsMaterial.hs │ ├── PhysicsServer.hs │ ├── PhysicsShapeQueryParameters.hs │ ├── PhysicsShapeQueryResult.hs │ ├── PinJoint.hs │ ├── PinJoint2D.hs │ ├── PlaneMesh.hs │ ├── PlaneShape.hs │ ├── PluginScript.hs │ ├── PointMesh.hs │ ├── Polygon2D.hs │ ├── PolygonPathFinder.hs │ ├── Popup.hs │ ├── PopupDialog.hs │ ├── PopupMenu.hs │ ├── PopupPanel.hs │ ├── Position2D.hs │ ├── Position3D.hs │ ├── PrimitiveMesh.hs │ ├── PrismMesh.hs │ ├── ProceduralSky.hs │ ├── ProgressBar.hs │ ├── ProjectSettings.hs │ ├── ProximityGroup.hs │ ├── ProxyTexture.hs │ ├── QuadMesh.hs │ ├── RandomNumberGenerator.hs │ ├── Range.hs │ ├── RayCast.hs │ ├── RayCast2D.hs │ ├── RayShape.hs │ ├── RayShape2D.hs │ ├── RectangleShape2D.hs │ ├── Reference.hs │ ├── ReferenceRect.hs │ ├── ReflectionProbe.hs │ ├── RegEx.hs │ ├── RegExMatch.hs │ ├── RemoteTransform.hs │ ├── RemoteTransform2D.hs │ ├── Resource.hs │ ├── ResourceFormatLoader.hs │ ├── ResourceFormatLoaderCrypto.hs │ ├── ResourceFormatSaver.hs │ ├── ResourceFormatSaverCrypto.hs │ ├── ResourceImporter.hs │ ├── ResourceInteractiveLoader.hs │ ├── ResourceLoader.hs │ ├── ResourcePreloader.hs │ ├── ResourceSaver.hs │ ├── RichTextEffect.hs │ ├── RichTextLabel.hs │ ├── RigidBody.hs │ ├── RigidBody2D.hs │ ├── RootMotionView.hs │ ├── SceneState.hs │ ├── SceneTree.hs │ ├── SceneTreeTimer.hs │ ├── Script.hs │ ├── ScrollBar.hs │ ├── ScrollContainer.hs │ ├── SegmentShape2D.hs │ ├── Semaphore.hs │ ├── Separator.hs │ ├── Shader.hs │ ├── ShaderMaterial.hs │ ├── Shape.hs │ ├── Shape2D.hs │ ├── ShortCut.hs │ ├── Skeleton.hs │ ├── Skeleton2D.hs │ ├── SkeletonIK.hs │ ├── Skin.hs │ ├── SkinReference.hs │ ├── Sky.hs │ ├── Slider.hs │ ├── SliderJoint.hs │ ├── SoftBody.hs │ ├── Spatial.hs │ ├── SpatialGizmo.hs │ ├── SpatialMaterial.hs │ ├── SpatialVelocityTracker.hs │ ├── SphereMesh.hs │ ├── SphereShape.hs │ ├── SpinBox.hs │ ├── SplitContainer.hs │ ├── SpotLight.hs │ ├── SpringArm.hs │ ├── Sprite.hs │ ├── Sprite3D.hs │ ├── SpriteBase3D.hs │ ├── SpriteFrames.hs │ ├── StaticBody.hs │ ├── StaticBody2D.hs │ ├── StreamPeer.hs │ ├── StreamPeerBuffer.hs │ ├── StreamPeerGDNative.hs │ ├── StreamPeerSSL.hs │ ├── StreamPeerTCP.hs │ ├── StreamTexture.hs │ ├── StyleBox.hs │ ├── StyleBoxEmpty.hs │ ├── StyleBoxFlat.hs │ ├── StyleBoxLine.hs │ ├── StyleBoxTexture.hs │ ├── SurfaceTool.hs │ ├── TCP_Server.hs │ ├── TabContainer.hs │ ├── Tabs.hs │ ├── TextEdit.hs │ ├── TextFile.hs │ ├── Texture.hs │ ├── Texture3D.hs │ ├── TextureArray.hs │ ├── TextureButton.hs │ ├── TextureLayered.hs │ ├── TextureProgress.hs │ ├── TextureRect.hs │ ├── Theme.hs │ ├── Thread.hs │ ├── TileMap.hs │ ├── TileSet.hs │ ├── Timer.hs │ ├── ToolButton.hs │ ├── TouchScreenButton.hs │ ├── Translation.hs │ ├── TranslationServer.hs │ ├── Tree.hs │ ├── TreeItem.hs │ ├── TriangleMesh.hs │ ├── Tween.hs │ ├── UPNP.hs │ ├── UPNPDevice.hs │ ├── UndoRedo.hs │ ├── VBoxContainer.hs │ ├── VScrollBar.hs │ ├── VSeparator.hs │ ├── VSlider.hs │ ├── VSplitContainer.hs │ ├── VehicleBody.hs │ ├── VehicleWheel.hs │ ├── VideoPlayer.hs │ ├── VideoStream.hs │ ├── VideoStreamGDNative.hs │ ├── VideoStreamTheora.hs │ ├── VideoStreamWebm.hs │ ├── Viewport.hs │ ├── ViewportContainer.hs │ ├── ViewportTexture.hs │ ├── VisibilityEnabler.hs │ ├── VisibilityEnabler2D.hs │ ├── VisibilityNotifier.hs │ ├── VisibilityNotifier2D.hs │ ├── VisualInstance.hs │ ├── VisualScript.hs │ ├── VisualScriptBasicTypeConstant.hs │ ├── VisualScriptBuiltinFunc.hs │ ├── VisualScriptClassConstant.hs │ ├── VisualScriptComment.hs │ ├── VisualScriptComposeArray.hs │ ├── VisualScriptCondition.hs │ ├── VisualScriptConstant.hs │ ├── VisualScriptConstructor.hs │ ├── VisualScriptCustomNode.hs │ ├── VisualScriptDeconstruct.hs │ ├── VisualScriptEmitSignal.hs │ ├── VisualScriptEngineSingleton.hs │ ├── VisualScriptExpression.hs │ ├── VisualScriptFunction.hs │ ├── VisualScriptFunctionCall.hs │ ├── VisualScriptFunctionState.hs │ ├── VisualScriptGlobalConstant.hs │ ├── VisualScriptIndexGet.hs │ ├── VisualScriptIndexSet.hs │ ├── VisualScriptInputAction.hs │ ├── VisualScriptIterator.hs │ ├── VisualScriptLists.hs │ ├── VisualScriptLocalVar.hs │ ├── VisualScriptLocalVarSet.hs │ ├── VisualScriptMathConstant.hs │ ├── VisualScriptNode.hs │ ├── VisualScriptOperator.hs │ ├── VisualScriptPreload.hs │ ├── VisualScriptPropertyGet.hs │ ├── VisualScriptPropertySet.hs │ ├── VisualScriptResourcePath.hs │ ├── VisualScriptReturn.hs │ ├── VisualScriptSceneNode.hs │ ├── VisualScriptSceneTree.hs │ ├── VisualScriptSelect.hs │ ├── VisualScriptSelf.hs │ ├── VisualScriptSequence.hs │ ├── VisualScriptSubCall.hs │ ├── VisualScriptSwitch.hs │ ├── VisualScriptTypeCast.hs │ ├── VisualScriptVariableGet.hs │ ├── VisualScriptVariableSet.hs │ ├── VisualScriptWhile.hs │ ├── VisualScriptYield.hs │ ├── VisualScriptYieldSignal.hs │ ├── VisualServer.hs │ ├── VisualShader.hs │ ├── VisualShaderNode.hs │ ├── VisualShaderNodeBooleanConstant.hs │ ├── VisualShaderNodeBooleanUniform.hs │ ├── VisualShaderNodeColorConstant.hs │ ├── VisualShaderNodeColorFunc.hs │ ├── VisualShaderNodeColorOp.hs │ ├── VisualShaderNodeColorUniform.hs │ ├── VisualShaderNodeCompare.hs │ ├── VisualShaderNodeCubeMap.hs │ ├── VisualShaderNodeCubeMapUniform.hs │ ├── VisualShaderNodeCustom.hs │ ├── VisualShaderNodeDeterminant.hs │ ├── VisualShaderNodeDotProduct.hs │ ├── VisualShaderNodeExpression.hs │ ├── VisualShaderNodeFaceForward.hs │ ├── VisualShaderNodeFresnel.hs │ ├── VisualShaderNodeGlobalExpression.hs │ ├── VisualShaderNodeGroupBase.hs │ ├── VisualShaderNodeIf.hs │ ├── VisualShaderNodeInput.hs │ ├── VisualShaderNodeIs.hs │ ├── VisualShaderNodeOuterProduct.hs │ ├── VisualShaderNodeOutput.hs │ ├── VisualShaderNodeScalarClamp.hs │ ├── VisualShaderNodeScalarConstant.hs │ ├── VisualShaderNodeScalarDerivativeFunc.hs │ ├── VisualShaderNodeScalarFunc.hs │ ├── VisualShaderNodeScalarInterp.hs │ ├── VisualShaderNodeScalarOp.hs │ ├── VisualShaderNodeScalarSmoothStep.hs │ ├── VisualShaderNodeScalarSwitch.hs │ ├── VisualShaderNodeScalarUniform.hs │ ├── VisualShaderNodeSwitch.hs │ ├── VisualShaderNodeTexture.hs │ ├── VisualShaderNodeTextureUniform.hs │ ├── VisualShaderNodeTextureUniformTriplanar.hs │ ├── VisualShaderNodeTransformCompose.hs │ ├── VisualShaderNodeTransformConstant.hs │ ├── VisualShaderNodeTransformDecompose.hs │ ├── VisualShaderNodeTransformFunc.hs │ ├── VisualShaderNodeTransformMult.hs │ ├── VisualShaderNodeTransformUniform.hs │ ├── VisualShaderNodeTransformVecMult.hs │ ├── VisualShaderNodeUniform.hs │ ├── VisualShaderNodeVec3Constant.hs │ ├── VisualShaderNodeVec3Uniform.hs │ ├── VisualShaderNodeVectorClamp.hs │ ├── VisualShaderNodeVectorCompose.hs │ ├── VisualShaderNodeVectorDecompose.hs │ ├── VisualShaderNodeVectorDerivativeFunc.hs │ ├── VisualShaderNodeVectorDistance.hs │ ├── VisualShaderNodeVectorFunc.hs │ ├── VisualShaderNodeVectorInterp.hs │ ├── VisualShaderNodeVectorLen.hs │ ├── VisualShaderNodeVectorOp.hs │ ├── VisualShaderNodeVectorRefract.hs │ ├── VisualShaderNodeVectorScalarMix.hs │ ├── VisualShaderNodeVectorScalarSmoothStep.hs │ ├── VisualShaderNodeVectorScalarStep.hs │ ├── VisualShaderNodeVectorSmoothStep.hs │ ├── WeakRef.hs │ ├── WebRTCDataChannel.hs │ ├── WebRTCDataChannelGDNative.hs │ ├── WebRTCMultiplayer.hs │ ├── WebRTCPeerConnection.hs │ ├── WebRTCPeerConnectionGDNative.hs │ ├── WebSocketClient.hs │ ├── WebSocketMultiplayerPeer.hs │ ├── WebSocketPeer.hs │ ├── WebSocketServer.hs │ ├── WindowDialog.hs │ ├── World.hs │ ├── World2D.hs │ ├── WorldEnvironment.hs │ ├── X509Certificate.hs │ ├── XMLParser.hs │ └── YSort.hs │ ├── Gdnative.hs │ ├── Gdnative │ ├── Internal.hs │ └── Internal │ │ ├── Api.hs │ │ ├── Gdnative.chs │ │ ├── TH.hs │ │ └── Types.hs │ ├── Internal │ └── Dispatch.hs │ ├── Nativescript.hs │ └── Tools │ ├── AnimationTrackEditPlugin.hs │ ├── EditorExportPlugin.hs │ ├── EditorFeatureProfile.hs │ ├── EditorFileDialog.hs │ ├── EditorFileSystem.hs │ ├── EditorFileSystemDirectory.hs │ ├── EditorImportPlugin.hs │ ├── EditorInspector.hs │ ├── EditorInspectorPlugin.hs │ ├── EditorInterface.hs │ ├── EditorNavigationMeshGenerator.hs │ ├── EditorPlugin.hs │ ├── EditorProperty.hs │ ├── EditorResourceConversionPlugin.hs │ ├── EditorResourcePreview.hs │ ├── EditorResourcePreviewGenerator.hs │ ├── EditorSceneImporter.hs │ ├── EditorSceneImporterAssimp.hs │ ├── EditorScenePostImport.hs │ ├── EditorScript.hs │ ├── EditorSelection.hs │ ├── EditorSettings.hs │ ├── EditorSpatialGizmo.hs │ ├── EditorSpatialGizmoPlugin.hs │ ├── EditorSpinSlider.hs │ ├── EditorVCSInterface.hs │ ├── ScriptCreateDialog.hs │ ├── ScriptEditor.hs │ └── VisualScriptEditor.hs ├── stack-shell.nix ├── stack.yaml ├── stack.yaml.lock ├── template ├── README.md ├── demo │ ├── Makefile │ ├── ffi │ │ └── cbits │ │ │ └── flib.c │ └── game │ │ ├── Main.gdns │ │ ├── lib │ │ └── libdemo.gdnlib │ │ └── project.godot ├── godot-haskell.hsfiles ├── mkdemo.sh └── update-template.sh └── update-nixpkgs.sh /.gitignore: -------------------------------------------------------------------------------- 1 | dist* 2 | *.hi 3 | *.o 4 | .hsenv* 5 | cabal-dev/ 6 | .stack-work/ 7 | .cabal-sandbox 8 | cabal.sandbox.config 9 | .DS_Store 10 | *.dyn_o 11 | *.dyn_hi 12 | app/*.cpp 13 | src/**/*.cpp 14 | src/**/*.c 15 | *.so 16 | .ghc* 17 | #* 18 | .#* 19 | 20 | doc/build/ 21 | 22 | # osvr_server 23 | lighthousedb.json 24 | lhr-*/ 25 | 26 | # emacs TAG file 27 | TAGS 28 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "godot_headers"] 2 | path = godot_headers 3 | url = https://github.com/GodotNativeTools/godot_headers/ 4 | [submodule "haskell-src-exts-qq"] 5 | path = haskell-src-exts-qq 6 | url = https://github.com/KaneTW/haskell-src-exts-qq 7 | [submodule "haskell-src-exts-sc"] 8 | path = haskell-src-exts-sc 9 | url = https://github.com/achirkin/haskell-src-exts-sc 10 | -------------------------------------------------------------------------------- /.hlint.yaml: -------------------------------------------------------------------------------- 1 | - ignore: { name: "Use camelCase" } 2 | - ignore: { name: "Use newtype instead of data" } 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # https://docs.haskellstack.org/en/stable/travis_ci/ 2 | 3 | sudo: false 4 | dist: bionic 5 | language: generic 6 | addons: 7 | apt: 8 | update: true 9 | 10 | cache: 11 | directories: 12 | - $HOME/.stack 13 | - $TRAVIS_BUILD_DIR/.stack-work 14 | 15 | before_install: 16 | - mkdir -p ~/.local/bin 17 | - export PATH=$HOME/.local/bin:$PATH 18 | - travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' 19 | 20 | install: 21 | - git submodule update --init --recursive 22 | - stack build 23 | - stack test 24 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | // Automatically created by phoityne-vscode extension. 4 | 5 | "version": "2.0.0", 6 | "presentation": { 7 | "reveal": "always", 8 | "panel": "new" 9 | }, 10 | "tasks": [ 11 | { 12 | // F7 13 | "group": { 14 | "kind": "build", 15 | "isDefault": true 16 | }, 17 | "label": "haskell build", 18 | "type": "shell", 19 | //"command": "cabal configure && cabal build" 20 | "command": "stack build" 21 | }, 22 | { 23 | // F6 24 | "group": "build", 25 | "type": "shell", 26 | "label": "haskell clean & build", 27 | //"command": "cabal clean && cabal configure && cabal build" 28 | "command": "stack clean && stack build" 29 | //"command": "stack clean ; stack build" // for powershell 30 | }, 31 | { 32 | // F8 33 | "group": { 34 | "kind": "test", 35 | "isDefault": true 36 | }, 37 | "type": "shell", 38 | "label": "haskell test", 39 | //"command": "cabal test" 40 | "command": "stack test" 41 | }, 42 | { 43 | // F6 44 | "isBackground": true, 45 | "type": "shell", 46 | "label": "haskell watch", 47 | "command": "stack build --test --no-run-tests --file-watch" 48 | } 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright David Kraeutmann (c) 2018 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following 13 | disclaimer in the documentation and/or other materials provided 14 | with the distribution. 15 | 16 | * Neither the name of David Kraeutmann nor the names of other 17 | contributors may be used to endorse or promote products derived 18 | from this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Setup.hs: -------------------------------------------------------------------------------- 1 | import Distribution.Simple 2 | main = defaultMain 3 | -------------------------------------------------------------------------------- /cbits/util.h: -------------------------------------------------------------------------------- 1 | #ifndef GODOT_HASKELL_UTIL_H__ 2 | #define GODOT_HASKELL_UTIL_H__ 3 | 4 | #include 5 | 6 | #endif /* GODOT_HASKELL_UTIL_H__ */ 7 | -------------------------------------------------------------------------------- /classgen/README.md: -------------------------------------------------------------------------------- 1 | Generate bindings to the Godot API. 2 | 3 | See the godot-haskell README.md for instructions on use 4 | -------------------------------------------------------------------------------- /classgen/package.yaml: -------------------------------------------------------------------------------- 1 | name: godot-haskell-classgen 2 | version: '0.1.0.0' 3 | category: Web 4 | author: David Kraeutmann 5 | maintainer: kane@kane.cx 6 | copyright: 2018 David Kraeutmann 7 | license: BSD3 8 | github: KaneTW/godot-haskell 9 | extra-source-files: 10 | - README.md 11 | 12 | dependencies: 13 | - base 14 | - aeson 15 | - bytestring 16 | - template-haskell 17 | - lens 18 | - text 19 | - casing 20 | - vector 21 | - containers 22 | - unordered-containers 23 | - mtl 24 | 25 | build-tools: 26 | - c2hs 27 | 28 | include-dirs: 29 | - godot_headers 30 | - cbits 31 | 32 | default-extensions: 33 | - FlexibleContexts 34 | - FlexibleInstances 35 | - ScopedTypeVariables 36 | - TypeApplications 37 | - StandaloneDeriving 38 | - DerivingStrategies 39 | - DefaultSignatures 40 | - MultiParamTypeClasses 41 | - FunctionalDependencies 42 | - TypeFamilies 43 | - TemplateHaskell 44 | - TypeOperators 45 | - TypeInType 46 | - QuasiQuotes 47 | - OverloadedStrings 48 | - PatternSynonyms 49 | - GeneralizedNewtypeDeriving 50 | 51 | library: 52 | source-dirs: src-classgen 53 | dependencies: 54 | - haskell-src-exts 55 | - haskell-src-exts-qq 56 | - haskell-src-exts-sc 57 | 58 | executables: 59 | godot-haskell-classgen: 60 | main: Main.hs 61 | source-dirs: app-classgen 62 | dependencies: 63 | - godot-haskell-classgen 64 | - haskell-src-exts 65 | - haskell-src-exts-sc 66 | - directory 67 | - filepath 68 | 69 | -------------------------------------------------------------------------------- /classgen/release.nix: -------------------------------------------------------------------------------- 1 | let 2 | pkgs = import { }; 3 | in 4 | pkgs.haskellPackages.callPackage ./default.nix { } 5 | -------------------------------------------------------------------------------- /classgen/src-classgen/Classgen/Utils.hs: -------------------------------------------------------------------------------- 1 | module Classgen.Utils where 2 | 3 | import Control.Lens 4 | import Language.Haskell.TH 5 | 6 | fixedTypeFields :: LensRules 7 | fixedTypeFields = defaultFieldRules & lensField .~ (\tyn fs f -> map fixDefName $ abbreviatedNamer tyn fs f) 8 | where 9 | fixDefName (TopName n) = TopName (fixName n) 10 | fixDefName (MethodName c n) = MethodName c (fixName n) 11 | 12 | fixName n = mkName $ case nameBase n of 13 | "type" -> "type'" 14 | "id" -> "id'" 15 | "class" -> "class'" 16 | s -> s 17 | -------------------------------------------------------------------------------- /classgen/stack.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/lock_files 5 | 6 | packages: [] 7 | snapshots: 8 | - completed: 9 | size: 491163 10 | url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/15/4.yaml 11 | sha256: bc60043a06b58902b533baa80fb566c0ec495c41e428bc0f8c1e8c15b2a4c468 12 | original: lts-15.4 13 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | { mkDerivation, aeson, ansi-wl-pprint, base, bytestring, c2hs 2 | , casing, colour, containers, hpack, lens, linear, mtl, parsec 3 | , parsers, stdenv, stm, template-haskell, text 4 | , unordered-containers, vector, rsync, api-json ? null, lib, haskellPackages 5 | }: 6 | let godot-haskell-classgen = haskellPackages.callPackage ./classgen/default.nix { }; 7 | modifyGodotApi = lib.optionalString (api-json != null) '' 8 | cd classgen 9 | echo "Running godot-haskell-classgen on path " ${api-json} 10 | godot-haskell-classgen ${api-json} 11 | cd .. 12 | cp -r src src.bak 13 | rsync -a classgen/src/ src/ 14 | ''; in 15 | 16 | mkDerivation { 17 | pname = "godot-haskell"; 18 | version = "3.1.0.0"; 19 | src = ./.; 20 | 21 | libraryHaskellDepends = [ 22 | aeson ansi-wl-pprint base bytestring casing colour containers lens 23 | linear mtl parsec parsers stm template-haskell text 24 | unordered-containers vector 25 | ]; 26 | libraryToolDepends = [ c2hs hpack rsync godot-haskell-classgen]; 27 | doHaddock = false; 28 | preConfigure = '' 29 | hpack 30 | ${modifyGodotApi} 31 | ''; 32 | homepage = "https://github.com/KaneTW/godot-haskell#readme"; 33 | description = "Haskell bindings for the Godot game engine API"; 34 | license = stdenv.lib.licenses.bsd3; 35 | } -------------------------------------------------------------------------------- /examples/dodge-the-creeps/.gitignore: -------------------------------------------------------------------------------- 1 | dist* 2 | *.hi 3 | *.o 4 | .stack-work/ 5 | .stack-work-devel/ 6 | *~ 7 | \#* 8 | *.import 9 | result 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/ChangeLog.md: -------------------------------------------------------------------------------- 1 | # Empty 2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) Andrei Barbu 2019 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/Makefile: -------------------------------------------------------------------------------- 1 | NAME = myproject 2 | STACKLIBFILE = $(shell stack path --local-install-root)/lib/lib$(NAME).so 3 | GODOTPROJECT = $(shell stack path --project-root)/game 4 | 5 | all: stack 6 | nix: 7 | nix-build shell.nix 8 | cp result/lib/ghc-*/lib$(NAME).so $(GODOTPROJECT)/lib 9 | stack: 10 | stack build --fast --force-dirty 11 | cp $(STACKLIBFILE) $(GODOTPROJECT)/lib 12 | stack-nix: 13 | stack --nix clean $(NAME) 14 | stack --nix build 15 | cp $(shell stack --nix path --local-install-root)/lib/lib$(NAME).so $(GODOTPROJECT)/lib 16 | stack-run: 17 | stack build 18 | cp $(STACKLIBFILE) $(GODOTPROJECT)/lib 19 | godot -e --path ./game 20 | stack-watch: 21 | stack build --file-watch --fast --exec "cp $(STACKLIBFILE) $(GODOTPROJECT)/lib" 22 | project-watch: 23 | stack exec godot-haskell-project-generator game src 24 | updatelib: 25 | cp $(STACKLIBFILE) $(GODOTPROJECT)/lib 26 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/README.md: -------------------------------------------------------------------------------- 1 | The official Godot demo from the manual: Dodge the Creeps. 2 | 3 | Run with `make stack` then `godot game/project.godot` and press F5 to start, F8 to end. 4 | 5 | Requires Godot 3.1 6 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/Support.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE FlexibleContexts, FunctionalDependencies, MultiParamTypeClasses, OverloadedLabels, UndecidableInstances, 2 | OverloadedStrings, TemplateHaskell, TypeApplications, TypeFamilies, DataKinds, TypeOperators, FlexibleInstances #-} 3 | 4 | module Generated.Support where 5 | import Godot 6 | import GHC.TypeLits 7 | 8 | class SceneNode (scene :: Symbol) (s :: Symbol) where 9 | type SceneNodeType scene s :: * 10 | type SceneNodeName scene s :: Symbol 11 | 12 | class NodeInScheme (scene :: Symbol) (s :: Symbol) n | scene s -> n, n -> scene s 13 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/ffi/cbits/flib.c: -------------------------------------------------------------------------------- 1 | #include "HsFFI.h" 2 | 3 | static void flib_init() __attribute__((constructor)); 4 | static void flib_init() { 5 | static char *argv[] = { "libGodotHaskellPlugin.so", 0 }, **argv_ = argv; 6 | static int argc = 1; 7 | hs_init(&argc, &argv_); 8 | } 9 | 10 | static void flib_fini() __attribute__((destructor)); 11 | static void flib_fini() { 12 | hs_exit(); 13 | } 14 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/ffi/flib/FLib.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ForeignFunctionInterface #-} 2 | module FLib where 3 | 4 | import qualified Foreign 5 | import Foreign(nullPtr, Ptr,newForeignPtr_,castPtr) 6 | import qualified Godot.Gdnative.Internal as FFI 7 | import Godot.Gdnative 8 | import Godot.Nativescript 9 | import Lib 10 | import qualified Data.Text as T 11 | import qualified Data.Text.IO as T 12 | 13 | godot_nativescript_init :: GdnativeHandle -> IO () 14 | godot_nativescript_init desc = do 15 | defaultExports desc 16 | exports desc 17 | putStrLn "Haskell NativeScript lib initialized" 18 | 19 | foreign export ccall godot_nativescript_init :: GdnativeHandle -> IO () 20 | 21 | 22 | godot_gdnative_init :: FFI.GdnativeInitOptionsPtr -> IO () 23 | godot_gdnative_init opts = do 24 | Foreign.peek opts >>= FFI.initApiStructs 25 | 26 | foreign export ccall godot_gdnative_init :: FFI.GdnativeInitOptionsPtr -> IO () 27 | 28 | 29 | godot_gdnative_terminate :: FFI.GdnativeTerminateOptionsPtr -> IO () 30 | godot_gdnative_terminate handle = pure () 31 | 32 | foreign export ccall godot_gdnative_terminate :: FFI.GdnativeTerminateOptionsPtr -> IO () 33 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/HUD.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://lib/libmyproject.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "HUD" 7 | class_name = "HUD" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/HUD.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="DynamicFont" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://dodge_assets/fonts/Xolonium-Regular.ttf" type="DynamicFontData" id=1] 4 | 5 | [resource] 6 | size = 64 7 | font_data = ExtResource( 1 ) 8 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/HUD.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://HUD.gdns" type="Script" id=1] 4 | [ext_resource path="res://HUD.tres" type="DynamicFont" id=2] 5 | 6 | [sub_resource type="InputEventAction" id=1] 7 | action = "ui_select" 8 | 9 | [sub_resource type="ShortCut" id=2] 10 | shortcut = SubResource( 1 ) 11 | 12 | [node name="HUD" type="CanvasLayer"] 13 | script = ExtResource( 1 ) 14 | 15 | [node name="ScoreLabel" type="Label" parent="."] 16 | anchor_right = 1.0 17 | margin_bottom = 78.0 18 | custom_fonts/font = ExtResource( 2 ) 19 | text = "0" 20 | align = 1 21 | __meta__ = { 22 | "_edit_use_anchors_": false 23 | } 24 | 25 | [node name="MessageLabel" type="Label" parent="."] 26 | anchor_top = 0.5 27 | anchor_right = 1.0 28 | anchor_bottom = 0.5 29 | margin_top = -79.5 30 | margin_bottom = 79.5 31 | custom_fonts/font = ExtResource( 2 ) 32 | text = "Dodge 33 | the Creeps!" 34 | align = 1 35 | 36 | [node name="StartButton" type="Button" parent="."] 37 | anchor_left = 0.5 38 | anchor_top = 1.0 39 | anchor_right = 0.5 40 | anchor_bottom = 1.0 41 | margin_left = -90.0 42 | margin_top = -200.0 43 | margin_right = 90.0 44 | margin_bottom = -100.0 45 | custom_fonts/font = ExtResource( 2 ) 46 | shortcut = SubResource( 2 ) 47 | text = "Start" 48 | __meta__ = { 49 | "_edit_use_anchors_": false 50 | } 51 | 52 | [node name="MessageTimer" type="Timer" parent="."] 53 | wait_time = 2.0 54 | one_shot = true 55 | [connection signal="pressed" from="StartButton" to="." method="_on_StartButton_pressed"] 56 | [connection signal="timeout" from="MessageTimer" to="." method="_on_MessageTimer_timeout"] 57 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/Main.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://lib/libmyproject.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | class_name = "Main" 7 | library = ExtResource( 1 ) 8 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/Main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=6 format=2] 2 | 3 | [ext_resource path="res://Main.gdns" type="Script" id=1] 4 | [ext_resource path="res://Mob.tscn" type="PackedScene" id=2] 5 | [ext_resource path="res://Player.tscn" type="PackedScene" id=3] 6 | [ext_resource path="res://HUD.tscn" type="PackedScene" id=4] 7 | 8 | [sub_resource type="Curve2D" id=1] 9 | _data = { 10 | "points": PoolVector2Array( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0, 480, 720, 0, 0, 0, 0, 0, 720, 0, 0, 0, 0, 0, 0 ) 11 | } 12 | 13 | [node name="Main" type="Node"] 14 | script = ExtResource( 1 ) 15 | PackedScene = ExtResource( 2 ) 16 | 17 | [node name="ColorRect" type="ColorRect" parent="."] 18 | margin_right = 480.0 19 | margin_bottom = 720.0 20 | color = Color( 0.229564, 0.339542, 0.394531, 1 ) 21 | __meta__ = { 22 | "_edit_use_anchors_": false 23 | } 24 | 25 | [node name="Player" parent="." instance=ExtResource( 3 )] 26 | 27 | [node name="MobTimer" type="Timer" parent="."] 28 | wait_time = 0.5 29 | 30 | [node name="ScoreTimer" type="Timer" parent="."] 31 | 32 | [node name="StartTimer" type="Timer" parent="."] 33 | wait_time = 2.0 34 | one_shot = true 35 | 36 | [node name="StartPosition" type="Position2D" parent="."] 37 | position = Vector2( 240, 450 ) 38 | 39 | [node name="MobPath" type="Path2D" parent="."] 40 | curve = SubResource( 1 ) 41 | 42 | [node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath"] 43 | 44 | [node name="HUD" parent="." instance=ExtResource( 4 )] 45 | [connection signal="hit" from="Player" to="." method="game_over"] 46 | [connection signal="timeout" from="MobTimer" to="." method="_on_MobTimer_timeout"] 47 | [connection signal="timeout" from="ScoreTimer" to="." method="_on_ScoreTimer_timeout"] 48 | [connection signal="timeout" from="StartTimer" to="." method="_on_StartTimer_timeout"] 49 | [connection signal="start_game" from="HUD" to="." method="new_game"] 50 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/Mob.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://lib/libmyproject.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "Mob" 7 | class_name = "Mob" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/Mob.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=10 format=2] 2 | 3 | [ext_resource path="res://Mob.gdns" type="Script" id=1] 4 | [ext_resource path="res://dodge_assets/art/enemyFlyingAlt_1.png" type="Texture" id=2] 5 | [ext_resource path="res://dodge_assets/art/enemyFlyingAlt_2.png" type="Texture" id=3] 6 | [ext_resource path="res://dodge_assets/art/enemyWalking_1.png" type="Texture" id=4] 7 | [ext_resource path="res://dodge_assets/art/enemyWalking_2.png" type="Texture" id=5] 8 | [ext_resource path="res://dodge_assets/art/enemySwimming_1.png" type="Texture" id=6] 9 | [ext_resource path="res://dodge_assets/art/enemySwimming_2.png" type="Texture" id=7] 10 | 11 | [sub_resource type="SpriteFrames" id=1] 12 | animations = [ { 13 | "frames": [ ExtResource( 2 ), ExtResource( 3 ) ], 14 | "loop": true, 15 | "name": "fly", 16 | "speed": 3.0 17 | }, { 18 | "frames": [ ExtResource( 4 ), ExtResource( 5 ) ], 19 | "loop": true, 20 | "name": "walk", 21 | "speed": 4.0 22 | }, { 23 | "frames": [ ExtResource( 6 ), ExtResource( 7 ) ], 24 | "loop": true, 25 | "name": "swim", 26 | "speed": 4.0 27 | } ] 28 | 29 | [sub_resource type="CapsuleShape2D" id=2] 30 | radius = 36.0297 31 | height = 27.5338 32 | 33 | [node name="Mob" type="RigidBody2D"] 34 | collision_mask = 0 35 | gravity_scale = 0.0 36 | script = ExtResource( 1 ) 37 | __meta__ = { 38 | "_edit_group_": true 39 | } 40 | 41 | [node name="AnimatedSprite" type="AnimatedSprite" parent="."] 42 | scale = Vector2( 0.75, 0.75 ) 43 | frames = SubResource( 1 ) 44 | animation = "swim" 45 | frame = 1 46 | playing = true 47 | 48 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 49 | rotation = 1.5708 50 | shape = SubResource( 2 ) 51 | 52 | [node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."] 53 | [connection signal="screen_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"] 54 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/Player.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://lib/libmyproject.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "Player" 7 | class_name = "Player" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/Player.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=8 format=2] 2 | 3 | [ext_resource path="res://Player.gdns" type="Script" id=1] 4 | [ext_resource path="res://dodge_assets/art/playerGrey_walk1.png" type="Texture" id=2] 5 | [ext_resource path="res://dodge_assets/art/playerGrey_walk2.png" type="Texture" id=3] 6 | [ext_resource path="res://dodge_assets/art/playerGrey_up1.png" type="Texture" id=4] 7 | [ext_resource path="res://dodge_assets/art/playerGrey_up2.png" type="Texture" id=5] 8 | 9 | [sub_resource type="SpriteFrames" id=1] 10 | animations = [ { 11 | "frames": [ ExtResource( 2 ), ExtResource( 3 ) ], 12 | "loop": true, 13 | "name": "right", 14 | "speed": 5.0 15 | }, { 16 | "frames": [ ExtResource( 4 ), ExtResource( 5 ) ], 17 | "loop": true, 18 | "name": "up", 19 | "speed": 5.0 20 | } ] 21 | 22 | [sub_resource type="CapsuleShape2D" id=2] 23 | radius = 26.892 24 | height = 15.9045 25 | 26 | [node name="Player" type="Area2D"] 27 | script = ExtResource( 1 ) 28 | __meta__ = { 29 | "_edit_group_": true 30 | } 31 | 32 | [node name="AnimatedSprite" type="AnimatedSprite" parent="."] 33 | position = Vector2( 0, -1 ) 34 | scale = Vector2( 0.5, 0.5 ) 35 | frames = SubResource( 1 ) 36 | animation = "up" 37 | 38 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 39 | shape = SubResource( 2 ) 40 | [connection signal="body_entered" from="." to="." method="_on_Player_body_entered"] 41 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/House In a Forest Loop.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/House In a Forest Loop.ogg -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/enemyFlyingAlt_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/enemyFlyingAlt_1.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/enemyFlyingAlt_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/enemyFlyingAlt_2.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/enemySwimming_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/enemySwimming_1.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/enemySwimming_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/enemySwimming_2.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/enemyWalking_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/enemyWalking_1.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/enemyWalking_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/enemyWalking_2.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/gameover.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/gameover.wav -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/playerGrey_up1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/playerGrey_up1.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/playerGrey_up2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/playerGrey_up2.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/playerGrey_walk1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/playerGrey_walk1.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/art/playerGrey_walk2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/art/playerGrey_walk2.png -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/dodge_assets/fonts/Xolonium-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/dodge-the-creeps/game/dodge_assets/fonts/Xolonium-Regular.ttf -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/lib/libmyproject.gdnlib: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | singleton=false 4 | load_once=true 5 | symbol_prefix="godot_" 6 | reloadable=false 7 | 8 | [entry] 9 | 10 | X11.64="res://lib/libmyproject.so" 11 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/game/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="myproject" 19 | run/main_scene="res://Main.tscn" 20 | 21 | [audio] 22 | 23 | default_bus_layout="" 24 | 25 | [display] 26 | 27 | window/size/width=480 28 | window/size/height=720 29 | 30 | [gdnative] 31 | 32 | singletons=[ ] 33 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/godot-haskell.nix: -------------------------------------------------------------------------------- 1 | { fetchFromGitHub, mkDerivation, aeson, ansi-wl-pprint, base, bytestring, c2hs 2 | , casing, colour, containers, hpack, lens, linear, mtl, parsec 3 | , parsers, stdenv, stm, template-haskell, text 4 | , unordered-containers, vector 5 | }: 6 | mkDerivation { 7 | pname = "godot-haskell"; 8 | version = "3.1.0.0"; 9 | src = fetchFromGitHub { 10 | owner = "SimulaVR"; 11 | repo = "godot-haskell"; 12 | rev = "b423d4f2fa5a6a3dcfffb82bb36be571adb29d34"; # godot-haskell rev 13 | # Use nix-prefetch-git to get the hash 14 | sha256 = "0jh2j5rr90dqdxvcipygwnhhj7j2dj4zvm6gbdpg106ll60pyqrp"; 15 | fetchSubmodules = true; 16 | }; 17 | libraryHaskellDepends = [ 18 | aeson ansi-wl-pprint base bytestring casing colour containers lens 19 | linear mtl parsec parsers stm template-haskell text 20 | unordered-containers vector 21 | ]; 22 | libraryToolDepends = [ c2hs hpack ]; 23 | doHaddock = false; 24 | preConfigure = "hpack"; 25 | homepage = "https://github.com/KaneTW/godot-haskell#readme"; 26 | description = "Haskell bindings for the Godot game engine API"; 27 | license = stdenv.lib.licenses.bsd3; 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/hie.yaml: -------------------------------------------------------------------------------- 1 | cradle: 2 | stack: 3 | - path: "./src" 4 | component: "myproject:lib" 5 | 6 | - path: "./game" 7 | component: "myproject:lib" 8 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/myproject.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 1.12 2 | 3 | -- This file has been generated from package.yaml by hpack version 0.33.0. 4 | -- 5 | -- see: https://github.com/sol/hpack 6 | -- 7 | -- hash: 98269f1144e3857ceb0d2b7a1ec2c981a99768d91b04e6febe2406912eda49b8 8 | 9 | name: myproject 10 | version: 0.0.0.0 11 | description: Please see the README on Github at 12 | homepage: https://github.com/SimulaVR/godot-haskell#readme 13 | bug-reports: https://github.com/SimulaVR/godot-haskell/issues 14 | author: Andrei Barbu 15 | maintainer: andrei@0xab.com 16 | copyright: Andrei Barbu 2019, 2021 17 | license: BSD3 18 | license-file: LICENSE 19 | build-type: Simple 20 | extra-source-files: 21 | ChangeLog.md 22 | README.md 23 | foreign-library myproject 24 | type: native-shared 25 | other-modules: FLib 26 | hs-source-dirs: ffi/flib 27 | c-sources: ffi/cbits/flib.c 28 | build-depends: 29 | base >= 4.12 && <5 30 | , godot-haskell 31 | , myproject 32 | , text 33 | default-language: Haskell2010 34 | 35 | source-repository head 36 | type: git 37 | location: https://github.com/SimulaVR/godot-haskell 38 | 39 | library 40 | exposed-modules: 41 | Lib 42 | other-modules: 43 | Game.HUD 44 | Game.Main 45 | Game.Mob 46 | Game.Player 47 | Project.Requirements 48 | Project.Scenes 49 | Project.Scenes.HUD 50 | Project.Scenes.Main 51 | Project.Scenes.Mob 52 | Project.Scenes.Player 53 | Project.Support 54 | Paths_myproject 55 | hs-source-dirs: 56 | src 57 | game 58 | default-extensions: FlexibleContexts MultiParamTypeClasses OverloadedStrings TemplateHaskell TypeApplications TypeFamilies DataKinds FlexibleInstances ScopedTypeVariables AllowAmbiguousTypes TupleSections FunctionalDependencies 59 | ghc-options: -Wall -Wno-orphans -O0 60 | build-depends: 61 | base >=4.12 && <5 62 | , containers 63 | , extra 64 | , godot-haskell 65 | , lens 66 | , linear 67 | , random 68 | , strict-concurrency 69 | , template-haskell 70 | , text 71 | , th-abstraction 72 | , vector 73 | default-language: Haskell2010 74 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/package.yaml: -------------------------------------------------------------------------------- 1 | name: myproject 2 | version: '0.0.0.0' 3 | description: Please see the README on Github at 4 | author: Andrei Barbu 5 | maintainer: andrei@0xab.com 6 | copyright: Andrei Barbu 2019, 2021 7 | license: BSD3 8 | github: SimulaVR/godot-haskell 9 | extra-source-files: 10 | - ChangeLog.md 11 | - README.md 12 | dependencies: 13 | - base >=4.12 && <5 14 | - godot-haskell 15 | - linear 16 | - random 17 | - text 18 | - vector 19 | - strict-concurrency 20 | - lens 21 | - template-haskell 22 | - th-abstraction 23 | - containers 24 | - extra 25 | library: 26 | source-dirs: 27 | - src 28 | - game 29 | default-extensions: 30 | - FlexibleContexts 31 | - MultiParamTypeClasses 32 | - OverloadedStrings 33 | - TemplateHaskell 34 | - TypeApplications 35 | - TypeFamilies 36 | - DataKinds 37 | - FlexibleInstances 38 | - ScopedTypeVariables 39 | - AllowAmbiguousTypes 40 | - TupleSections 41 | - FunctionalDependencies 42 | exposed-modules: 43 | - Lib 44 | ghc-options: -Wall -Wno-orphans -O0 45 | 46 | verbatim: | 47 | foreign-library myproject 48 | type: native-shared 49 | other-modules: FLib 50 | hs-source-dirs: ffi/flib 51 | c-sources: ffi/cbits/flib.c 52 | build-depends: 53 | base >= 4.12 && <5 54 | , godot-haskell 55 | , myproject 56 | , text 57 | default-language: Haskell2010 58 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/pinned-nixpkgs.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | # 19.03-beta (25 feb) 5 | rev = "0c0954781e257b8b0dc49341795a2fe7d96945a3"; # pinned-nixpkgs rev 6 | pkgs = import (builtins.fetchTarball { 7 | url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; 8 | }) {}; 9 | in 10 | pkgs 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/shell.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs ? import ./pinned-nixpkgs.nix {} 2 | , compiler ? "default" 3 | , doBenchmark ? false }: 4 | 5 | 6 | let 7 | 8 | inherit (nixpkgs) pkgs; 9 | 10 | haskellPackages = if compiler == "default" 11 | then pkgs.haskellPackages 12 | else pkgs.haskell.packages.${compiler}; 13 | 14 | f = { mkDerivation, stdenv, base, godot-haskell, linear, text , vector, stm }: 15 | mkDerivation { 16 | pname = "myproject"; 17 | version = "3.1.0.0"; 18 | src = ./.; 19 | libraryHaskellDepends = [ 20 | base godot-haskell linear text vector stm 21 | ]; 22 | libraryToolDepends = []; 23 | homepage = "https://github.com/abarbu/myproject#readme"; 24 | license = stdenv.lib.licenses.bsd3; 25 | }; 26 | 27 | variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; 28 | 29 | drv = variant (haskellPackages.callPackage f { 30 | godot-haskell = haskellPackages.callPackage ./godot-haskell.nix {fetchFromGitHub = pkgs.fetchFromGitHub;}; 31 | }); 32 | 33 | in 34 | 35 | if pkgs.lib.inNixShell then drv.env else drv 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/src/Game/HUD.hs: -------------------------------------------------------------------------------- 1 | module Game.HUD where 2 | import Control.Lens 3 | import Control.Monad 4 | import qualified Data.Text as T 5 | import Godot 6 | import Godot.Core.CanvasItem as CanvasItem 7 | import Godot.Core.Label as Label 8 | import Godot.Core.Timer as Timer 9 | import Project.Support 10 | import Project.Scenes.HUD() 11 | 12 | data HUD = HUD { _hBase :: CanvasLayer } 13 | 14 | instance NodeInit HUD where 15 | init = pure . HUD 16 | instance NodeMethod HUD "_on_MessageTimer_timeout" '[] (IO ()) where 17 | nodeMethod self = getNode' @"MessageLabel" self >>= CanvasItem.hide 18 | instance NodeMethod HUD "_on_StartButton_pressed" '[] (IO ()) where 19 | nodeMethod self = do 20 | getNode' @"StartButton" self >>= CanvasItem.hide 21 | emit_signal' @"start_game" self [] 22 | instance NodeMethod HUD "show_message" '[GodotString] (IO ()) where 23 | nodeMethod = show_message 24 | instance NodeMethod HUD "show_game_over" '[] (IO ()) where 25 | nodeMethod = show_game_over 26 | instance NodeMethod HUD "update_score" '[Int] (IO ()) where 27 | nodeMethod = update_score 28 | instance NodeSignal HUD "start_game" '[] 29 | 30 | show_message :: HUD -> GodotString -> IO () 31 | show_message self text = do 32 | messageLabel <- getNode' @"MessageLabel" self 33 | set_text messageLabel text 34 | CanvasItem.show messageLabel 35 | getNode' @"MessageTimer" self >>= (`Timer.start` Nothing) 36 | 37 | show_game_over :: HUD -> IO () 38 | show_game_over self = do 39 | show_message self =<< toLowLevel "Game Over" 40 | await' @"MessageTimer" @"timeout" self $ \self' -> do 41 | messageLabel <- getNode' @"MessageLabel" self' 42 | set_text messageLabel =<< toLowLevel "Dodge the\nCreeps!" 43 | CanvasItem.show messageLabel 44 | getNode' @"StartButton" self' >>= CanvasItem.show 45 | pure () 46 | 47 | update_score :: HUD -> Int -> IO () 48 | update_score self score = do 49 | set_text 50 | <$> getNode' @"ScoreLabel" self 51 | <*> toLowLevel (T.pack $ Prelude.show score) 52 | & join 53 | 54 | setupNode ''HUD "HUD" "HUD" 55 | deriveBase ''HUD 56 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/src/Game/Mob.hs: -------------------------------------------------------------------------------- 1 | module Game.Mob where 2 | import Godot 3 | import Godot.Core.AnimatedSprite as AnimatedSprite 4 | import Godot.Core.Node as Node 5 | import System.Random 6 | import Project.Support 7 | import Project.Scenes.Mob() 8 | 9 | data Mob = Mob 10 | { _mBase :: RigidBody2D 11 | , _mMinSpeed :: MVar Float 12 | , _mMaxSpeed :: MVar Float 13 | , _mMobTypes :: MVar [Text] 14 | } 15 | 16 | instance NodeInit Mob where 17 | init base = Mob base <$> newMVar 150 <*> newMVar 250 <*> newMVar ["walk", "swim", "fly"] 18 | instance NodeMethod Mob "_ready" '[] (IO ()) where 19 | nodeMethod self = do 20 | let randElem xs = (xs !!) <$> randomRIO (0, length xs - 1) 21 | randAnim <- readMVar (_mMobTypes self) >>= randElem >>= toLowLevel 22 | getNode' @"AnimatedSprite" self >>= (`set_animation` randAnim) 23 | instance NodeMethod Mob "_on_VisibilityNotifier2D_screen_exited" '[] (IO ()) where 24 | nodeMethod = queue_free 25 | 26 | setupNode ''Mob "Mob" "Mob" 27 | deriveBase ''Mob 28 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib (exports) where 2 | import Godot 3 | import Game.Mob 4 | import Game.Main 5 | import Game.Player 6 | import Game.HUD 7 | import Project.Support 8 | import Project.Requirements 9 | 10 | exports :: GdnativeHandle -> IO () 11 | exports = registerAll' @Nodes @'[HUD, Main, Mob, Player] 12 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/src/Project/Requirements.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | module Project.Requirements where 4 | import Project.Support 5 | 6 | type Nodes = '[OneResourceNode "HUD" "HUD", OneResourceNode "Main" "Main", OneResourceNode "Mob" "Mob", OneResourceNode "Player" "Player"] 7 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/src/Project/Scenes.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | module Project.Scenes (module M) where 4 | import qualified Project.Scenes.HUD as M 5 | import qualified Project.Scenes.Main as M 6 | import qualified Project.Scenes.Mob as M 7 | import qualified Project.Scenes.Player as M 8 | 9 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/src/Project/Scenes/HUD.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | {-# LANGUAGE FlexibleContexts, FunctionalDependencies, MultiParamTypeClasses, 4 | UndecidableInstances, OverloadedStrings, TemplateHaskell, TypeApplications, 5 | TypeFamilies, DataKinds, TypeOperators, FlexibleInstances, RankNTypes, 6 | AllowAmbiguousTypes, ScopedTypeVariables, DerivingStrategies, 7 | GeneralizedNewtypeDeriving, LambdaCase #-} 8 | 9 | module Project.Scenes.HUD where 10 | import Project.Support 11 | import Godot 12 | import GHC.TypeLits 13 | 14 | import Godot.Core.CanvasLayer() 15 | import Godot.Core.Label() 16 | import Godot.Core.Timer() 17 | import Godot.Core.Button() 18 | 19 | instance SceneResourcePath "HUD" where 20 | sceneResourcePath = "res://HUD.tscn" 21 | 22 | 23 | instance SceneRoot "HUD" where 24 | type SceneRootNode "HUD" = "HUD" 25 | 26 | 27 | instance SceneNode "HUD" "HUD" where 28 | type SceneNodeType "HUD" "HUD" = CanvasLayer 29 | type SceneNodeName "HUD" "HUD" = "HUD" 30 | type SceneNodeIsHaskell "HUD" "HUD" = 'Just '("HUD", "HUD") 31 | 32 | 33 | instance SceneNode "HUD" "MessageLabel" where 34 | type SceneNodeType "HUD" "MessageLabel" = Label 35 | type SceneNodeName "HUD" "MessageLabel" = "MessageLabel" 36 | type SceneNodeIsHaskell "HUD" "MessageLabel" = 'Nothing 37 | 38 | 39 | instance SceneNode "HUD" "MessageTimer" where 40 | type SceneNodeType "HUD" "MessageTimer" = Timer 41 | type SceneNodeName "HUD" "MessageTimer" = "MessageTimer" 42 | type SceneNodeIsHaskell "HUD" "MessageTimer" = 'Nothing 43 | 44 | 45 | instance SceneNode "HUD" "ScoreLabel" where 46 | type SceneNodeType "HUD" "ScoreLabel" = Label 47 | type SceneNodeName "HUD" "ScoreLabel" = "ScoreLabel" 48 | type SceneNodeIsHaskell "HUD" "ScoreLabel" = 'Nothing 49 | 50 | 51 | instance SceneNode "HUD" "StartButton" where 52 | type SceneNodeType "HUD" "StartButton" = Button 53 | type SceneNodeName "HUD" "StartButton" = "StartButton" 54 | type SceneNodeIsHaskell "HUD" "StartButton" = 'Nothing 55 | 56 | 57 | instance SceneConnection "HUD" "MessageTimer" "timeout" "HUD" "_on_MessageTimer_timeout" 58 | 59 | 60 | instance SceneConnection "HUD" "StartButton" "pressed" "HUD" "_on_StartButton_pressed" 61 | 62 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/src/Project/Scenes/Mob.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | {-# LANGUAGE FlexibleContexts, FunctionalDependencies, MultiParamTypeClasses, 4 | UndecidableInstances, OverloadedStrings, TemplateHaskell, TypeApplications, 5 | TypeFamilies, DataKinds, TypeOperators, FlexibleInstances, RankNTypes, 6 | AllowAmbiguousTypes, ScopedTypeVariables, DerivingStrategies, 7 | GeneralizedNewtypeDeriving, LambdaCase #-} 8 | 9 | module Project.Scenes.Mob where 10 | import Project.Support 11 | import Godot 12 | import GHC.TypeLits 13 | 14 | import Godot.Core.AnimatedSprite() 15 | import Godot.Core.CollisionShape2D() 16 | import Godot.Core.RigidBody2D() 17 | import Godot.Core.VisibilityNotifier2D() 18 | 19 | instance SceneResourcePath "Mob" where 20 | sceneResourcePath = "res://Mob.tscn" 21 | 22 | 23 | instance SceneRoot "Mob" where 24 | type SceneRootNode "Mob" = "Mob" 25 | 26 | 27 | instance SceneNode "Mob" "AnimatedSprite" where 28 | type SceneNodeType "Mob" "AnimatedSprite" = AnimatedSprite 29 | type SceneNodeName "Mob" "AnimatedSprite" = "AnimatedSprite" 30 | type SceneNodeIsHaskell "Mob" "AnimatedSprite" = 'Nothing 31 | 32 | 33 | instance SceneNode "Mob" "CollisionShape2D" where 34 | type SceneNodeType "Mob" "CollisionShape2D" = CollisionShape2D 35 | type SceneNodeName "Mob" "CollisionShape2D" = "CollisionShape2D" 36 | type SceneNodeIsHaskell "Mob" "CollisionShape2D" = 'Nothing 37 | 38 | 39 | instance SceneNode "Mob" "Mob" where 40 | type SceneNodeType "Mob" "Mob" = RigidBody2D 41 | type SceneNodeName "Mob" "Mob" = "Mob" 42 | type SceneNodeIsHaskell "Mob" "Mob" = 'Just '("Mob", "Mob") 43 | 44 | 45 | instance SceneNode "Mob" "VisibilityNotifier2D" where 46 | type SceneNodeType "Mob" "VisibilityNotifier2D" = VisibilityNotifier2D 47 | type SceneNodeName "Mob" "VisibilityNotifier2D" = "VisibilityNotifier2D" 48 | type SceneNodeIsHaskell "Mob" "VisibilityNotifier2D" = 'Nothing 49 | 50 | 51 | instance SceneConnection "Mob" "VisibilityNotifier2D" "screen_exited" "Mob" "_on_VisibilityNotifier2D_screen_exited" 52 | 53 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/src/Project/Scenes/Player.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | {-# LANGUAGE FlexibleContexts, FunctionalDependencies, MultiParamTypeClasses, 4 | UndecidableInstances, OverloadedStrings, TemplateHaskell, TypeApplications, 5 | TypeFamilies, DataKinds, TypeOperators, FlexibleInstances, RankNTypes, 6 | AllowAmbiguousTypes, ScopedTypeVariables, DerivingStrategies, 7 | GeneralizedNewtypeDeriving, LambdaCase #-} 8 | 9 | module Project.Scenes.Player where 10 | import Project.Support 11 | import Godot 12 | import GHC.TypeLits 13 | 14 | import Godot.Core.AnimatedSprite() 15 | import Godot.Core.CollisionShape2D() 16 | import Godot.Core.Area2D() 17 | 18 | instance SceneResourcePath "Player" where 19 | sceneResourcePath = "res://Player.tscn" 20 | 21 | 22 | instance SceneRoot "Player" where 23 | type SceneRootNode "Player" = "Player" 24 | 25 | 26 | instance SceneNode "Player" "AnimatedSprite" where 27 | type SceneNodeType "Player" "AnimatedSprite" = AnimatedSprite 28 | type SceneNodeName "Player" "AnimatedSprite" = "AnimatedSprite" 29 | type SceneNodeIsHaskell "Player" "AnimatedSprite" = 'Nothing 30 | 31 | 32 | instance SceneNode "Player" "CollisionShape2D" where 33 | type SceneNodeType "Player" "CollisionShape2D" = CollisionShape2D 34 | type SceneNodeName "Player" "CollisionShape2D" = "CollisionShape2D" 35 | type SceneNodeIsHaskell "Player" "CollisionShape2D" = 'Nothing 36 | 37 | 38 | instance SceneNode "Player" "Player" where 39 | type SceneNodeType "Player" "Player" = Area2D 40 | type SceneNodeName "Player" "Player" = "Player" 41 | type SceneNodeIsHaskell "Player" "Player" = 'Just '("Player", "Player") 42 | 43 | 44 | instance SceneConnection "Player" "Player" "body_entered" "Player" "_on_Player_body_entered" 45 | 46 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/stack-shell.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs ? import ./pinned-nixpkgs.nix {} 2 | , ghc 3 | }: 4 | 5 | with nixpkgs; 6 | 7 | haskell.lib.buildStackProject { 8 | inherit ghc; 9 | name = "myproject"; 10 | buildInputs = []; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/stack.yaml: -------------------------------------------------------------------------------- 1 | resolver: nightly-2021-02-06 2 | 3 | packages: 4 | - . 5 | 6 | extra-deps: 7 | - ../../ 8 | 9 | require-stack-version: ">=1.8" 10 | 11 | nix: 12 | enable: false 13 | pure: true 14 | packages: [] 15 | shell-file: stack-shell.nix 16 | nix-shell-options: [] 17 | path: [] 18 | add-gc-roots: false 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/dodge-the-creeps/stack.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/lock_files 5 | 6 | packages: [] 7 | snapshots: 8 | - completed: 9 | size: 565469 10 | url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2021/2/6.yaml 11 | sha256: 7108f8cb8c928699c6c3c6574d3f6fc132db8bbba6a3987f9446fb35fd67dbf6 12 | original: nightly-2021-02-06 13 | -------------------------------------------------------------------------------- /examples/rss-reader/.gitignore: -------------------------------------------------------------------------------- 1 | dist* 2 | *.hi 3 | *.o 4 | .stack-work/ 5 | .stack-work-devel/ 6 | *~ 7 | \#* 8 | *.import 9 | result 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/rss-reader/ChangeLog.md: -------------------------------------------------------------------------------- 1 | # Empty 2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/rss-reader/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) Andrei Barbu 2019 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | -------------------------------------------------------------------------------- /examples/rss-reader/Makefile: -------------------------------------------------------------------------------- 1 | NAME = myproject 2 | STACKLIBFILE = $(shell stack path --local-install-root)/lib/lib$(NAME).so 3 | GODOTPROJECT = $(shell stack path --project-root)/game 4 | all: stack 5 | nix: 6 | nix-build shell.nix 7 | cp result/lib/ghc-*/lib$(NAME).so $(GODOTPROJECT)/lib 8 | stack: 9 | stack build --fast --force-dirty 10 | cp $(STACKLIBFILE) $(GODOTPROJECT)/lib 11 | stack-nix: 12 | stack --nix clean $(NAME) 13 | stack --nix build 14 | cp $(shell stack --nix path --local-install-root)/lib/lib$(NAME).so $(GODOTPROJECT)/lib 15 | stack-run: 16 | stack build 17 | cp $(STACKLIBFILE) $(GODOTPROJECT)/lib 18 | godot -e --path ./game 19 | stack-watch: 20 | stack build --file-watch --fast --exec "cp $(STACKLIBFILE) $(GODOTPROJECT)/lib" 21 | project-watch: 22 | stack exec godot-haskell-project-generator game src 23 | updatelib: 24 | cp $(STACKLIBFILE) $(GODOTPROJECT)/lib 25 | -------------------------------------------------------------------------------- /examples/rss-reader/README.md: -------------------------------------------------------------------------------- 1 | The official Godot demo from the manual: Dodge the Creeps. 2 | 3 | Run with `make stack` then `godot game/project.godot` and press F5 to start, F8 to end. 4 | 5 | Requires Godot 3.1 6 | -------------------------------------------------------------------------------- /examples/rss-reader/Support.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE FlexibleContexts, FunctionalDependencies, MultiParamTypeClasses, OverloadedLabels, UndecidableInstances, 2 | OverloadedStrings, TemplateHaskell, TypeApplications, TypeFamilies, DataKinds, TypeOperators, FlexibleInstances #-} 3 | 4 | module Generated.Support where 5 | import Godot 6 | import GHC.TypeLits 7 | 8 | class SceneNode (scene :: Symbol) (s :: Symbol) where 9 | type SceneNodeType scene s :: * 10 | type SceneNodeName scene s :: Symbol 11 | 12 | class NodeInScheme (scene :: Symbol) (s :: Symbol) n | scene s -> n, n -> scene s 13 | -------------------------------------------------------------------------------- /examples/rss-reader/ffi/cbits/flib.c: -------------------------------------------------------------------------------- 1 | #include "HsFFI.h" 2 | 3 | static void flib_init() __attribute__((constructor)); 4 | static void flib_init() { 5 | static char *argv[] = { "libGodotHaskellPlugin.so", 0 }, **argv_ = argv; 6 | static int argc = 1; 7 | hs_init(&argc, &argv_); 8 | } 9 | 10 | static void flib_fini() __attribute__((destructor)); 11 | static void flib_fini() { 12 | hs_exit(); 13 | } 14 | -------------------------------------------------------------------------------- /examples/rss-reader/ffi/flib/FLib.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ForeignFunctionInterface #-} 2 | module FLib where 3 | 4 | import qualified Foreign 5 | import Foreign(nullPtr, Ptr,newForeignPtr_,castPtr) 6 | import qualified Godot.Gdnative.Internal as FFI 7 | import Godot.Gdnative 8 | import Godot.Nativescript 9 | import Lib 10 | import qualified Data.Text as T 11 | import qualified Data.Text.IO as T 12 | 13 | godot_nativescript_init :: GdnativeHandle -> IO () 14 | godot_nativescript_init desc = do 15 | defaultExports desc 16 | exports desc 17 | putStrLn "Haskell NativeScript lib initialized" 18 | 19 | foreign export ccall godot_nativescript_init :: GdnativeHandle -> IO () 20 | 21 | 22 | godot_gdnative_init :: FFI.GdnativeInitOptionsPtr -> IO () 23 | godot_gdnative_init opts = do 24 | Foreign.peek opts >>= FFI.initApiStructs 25 | 26 | foreign export ccall godot_gdnative_init :: FFI.GdnativeInitOptionsPtr -> IO () 27 | 28 | 29 | godot_gdnative_terminate :: FFI.GdnativeTerminateOptionsPtr -> IO () 30 | godot_gdnative_terminate handle = pure () 31 | 32 | foreign export ccall godot_gdnative_terminate :: FFI.GdnativeTerminateOptionsPtr -> IO () 33 | -------------------------------------------------------------------------------- /examples/rss-reader/game/Rss_reader.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://lib/libmyproject.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "RSSReader" 7 | class_name = "RSSReader" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/rss-reader/game/export_presets.cfg: -------------------------------------------------------------------------------- 1 | [preset.0] 2 | 3 | name="Linux/X11" 4 | platform="Linux/X11" 5 | runnable=true 6 | custom_features="" 7 | export_filter="all_resources" 8 | include_filter="" 9 | exclude_filter="" 10 | export_path="../../../../../../../tmp/rssreader.x86_64" 11 | patch_list=PoolStringArray( ) 12 | script_export_mode=1 13 | script_encryption_key="" 14 | 15 | [preset.0.options] 16 | 17 | texture_format/bptc=false 18 | texture_format/s3tc=true 19 | texture_format/etc=false 20 | texture_format/etc2=false 21 | texture_format/no_bptc_fallbacks=true 22 | binary_format/64_bits=true 23 | binary_format/embed_pck=false 24 | custom_template/release="" 25 | custom_template/debug="" 26 | -------------------------------------------------------------------------------- /examples/rss-reader/game/lib/libmyproject.gdnlib: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | singleton=false 4 | load_once=true 5 | symbol_prefix="godot_" 6 | reloadable=false 7 | 8 | [entry] 9 | 10 | X11.64="res://lib/libmyproject.so" 11 | -------------------------------------------------------------------------------- /examples/rss-reader/game/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="rss-reader" 19 | run/main_scene="res://Rss_reader.tscn" 20 | 21 | [audio] 22 | 23 | default_bus_layout="" 24 | 25 | [display] 26 | 27 | window/size/width=480 28 | window/size/height=720 29 | window/dpi/allow_hidpi=true 30 | 31 | [gdnative] 32 | 33 | singletons=[ ] 34 | 35 | [gui] 36 | 37 | theme/use_hidpi=true 38 | -------------------------------------------------------------------------------- /examples/rss-reader/godot-haskell.nix: -------------------------------------------------------------------------------- 1 | { fetchFromGitHub, mkDerivation, aeson, ansi-wl-pprint, base, bytestring, c2hs 2 | , casing, colour, containers, hpack, lens, linear, mtl, parsec 3 | , parsers, stdenv, stm, template-haskell, text 4 | , unordered-containers, vector 5 | }: 6 | mkDerivation { 7 | pname = "godot-haskell"; 8 | version = "3.1.0.0"; 9 | src = fetchFromGitHub { 10 | owner = "SimulaVR"; 11 | repo = "godot-haskell"; 12 | rev = "b423d4f2fa5a6a3dcfffb82bb36be571adb29d34"; # godot-haskell rev 13 | # Use nix-prefetch-git to get the hash 14 | sha256 = "0jh2j5rr90dqdxvcipygwnhhj7j2dj4zvm6gbdpg106ll60pyqrp"; 15 | fetchSubmodules = true; 16 | }; 17 | libraryHaskellDepends = [ 18 | aeson ansi-wl-pprint base bytestring casing colour containers lens 19 | linear mtl parsec parsers stm template-haskell text 20 | unordered-containers vector 21 | ]; 22 | libraryToolDepends = [ c2hs hpack ]; 23 | doHaddock = false; 24 | preConfigure = "hpack"; 25 | homepage = "https://github.com/KaneTW/godot-haskell#readme"; 26 | description = "Haskell bindings for the Godot game engine API"; 27 | license = stdenv.lib.licenses.bsd3; 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/rss-reader/hie.yaml: -------------------------------------------------------------------------------- 1 | cradle: 2 | stack: 3 | - path: "./src" 4 | component: "myproject:lib" 5 | 6 | - path: "./game" 7 | component: "myproject:lib" 8 | -------------------------------------------------------------------------------- /examples/rss-reader/myproject.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 1.12 2 | 3 | -- This file has been generated from package.yaml by hpack version 0.33.0. 4 | -- 5 | -- see: https://github.com/sol/hpack 6 | -- 7 | -- hash: b6a0d2a1fc09513a3765e90723389dc19ec4879f3963404979d2a68731de6d6e 8 | 9 | name: myproject 10 | version: 0.0.0.0 11 | description: Please see the README on Github at 12 | homepage: https://github.com/SimulaVR/godot-haskell#readme 13 | bug-reports: https://github.com/SimulaVR/godot-haskell/issues 14 | author: Andrei Barbu 15 | maintainer: andrei@0xab.com 16 | copyright: Andrei Barbu 2019, 2021 17 | license: BSD3 18 | license-file: LICENSE 19 | build-type: Simple 20 | extra-source-files: 21 | ChangeLog.md 22 | README.md 23 | foreign-library myproject 24 | type: native-shared 25 | other-modules: FLib 26 | hs-source-dirs: ffi/flib 27 | c-sources: ffi/cbits/flib.c 28 | build-depends: 29 | base >= 4.12 && <5 30 | , godot-haskell 31 | , myproject 32 | , text 33 | default-language: Haskell2010 34 | 35 | source-repository head 36 | type: git 37 | location: https://github.com/SimulaVR/godot-haskell 38 | 39 | library 40 | exposed-modules: 41 | Lib 42 | other-modules: 43 | Game.RSSReader 44 | Project.Requirements 45 | Project.Scenes 46 | Project.Scenes.Rss_reader 47 | Project.Support 48 | Paths_myproject 49 | hs-source-dirs: 50 | src 51 | game 52 | default-extensions: FlexibleContexts MultiParamTypeClasses OverloadedStrings TemplateHaskell TypeApplications TypeFamilies DataKinds FlexibleInstances ScopedTypeVariables AllowAmbiguousTypes TypeOperators TupleSections 53 | ghc-options: -Wall -Wno-orphans -O0 54 | build-depends: 55 | aeson 56 | , base >=4.12 && <5 57 | , containers 58 | , directory 59 | , extra 60 | , godot-haskell 61 | , lens 62 | , linear 63 | , monad-loops 64 | , random 65 | , strict-concurrency 66 | , template-haskell 67 | , text 68 | , th-abstraction 69 | , vector 70 | , xeno 71 | default-language: Haskell2010 72 | -------------------------------------------------------------------------------- /examples/rss-reader/package.yaml: -------------------------------------------------------------------------------- 1 | name: myproject 2 | version: '0.0.0.0' 3 | description: Please see the README on Github at 4 | author: Andrei Barbu 5 | maintainer: andrei@0xab.com 6 | copyright: Andrei Barbu 2019, 2021 7 | license: BSD3 8 | github: SimulaVR/godot-haskell 9 | extra-source-files: 10 | - ChangeLog.md 11 | - README.md 12 | dependencies: 13 | - base >=4.12 && <5 14 | - godot-haskell 15 | - linear 16 | - random 17 | - text 18 | - vector 19 | - strict-concurrency 20 | - lens 21 | - template-haskell 22 | - th-abstraction 23 | - containers 24 | - extra 25 | - monad-loops 26 | - xeno 27 | - aeson 28 | - directory 29 | library: 30 | source-dirs: 31 | - src 32 | - game 33 | default-extensions: 34 | - FlexibleContexts 35 | - MultiParamTypeClasses 36 | - OverloadedStrings 37 | - TemplateHaskell 38 | - TypeApplications 39 | - TypeFamilies 40 | - DataKinds 41 | - FlexibleInstances 42 | - ScopedTypeVariables 43 | - AllowAmbiguousTypes 44 | - TypeOperators 45 | - TupleSections 46 | exposed-modules: 47 | - Lib 48 | ghc-options: -Wall -Wno-orphans -O0 49 | 50 | verbatim: | 51 | foreign-library myproject 52 | type: native-shared 53 | other-modules: FLib 54 | hs-source-dirs: ffi/flib 55 | c-sources: ffi/cbits/flib.c 56 | build-depends: 57 | base >= 4.12 && <5 58 | , godot-haskell 59 | , myproject 60 | , text 61 | default-language: Haskell2010 62 | -------------------------------------------------------------------------------- /examples/rss-reader/pinned-nixpkgs.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | # 19.03-beta (25 feb) 5 | rev = "0c0954781e257b8b0dc49341795a2fe7d96945a3"; # pinned-nixpkgs rev 6 | pkgs = import (builtins.fetchTarball { 7 | url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; 8 | }) {}; 9 | in 10 | pkgs 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/rss-reader/shell.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs ? import ./pinned-nixpkgs.nix {} 2 | , compiler ? "default" 3 | , doBenchmark ? false }: 4 | 5 | 6 | let 7 | 8 | inherit (nixpkgs) pkgs; 9 | 10 | haskellPackages = if compiler == "default" 11 | then pkgs.haskellPackages 12 | else pkgs.haskell.packages.${compiler}; 13 | 14 | f = { mkDerivation, stdenv, base, godot-haskell, linear, text , vector, stm }: 15 | mkDerivation { 16 | pname = "myproject"; 17 | version = "3.1.0.0"; 18 | src = ./.; 19 | libraryHaskellDepends = [ 20 | base godot-haskell linear text vector stm 21 | ]; 22 | libraryToolDepends = []; 23 | homepage = "https://github.com/abarbu/myproject#readme"; 24 | license = stdenv.lib.licenses.bsd3; 25 | }; 26 | 27 | variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; 28 | 29 | drv = variant (haskellPackages.callPackage f { 30 | godot-haskell = haskellPackages.callPackage ./godot-haskell.nix {fetchFromGitHub = pkgs.fetchFromGitHub;}; 31 | }); 32 | 33 | in 34 | 35 | if pkgs.lib.inNixShell then drv.env else drv 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/rss-reader/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib (exports) where 2 | import Godot 3 | import Project.Support 4 | import Project.Requirements 5 | import Game.RSSReader 6 | 7 | exports :: GdnativeHandle -> IO () 8 | exports = registerAll' @Nodes @'[RSSReader] 9 | -------------------------------------------------------------------------------- /examples/rss-reader/src/Project/Requirements.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | module Project.Requirements where 4 | import Project.Support 5 | 6 | type Nodes = '[OneResourceNode "Rss_reader" "RSSReader"] 7 | -------------------------------------------------------------------------------- /examples/rss-reader/src/Project/Scenes.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | module Project.Scenes (module M) where 4 | import qualified Project.Scenes.Rss_reader as M 5 | 6 | -------------------------------------------------------------------------------- /examples/rss-reader/stack-shell.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs ? import ./pinned-nixpkgs.nix {} 2 | , ghc 3 | }: 4 | 5 | with nixpkgs; 6 | 7 | haskell.lib.buildStackProject { 8 | inherit ghc; 9 | name = "myproject"; 10 | buildInputs = []; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/rss-reader/stack.yaml: -------------------------------------------------------------------------------- 1 | resolver: nightly-2021-02-06 2 | 3 | packages: 4 | - . 5 | 6 | extra-deps: 7 | - ../../ 8 | 9 | require-stack-version: ">=1.8" 10 | 11 | nix: 12 | enable: false 13 | pure: true 14 | packages: [] 15 | shell-file: stack-shell.nix 16 | nix-shell-options: [] 17 | path: [] 18 | add-gc-roots: false 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/rss-reader/stack.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/lock_files 5 | 6 | packages: [] 7 | snapshots: 8 | - completed: 9 | size: 565469 10 | url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2021/2/6.yaml 11 | sha256: 7108f8cb8c928699c6c3c6574d3f6fc132db8bbba6a3987f9446fb35fd67dbf6 12 | original: nightly-2021-02-06 13 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/.gitignore: -------------------------------------------------------------------------------- 1 | dist* 2 | *.hi 3 | *.o 4 | .stack-work/ 5 | .stack-work-devel/ 6 | *~ 7 | \#* 8 | *.import 9 | result 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/ChangeLog.md: -------------------------------------------------------------------------------- 1 | # Empty 2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) Andrei Barbu 2019 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/Makefile: -------------------------------------------------------------------------------- 1 | NAME = top-down-ten-minutes 2 | STACKLIBFILE = $(shell stack path --local-install-root)/lib/lib$(NAME).so 3 | GODOTPROJECT = $(shell stack path --project-root)/game 4 | all: stack 5 | nix: 6 | nix-build shell.nix 7 | cp result/lib/ghc-*/lib$(NAME).so $(GODOTPROJECT)/lib 8 | stack: 9 | stack build --fast --force-dirty 10 | cp $(STACKLIBFILE) $(GODOTPROJECT)/lib 11 | stack-nix: 12 | stack --nix clean $(NAME) 13 | stack --nix build 14 | cp $(shell stack --nix path --local-install-root)/lib/lib$(NAME).so $(GODOTPROJECT)/lib 15 | stack-run: 16 | stack build 17 | cp $(STACKLIBFILE) $(GODOTPROJECT)/lib 18 | godot -e --path ./game 19 | stack-watch: 20 | stack build --file-watch --fast --exec "cp $(STACKLIBFILE) $(GODOTPROJECT)/lib" 21 | project-watch: 22 | stack exec godot-haskell-project-generator game src 23 | updatelib: 24 | cp $(STACKLIBFILE) $(GODOTPROJECT)/lib 25 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/README.md: -------------------------------------------------------------------------------- 1 | The official Godot demo from the manual: Dodge the Creeps. 2 | 3 | Run with `make stack` then `godot game/project.godot` and press F5 to start, F8 to end. 4 | 5 | Requires Godot 3.1 6 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/ffi/cbits/flib.c: -------------------------------------------------------------------------------- 1 | #include "HsFFI.h" 2 | 3 | static void flib_init() __attribute__((constructor)); 4 | static void flib_init() { 5 | static char *argv[] = { "libGodotHaskellPlugin.so", 0 }, **argv_ = argv; 6 | static int argc = 1; 7 | hs_init(&argc, &argv_); 8 | } 9 | 10 | static void flib_fini() __attribute__((destructor)); 11 | static void flib_fini() { 12 | hs_exit(); 13 | } 14 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/ffi/flib/FLib.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE ForeignFunctionInterface #-} 2 | module FLib where 3 | 4 | import qualified Foreign 5 | import Foreign(nullPtr, Ptr,newForeignPtr_,castPtr) 6 | import qualified Godot.Gdnative.Internal as FFI 7 | import Godot.Gdnative 8 | import Godot.Nativescript 9 | import Lib 10 | import qualified Data.Text as T 11 | import qualified Data.Text.IO as T 12 | 13 | godot_nativescript_init :: GdnativeHandle -> IO () 14 | godot_nativescript_init desc = do 15 | defaultExports desc 16 | exports desc 17 | putStrLn "Haskell NativeScript lib initialized" 18 | 19 | foreign export ccall godot_nativescript_init :: GdnativeHandle -> IO () 20 | 21 | 22 | godot_gdnative_init :: FFI.GdnativeInitOptionsPtr -> IO () 23 | godot_gdnative_init opts = do 24 | Foreign.peek opts >>= FFI.initApiStructs 25 | 26 | foreign export ccall godot_gdnative_init :: FFI.GdnativeInitOptionsPtr -> IO () 27 | 28 | 29 | godot_gdnative_terminate :: FFI.GdnativeTerminateOptionsPtr -> IO () 30 | godot_gdnative_terminate handle = pure () 31 | 32 | foreign export ccall godot_gdnative_terminate :: FFI.GdnativeTerminateOptionsPtr -> IO () 33 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/game/Bullet.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://lib/libtop-down-ten-minutes.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "Bullet" 7 | class_name = "Bullet" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/game/Bullet.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://Player.png" type="Texture" id=1] 4 | [ext_resource path="res://Bullet.gdns" type="Script" id=2] 5 | 6 | [sub_resource type="RectangleShape2D" id=1] 7 | extents = Vector2( 4, 1.6 ) 8 | 9 | [sub_resource type="Animation" id=2] 10 | resource_name = "fadeout" 11 | length = 0.4 12 | tracks/0/type = "value" 13 | tracks/0/path = NodePath("Sprite:modulate") 14 | tracks/0/interp = 1 15 | tracks/0/loop_wrap = true 16 | tracks/0/imported = false 17 | tracks/0/enabled = true 18 | tracks/0/keys = { 19 | "times": PoolRealArray( 0, 0.3 ), 20 | "transitions": PoolRealArray( 1, 1 ), 21 | "update": 0, 22 | "values": [ Color( 1, 1, 1, 1 ), Color( 0.45098, 0.447059, 0.447059, 0 ) ] 23 | } 24 | 25 | [node name="Bullet" type="RigidBody2D"] 26 | collision_layer = 8 27 | continuous_cd = 1 28 | contacts_reported = 1 29 | contact_monitor = true 30 | script = ExtResource( 2 ) 31 | 32 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 33 | shape = SubResource( 1 ) 34 | 35 | [node name="Sprite" type="Sprite" parent="."] 36 | scale = Vector2( 0.5, 0.2 ) 37 | texture = ExtResource( 1 ) 38 | 39 | [node name="AnimationPlayer" type="AnimationPlayer" parent="."] 40 | anims/fadeout = SubResource( 2 ) 41 | [connection signal="body_entered" from="." to="." method="_on_Bullet_body_entered"] 42 | [connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"] 43 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/game/Enemy.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://lib/libtop-down-ten-minutes.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "Enemy" 7 | class_name = "Enemy" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/game/Enemy.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=5 format=2] 2 | 3 | [ext_resource path="res://Player.png" type="Texture" id=1] 4 | [ext_resource path="res://Enemy.gdns" type="Script" id=2] 5 | 6 | [sub_resource type="RectangleShape2D" id=1] 7 | extents = Vector2( 6.4, 6.4 ) 8 | 9 | [sub_resource type="RectangleShape2D" id=2] 10 | extents = Vector2( 7.3, 7.3 ) 11 | 12 | [node name="Enemy" type="KinematicBody2D"] 13 | collision_layer = 4 14 | collision_mask = 15 15 | script = ExtResource( 2 ) 16 | 17 | [node name="CollisionShape2D" type="CollisionShape2D" parent="."] 18 | shape = SubResource( 1 ) 19 | 20 | [node name="Sprite" type="Sprite" parent="."] 21 | modulate = Color( 0.709804, 0.180392, 0.180392, 1 ) 22 | scale = Vector2( 0.8, 0.8 ) 23 | texture = ExtResource( 1 ) 24 | 25 | [node name="Area2D" type="Area2D" parent="."] 26 | priority = 1.0 27 | collision_layer = 0 28 | collision_mask = 8 29 | 30 | [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] 31 | shape = SubResource( 2 ) 32 | [connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"] 33 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/game/Explosion.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=2] 2 | 3 | [sub_resource type="Curve" id=1] 4 | _data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), 0.0, 0.0, 0, 0 ] 5 | 6 | [sub_resource type="CurveTexture" id=2] 7 | curve = SubResource( 1 ) 8 | 9 | [sub_resource type="ParticlesMaterial" id=3] 10 | emission_shape = 1 11 | emission_sphere_radius = 1.0 12 | flag_disable_z = true 13 | spread = 180.0 14 | gravity = Vector3( 0, 0, 0 ) 15 | initial_velocity = 60.0 16 | initial_velocity_random = 0.75 17 | orbit_velocity = 0.0 18 | orbit_velocity_random = 0.0 19 | tangential_accel = 20.0 20 | tangential_accel_random = 0.3 21 | scale = 5.0 22 | scale_random = 0.4 23 | scale_curve = SubResource( 2 ) 24 | color = Color( 0.866667, 0.160784, 0.160784, 1 ) 25 | 26 | [node name="Particles2D" type="Particles2D"] 27 | scale = Vector2( 2, 2 ) 28 | emitting = false 29 | amount = 30 30 | lifetime = 0.3 31 | one_shot = true 32 | explosiveness = 1.0 33 | randomness = 0.5 34 | process_material = SubResource( 3 ) 35 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/game/Player.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://lib/libtop-down-ten-minutes.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | resource_name = "Player" 7 | class_name = "Player" 8 | library = ExtResource( 1 ) 9 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/game/Player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/top-down-ten-minutes/game/Player.png -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/game/lib/libtop-down-ten-minutes.gdnlib: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | singleton=false 4 | load_once=false 5 | symbol_prefix="godot_" 6 | reloadable=true 7 | 8 | [entry] 9 | 10 | X11.64="res://lib/libtop-down-ten-minutes.so" 11 | 12 | [dependencies] 13 | 14 | X11.64=[ ] 15 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/game/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="Top Down Ten Minutes" 19 | run/main_scene="res://world.tscn" 20 | 21 | [audio] 22 | 23 | default_bus_layout="" 24 | 25 | [display] 26 | 27 | window/dpi/allow_hidpi=true 28 | 29 | [gdnative] 30 | 31 | singletons=[ ] 32 | 33 | [input] 34 | 35 | right={ 36 | "deadzone": 0.5, 37 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null) 38 | ] 39 | } 40 | left={ 41 | "deadzone": 0.5, 42 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null) 43 | ] 44 | } 45 | up={ 46 | "deadzone": 0.5, 47 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) 48 | ] 49 | } 50 | down={ 51 | "deadzone": 0.5, 52 | "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) 53 | ] 54 | } 55 | LMB={ 56 | "deadzone": 0.5, 57 | "events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) 58 | ] 59 | } 60 | 61 | [layer_names] 62 | 63 | 2d_physics/layer_1="World" 64 | 2d_physics/layer_2="Player" 65 | 2d_physics/layer_3="Enemies" 66 | 2d_physics/layer_4="Bullets" 67 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/game/spotlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/examples/top-down-ten-minutes/game/spotlight.png -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/game/wall.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="TileSet" load_steps=4 format=2] 2 | 3 | [ext_resource path="res://Player.png" type="Texture" id=1] 4 | 5 | [sub_resource type="OccluderPolygon2D" id=1] 6 | polygon = PoolVector2Array( -7.97656, -8.02344, -7.96094, 8.03125, 7.98438, 7.97735, 7.98438, 7.97735, 7.99219, -8.01562 ) 7 | 8 | [sub_resource type="RectangleShape2D" id=2] 9 | extents = Vector2( 8, 8 ) 10 | 11 | [resource] 12 | 0/name = "Sprite" 13 | 0/texture = ExtResource( 1 ) 14 | 0/tex_offset = Vector2( 0, 0 ) 15 | 0/modulate = Color( 0, 0, 0, 1 ) 16 | 0/region = Rect2( 0, 0, 16, 16 ) 17 | 0/tile_mode = 0 18 | 0/occluder_offset = Vector2( 8, 8 ) 19 | 0/occluder = SubResource( 1 ) 20 | 0/navigation_offset = Vector2( 8, 8 ) 21 | 0/shape_offset = Vector2( 8, 8 ) 22 | 0/shape_transform = Transform2D( 1, 0, 0, 1, 8, 8 ) 23 | 0/shape = SubResource( 2 ) 24 | 0/shape_one_way = false 25 | 0/shape_one_way_margin = 1.0 26 | 0/shapes = [ { 27 | "autotile_coord": Vector2( 0, 0 ), 28 | "one_way": false, 29 | "one_way_margin": 1.0, 30 | "shape": SubResource( 2 ), 31 | "shape_transform": Transform2D( 1, 0, 0, 1, 8, 8 ) 32 | } ] 33 | 0/z_index = 0 34 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/godot-haskell.nix: -------------------------------------------------------------------------------- 1 | { fetchFromGitHub, mkDerivation, aeson, ansi-wl-pprint, base, bytestring, c2hs 2 | , casing, colour, containers, hpack, lens, linear, mtl, parsec 3 | , parsers, stdenv, stm, template-haskell, text 4 | , unordered-containers, vector 5 | }: 6 | mkDerivation { 7 | pname = "godot-haskell"; 8 | version = "3.1.0.0"; 9 | src = fetchFromGitHub { 10 | owner = "SimulaVR"; 11 | repo = "godot-haskell"; 12 | rev = "b423d4f2fa5a6a3dcfffb82bb36be571adb29d34"; # godot-haskell rev 13 | # Use nix-prefetch-git to get the hash 14 | sha256 = "0jh2j5rr90dqdxvcipygwnhhj7j2dj4zvm6gbdpg106ll60pyqrp"; 15 | fetchSubmodules = true; 16 | }; 17 | libraryHaskellDepends = [ 18 | aeson ansi-wl-pprint base bytestring casing colour containers lens 19 | linear mtl parsec parsers stm template-haskell text 20 | unordered-containers vector 21 | ]; 22 | libraryToolDepends = [ c2hs hpack ]; 23 | doHaddock = false; 24 | preConfigure = "hpack"; 25 | homepage = "https://github.com/KaneTW/godot-haskell#readme"; 26 | description = "Haskell bindings for the Godot game engine API"; 27 | license = stdenv.lib.licenses.bsd3; 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/hie.yaml: -------------------------------------------------------------------------------- 1 | cradle: 2 | stack: 3 | - path: "./src" 4 | component: "top-down-ten-minutes:lib" 5 | 6 | - path: "./game" 7 | component: "top-down-ten-minutes:lib" 8 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/package.yaml: -------------------------------------------------------------------------------- 1 | name: top-down-ten-minutes 2 | version: '0.0.0.0' 3 | description: Please see the README on Github at 4 | author: Andrei Barbu 5 | maintainer: andrei@0xab.com 6 | copyright: Andrei Barbu 2019, 2021 7 | license: BSD3 8 | github: SimulaVR/godot-haskell 9 | extra-source-files: 10 | - ChangeLog.md 11 | - README.md 12 | dependencies: 13 | - base >=4.12 && <5 14 | - godot-haskell 15 | - linear 16 | - random 17 | - text 18 | - vector 19 | - strict-concurrency 20 | - lens 21 | - template-haskell 22 | - th-abstraction 23 | - containers 24 | - extra 25 | - mono-traversable 26 | library: 27 | source-dirs: 28 | - src 29 | - game 30 | default-extensions: 31 | - FlexibleContexts 32 | - MultiParamTypeClasses 33 | - OverloadedStrings 34 | - TemplateHaskell 35 | - TypeApplications 36 | - TypeFamilies 37 | - DataKinds 38 | - FlexibleInstances 39 | - ScopedTypeVariables 40 | - AllowAmbiguousTypes 41 | - TupleSections 42 | - FunctionalDependencies 43 | - LambdaCase 44 | - TypeOperators 45 | exposed-modules: 46 | - Lib 47 | ghc-options: -Wall -Wno-orphans -O0 -Wno-name-shadowing 48 | 49 | verbatim: | 50 | foreign-library top-down-ten-minutes 51 | type: native-shared 52 | other-modules: FLib 53 | hs-source-dirs: ffi/flib 54 | c-sources: ffi/cbits/flib.c 55 | build-depends: 56 | base >= 4.12 && <5 57 | , godot-haskell 58 | , top-down-ten-minutes 59 | , text 60 | default-language: Haskell2010 61 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/pinned-nixpkgs.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | 3 | let 4 | # 19.03-beta (25 feb) 5 | rev = "0c0954781e257b8b0dc49341795a2fe7d96945a3"; # pinned-nixpkgs rev 6 | pkgs = import (builtins.fetchTarball { 7 | url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz"; 8 | }) {}; 9 | in 10 | pkgs 11 | 12 | 13 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/shell.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs ? import ./pinned-nixpkgs.nix {} 2 | , compiler ? "default" 3 | , doBenchmark ? false }: 4 | 5 | 6 | let 7 | 8 | inherit (nixpkgs) pkgs; 9 | 10 | haskellPackages = if compiler == "default" 11 | then pkgs.haskellPackages 12 | else pkgs.haskell.packages.${compiler}; 13 | 14 | f = { mkDerivation, stdenv, base, godot-haskell, linear, text , vector, stm }: 15 | mkDerivation { 16 | pname = "top-down-ten-minutes"; 17 | version = "3.1.0.0"; 18 | src = ./.; 19 | libraryHaskellDepends = [ 20 | base godot-haskell linear text vector stm 21 | ]; 22 | libraryToolDepends = []; 23 | homepage = "https://github.com/abarbu/top-down-ten-minutes#readme"; 24 | license = stdenv.lib.licenses.bsd3; 25 | }; 26 | 27 | variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; 28 | 29 | drv = variant (haskellPackages.callPackage f { 30 | godot-haskell = haskellPackages.callPackage ./godot-haskell.nix {fetchFromGitHub = pkgs.fetchFromGitHub;}; 31 | }); 32 | 33 | in 34 | 35 | if pkgs.lib.inNixShell then drv.env else drv 36 | 37 | 38 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/src/Lib.hs: -------------------------------------------------------------------------------- 1 | module Lib (exports) where 2 | import Godot 3 | import Project.Support 4 | import Project.Requirements 5 | import Game.World 6 | 7 | exports :: GdnativeHandle -> IO () 8 | exports = registerAll' @Nodes @'[Bullet,Enemy,Player] 9 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/src/Project/Requirements.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | module Project.Requirements where 4 | import Project.Support 5 | 6 | type Nodes = '[OneResourceNode "Bullet" "Bullet", OneResourceNode "Enemy" "Enemy", OneResourceNode "Player" "Player"] 7 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/src/Project/Scenes.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | module Project.Scenes (module M) where 4 | import qualified Project.Scenes.Bullet as M 5 | import qualified Project.Scenes.Enemy as M 6 | import qualified Project.Scenes.Explosion as M 7 | import qualified Project.Scenes.World as M 8 | 9 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/src/Project/Scenes/Bullet.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | {-# LANGUAGE FlexibleContexts, FunctionalDependencies, MultiParamTypeClasses, 4 | UndecidableInstances, OverloadedStrings, TemplateHaskell, TypeApplications, 5 | TypeFamilies, DataKinds, TypeOperators, FlexibleInstances, RankNTypes, 6 | AllowAmbiguousTypes, ScopedTypeVariables, DerivingStrategies, 7 | GeneralizedNewtypeDeriving, LambdaCase #-} 8 | 9 | module Project.Scenes.Bullet where 10 | import Project.Support 11 | import Godot 12 | import GHC.TypeLits 13 | 14 | import Godot.Core.AnimationPlayer() 15 | import Godot.Core.RigidBody2D() 16 | import Godot.Core.CollisionShape2D() 17 | import Godot.Core.Sprite() 18 | 19 | instance SceneResourcePath "Bullet" where 20 | sceneResourcePath = "res://Bullet.tscn" 21 | 22 | 23 | instance SceneRoot "Bullet" where 24 | type SceneRootNode "Bullet" = "Bullet" 25 | 26 | 27 | instance SceneNode "Bullet" "AnimationPlayer" where 28 | type SceneNodeType "Bullet" "AnimationPlayer" = AnimationPlayer 29 | type SceneNodeName "Bullet" "AnimationPlayer" = "AnimationPlayer" 30 | type SceneNodeIsHaskell "Bullet" "AnimationPlayer" = 'Nothing 31 | 32 | 33 | instance SceneNode "Bullet" "Bullet" where 34 | type SceneNodeType "Bullet" "Bullet" = RigidBody2D 35 | type SceneNodeName "Bullet" "Bullet" = "Bullet" 36 | type SceneNodeIsHaskell "Bullet" "Bullet" = 'Just '("Bullet", "Bullet") 37 | 38 | 39 | instance SceneNode "Bullet" "CollisionShape2D" where 40 | type SceneNodeType "Bullet" "CollisionShape2D" = CollisionShape2D 41 | type SceneNodeName "Bullet" "CollisionShape2D" = "CollisionShape2D" 42 | type SceneNodeIsHaskell "Bullet" "CollisionShape2D" = 'Nothing 43 | 44 | 45 | instance SceneNode "Bullet" "Sprite" where 46 | type SceneNodeType "Bullet" "Sprite" = Sprite 47 | type SceneNodeName "Bullet" "Sprite" = "Sprite" 48 | type SceneNodeIsHaskell "Bullet" "Sprite" = 'Nothing 49 | 50 | 51 | instance SceneConnection "Bullet" "AnimationPlayer" "animation_finished" "Bullet" "_on_AnimationPlayer_animation_finished" 52 | 53 | 54 | instance SceneConnection "Bullet" "Bullet" "body_entered" "Bullet" "_on_Bullet_body_entered" 55 | 56 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/src/Project/Scenes/Enemy.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | {-# LANGUAGE FlexibleContexts, FunctionalDependencies, MultiParamTypeClasses, 4 | UndecidableInstances, OverloadedStrings, TemplateHaskell, TypeApplications, 5 | TypeFamilies, DataKinds, TypeOperators, FlexibleInstances, RankNTypes, 6 | AllowAmbiguousTypes, ScopedTypeVariables, DerivingStrategies, 7 | GeneralizedNewtypeDeriving, LambdaCase #-} 8 | 9 | module Project.Scenes.Enemy where 10 | import Project.Support 11 | import Godot 12 | import GHC.TypeLits 13 | 14 | import Godot.Core.Area2D() 15 | import Godot.Core.CollisionShape2D() 16 | import Godot.Core.KinematicBody2D() 17 | import Godot.Core.Sprite() 18 | 19 | instance SceneResourcePath "Enemy" where 20 | sceneResourcePath = "res://Enemy.tscn" 21 | 22 | 23 | instance SceneRoot "Enemy" where 24 | type SceneRootNode "Enemy" = "Enemy" 25 | 26 | 27 | instance SceneNode "Enemy" "Area2D" where 28 | type SceneNodeType "Enemy" "Area2D" = Area2D 29 | type SceneNodeName "Enemy" "Area2D" = "Area2D" 30 | type SceneNodeIsHaskell "Enemy" "Area2D" = 'Nothing 31 | 32 | 33 | instance SceneNode "Enemy" "Area2D/CollisionShape2D" where 34 | type SceneNodeType "Enemy" "Area2D/CollisionShape2D" = CollisionShape2D 35 | type SceneNodeName "Enemy" "Area2D/CollisionShape2D" = "CollisionShape2D" 36 | type SceneNodeIsHaskell "Enemy" "Area2D/CollisionShape2D" = 'Nothing 37 | 38 | 39 | instance SceneNode "Enemy" "Enemy" where 40 | type SceneNodeType "Enemy" "Enemy" = KinematicBody2D 41 | type SceneNodeName "Enemy" "Enemy" = "Enemy" 42 | type SceneNodeIsHaskell "Enemy" "Enemy" = 'Just '("Enemy", "Enemy") 43 | 44 | 45 | instance SceneNode "Enemy" "Sprite" where 46 | type SceneNodeType "Enemy" "Sprite" = Sprite 47 | type SceneNodeName "Enemy" "Sprite" = "Sprite" 48 | type SceneNodeIsHaskell "Enemy" "Sprite" = 'Nothing 49 | 50 | 51 | instance SceneConnection "Enemy" "Area2D" "body_entered" "Enemy" "_on_Area2D_body_entered" 52 | 53 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/src/Project/Scenes/Explosion.hs: -------------------------------------------------------------------------------- 1 | -- | This file is AUTOGENERATED by godot-haskell-project-generator. DO NOT EDIT 2 | 3 | {-# LANGUAGE FlexibleContexts, FunctionalDependencies, MultiParamTypeClasses, 4 | UndecidableInstances, OverloadedStrings, TemplateHaskell, TypeApplications, 5 | TypeFamilies, DataKinds, TypeOperators, FlexibleInstances, RankNTypes, 6 | AllowAmbiguousTypes, ScopedTypeVariables, DerivingStrategies, 7 | GeneralizedNewtypeDeriving, LambdaCase #-} 8 | 9 | module Project.Scenes.Explosion where 10 | import Project.Support 11 | import Godot 12 | import GHC.TypeLits 13 | 14 | import Godot.Core.Particles2D() 15 | 16 | instance SceneResourcePath "Explosion" where 17 | sceneResourcePath = "res://Explosion.tscn" 18 | 19 | 20 | instance SceneRoot "Explosion" where 21 | type SceneRootNode "Explosion" = "Particles2D" 22 | 23 | 24 | instance SceneNode "Explosion" "Particles2D" where 25 | type SceneNodeType "Explosion" "Particles2D" = Particles2D 26 | type SceneNodeName "Explosion" "Particles2D" = "Particles2D" 27 | type SceneNodeIsHaskell "Explosion" "Particles2D" = 'Nothing 28 | 29 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/stack-shell.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs ? import ./pinned-nixpkgs.nix {} 2 | , ghc 3 | }: 4 | 5 | with nixpkgs; 6 | 7 | haskell.lib.buildStackProject { 8 | inherit ghc; 9 | name = "top-down-ten-minutes"; 10 | buildInputs = []; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/stack.yaml: -------------------------------------------------------------------------------- 1 | resolver: nightly-2021-02-06 2 | 3 | packages: 4 | - . 5 | 6 | extra-deps: 7 | - ../../ 8 | 9 | require-stack-version: ">=1.8" 10 | 11 | nix: 12 | enable: false 13 | pure: true 14 | packages: [] 15 | shell-file: stack-shell.nix 16 | nix-shell-options: [] 17 | path: [] 18 | add-gc-roots: false 19 | 20 | 21 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/stack.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/lock_files 5 | 6 | packages: [] 7 | snapshots: 8 | - completed: 9 | size: 565469 10 | url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2021/2/6.yaml 11 | sha256: 7108f8cb8c928699c6c3c6574d3f6fc132db8bbba6a3987f9446fb35fd67dbf6 12 | original: nightly-2021-02-06 13 | -------------------------------------------------------------------------------- /examples/top-down-ten-minutes/top-down-ten-minutes.cabal: -------------------------------------------------------------------------------- 1 | cabal-version: 1.12 2 | 3 | -- This file has been generated from package.yaml by hpack version 0.33.0. 4 | -- 5 | -- see: https://github.com/sol/hpack 6 | -- 7 | -- hash: 10ec9e894d9fdb50a0b9d9dcb3b406e33d320e82e151cfe5d0ef335c059e3aad 8 | 9 | name: top-down-ten-minutes 10 | version: 0.0.0.0 11 | description: Please see the README on Github at 12 | homepage: https://github.com/SimulaVR/godot-haskell#readme 13 | bug-reports: https://github.com/SimulaVR/godot-haskell/issues 14 | author: Andrei Barbu 15 | maintainer: andrei@0xab.com 16 | copyright: Andrei Barbu 2019, 2021 17 | license: BSD3 18 | license-file: LICENSE 19 | build-type: Simple 20 | extra-source-files: 21 | ChangeLog.md 22 | README.md 23 | foreign-library top-down-ten-minutes 24 | type: native-shared 25 | other-modules: FLib 26 | hs-source-dirs: ffi/flib 27 | c-sources: ffi/cbits/flib.c 28 | build-depends: 29 | base >= 4.12 && <5 30 | , godot-haskell 31 | , top-down-ten-minutes 32 | , text 33 | default-language: Haskell2010 34 | 35 | source-repository head 36 | type: git 37 | location: https://github.com/SimulaVR/godot-haskell 38 | 39 | library 40 | exposed-modules: 41 | Lib 42 | other-modules: 43 | Game.World 44 | Project.Requirements 45 | Project.Scenes 46 | Project.Scenes.Bullet 47 | Project.Scenes.Enemy 48 | Project.Scenes.Explosion 49 | Project.Scenes.World 50 | Project.Support 51 | Paths_top_down_ten_minutes 52 | hs-source-dirs: 53 | src 54 | game 55 | default-extensions: FlexibleContexts MultiParamTypeClasses OverloadedStrings TemplateHaskell TypeApplications TypeFamilies DataKinds FlexibleInstances ScopedTypeVariables AllowAmbiguousTypes TupleSections FunctionalDependencies LambdaCase TypeOperators 56 | ghc-options: -Wall -Wno-orphans -O0 -Wno-name-shadowing 57 | build-depends: 58 | base >=4.12 && <5 59 | , containers 60 | , extra 61 | , godot-haskell 62 | , lens 63 | , linear 64 | , mono-traversable 65 | , random 66 | , strict-concurrency 67 | , template-haskell 68 | , text 69 | , th-abstraction 70 | , vector 71 | default-language: Haskell2010 72 | -------------------------------------------------------------------------------- /hie.yaml: -------------------------------------------------------------------------------- 1 | cradle: 2 | stack: 3 | - path: "./src" 4 | component: "godot-haskell:lib" 5 | 6 | - path: "./src-generate" 7 | component: "godot-haskell:lib:generate" 8 | 9 | - path: "./project-generator/Main.hs" 10 | component: "godot-haskell:exe:godot-haskell-project-generator" 11 | -------------------------------------------------------------------------------- /nix/pinned/all-hies.json: -------------------------------------------------------------------------------- 1 | { 2 | "url": "https://github.com/Infinisil/all-hies.git", 3 | "rev": "d98bdbff3ebdab408a12a9b7890d4cf400180839", 4 | "date": "2020-02-17T18:53:14+01:00", 5 | "sha256": "1lr4dw10f37fp68b6ig065dgrl8h1v4xmigy5ncljdz74k0jvhg4", 6 | "fetchSubmodules": true, 7 | "deepClone": false, 8 | "leaveDotGit": false 9 | } 10 | -------------------------------------------------------------------------------- /nix/pinned/default.nix: -------------------------------------------------------------------------------- 1 | { fetchFromGitHub, lib }: 2 | 3 | let 4 | fetch = owner: repo: jsonFile: fetchFromGitHub { 5 | inherit owner repo; 6 | inherit (lib.importJSON jsonFile) rev sha256; 7 | }; 8 | 9 | in { 10 | nixpkgs = import (fetch "NixOS" "nix-channels" ./nixpkgs.json) {}; 11 | hie = { ghc, useSystem ? true, useLatest ? false, versions ? [] }: 12 | import ./hie.nix { 13 | inherit fetchFromGitHub lib ghc useSystem useLatest versions; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /nix/pinned/hie.nix: -------------------------------------------------------------------------------- 1 | { fetchFromGitHub, lib, ghc, useSystem ? true, useLatest ? false, versions ? [] }: 2 | 3 | let 4 | fetch = owner: repo: jsonFile: fetchFromGitHub { 5 | inherit owner repo; 6 | inherit (lib.importJSON jsonFile) rev sha256; 7 | }; 8 | all-hies = import (fetch "Infinisil" "all-hies" ./all-hies.json) {}; 9 | ghcVersionList = builtins.splitVersion ghc.version; 10 | ghcVersionToString = builtins.foldl' (x: y: x + y) "" ghcVersionList; 11 | ghcVersionKey = "ghc${ghcVersionToString}"; 12 | versionList = versions 13 | ++ (if useSystem then [ ghcVersionKey ] else []) 14 | ++ (if useLatest then [ lib.last (lib.attrValues versions) ] else []); 15 | selector = p: 16 | builtins.foldl' 17 | (a: b: a // b) 18 | {} 19 | (map (v: { ${v} = p.${v}; }) versionList); 20 | in all-hies.selection { selector = selector; } 21 | -------------------------------------------------------------------------------- /nix/pinned/nixpkgs.json: -------------------------------------------------------------------------------- 1 | { 2 | "url": "https://github.com/nixos/nixpkgs-channels.git", 3 | "rev": "ce9f1aaa39ee2a5b76a9c9580c859a74de65ead5", 4 | "date": "2020-02-27T20:22:41+01:00", 5 | "sha256": "1s2b9rvpyamiagvpl5cggdb2nmx4f7lpylipd397wz8f0wngygpi", 6 | "fetchSubmodules": false, 7 | "deepClone": false, 8 | "leaveDotGit": false 9 | } 10 | -------------------------------------------------------------------------------- /nix/spacemacs-hie.nix: -------------------------------------------------------------------------------- 1 | { pkgs, hsPkgs }: 2 | let 3 | pinned = import ./pinned { inherit (pkgs) fetchFromGitHub lib; }; 4 | hie = pinned.hie { inherit (hsPkgs) ghc; }; 5 | 6 | emacsPkgs = (with pkgs; [ 7 | emacs 8 | emacs-all-the-icons-fonts 9 | dejavu_fonts 10 | material-design-icons 11 | # nerdfonts 12 | source-code-pro 13 | weather-icons 14 | ]); 15 | 16 | in emacsPkgs ++ [ 17 | hie 18 | ] ++ (with hsPkgs; [ 19 | apply-refact 20 | brittany 21 | cabal-install 22 | Cabal_3_0_0_0 23 | # Cabal_2_4_1_0 24 | hasktags 25 | hlint 26 | hoogle 27 | ]) 28 | -------------------------------------------------------------------------------- /nixpkgs-version.json: -------------------------------------------------------------------------------- 1 | { 2 | "url": "https://github.com/nixos/nixpkgs-channels.git", 3 | "rev": "c8db7a8a16ee9d54103cade6e766509e1d1c8d7b", 4 | "date": "2020-01-11T14:34:27-05:00", 5 | "sha256": "1b3h4mwpi10blzpvgsc0191k4shaw3nw0qd2p82hygbr8vv4g9dv", 6 | "fetchSubmodules": false 7 | } 8 | -------------------------------------------------------------------------------- /package.yaml: -------------------------------------------------------------------------------- 1 | name: godot-haskell 2 | synopsis: Haskell bindings for the Godot game engine API 3 | description: This package contains Haskell bindings for GDNative and the Godot API. For details and examples, see README.md 4 | version: '3.1.0.0' 5 | category: Web 6 | author: David Kraeutmann 7 | maintainer: kane@kane.cx 8 | copyright: 2018 David Kraeutmann 9 | license: BSD3 10 | github: KaneTW/godot-haskell 11 | extra-source-files: 12 | - README.md 13 | - cbits/* 14 | - godot_headers/**/*.h 15 | - godot_headers/**/*.json 16 | 17 | dependencies: 18 | - base 19 | - aeson 20 | - bytestring 21 | - template-haskell 22 | - th-abstraction 23 | - lens 24 | - text 25 | - casing 26 | - vector 27 | - containers 28 | - unordered-containers 29 | - mtl 30 | - stm 31 | - extra 32 | 33 | default-extensions: 34 | - FlexibleContexts 35 | - FlexibleInstances 36 | - ScopedTypeVariables 37 | - TypeApplications 38 | - StandaloneDeriving 39 | - DerivingStrategies 40 | - DefaultSignatures 41 | - MultiParamTypeClasses 42 | - FunctionalDependencies 43 | - TypeFamilies 44 | - TemplateHaskell 45 | - TypeOperators 46 | - TypeInType 47 | - QuasiQuotes 48 | - OverloadedStrings 49 | - PatternSynonyms 50 | - GeneralizedNewtypeDeriving 51 | 52 | executables: 53 | godot-haskell-project-generator: 54 | main: Main.hs 55 | source-dirs: project-generator 56 | dependencies: 57 | - fsnotify 58 | - directory 59 | - filepath 60 | - interpolate 61 | - lens 62 | 63 | library: 64 | source-dirs: src 65 | build-tools: 66 | - c2hs 67 | include-dirs: 68 | - godot_headers 69 | - cbits 70 | dependencies: 71 | - generate 72 | - linear 73 | - colour 74 | 75 | internal-libraries: 76 | generate: 77 | source-dirs: src-generate 78 | dependencies: 79 | - parsec 80 | - parsers 81 | - mtl 82 | - ansi-wl-pprint 83 | 84 | ghc-options: 85 | - -O0 86 | -------------------------------------------------------------------------------- /pinned-nixpkgs.nix: -------------------------------------------------------------------------------- 1 | {}: 2 | let hostPkgs = import {}; 3 | pinnedVersion = hostPkgs.lib.importJSON ./nixpkgs-version.json; 4 | pinnedPkgs = hostPkgs.fetchFromGitHub { 5 | owner = "NixOS"; 6 | repo = "nixpkgs-channels"; 7 | inherit (pinnedVersion) rev sha256; 8 | }; 9 | 10 | in import pinnedPkgs {} 11 | -------------------------------------------------------------------------------- /release.nix: -------------------------------------------------------------------------------- 1 | let 2 | pkgs = import { }; 3 | in 4 | pkgs.haskellPackages.callPackage ./default.nix { api-json = null; } 5 | -------------------------------------------------------------------------------- /shell-spacemacs-hie.nix: -------------------------------------------------------------------------------- 1 | let 2 | pinned = import ./nix/pinned { 3 | inherit (import {}) 4 | fetchFromGitHub 5 | lib; 6 | }; 7 | 8 | hsPkgs = pinned.nixpkgs.haskell.packages."ghc864"; 9 | in 10 | hsPkgs.developPackage { 11 | root = ./.; 12 | modifier = drv: pinned.nixpkgs.haskell.lib.addBuildTools drv 13 | (import ./nix/spacemacs-hie.nix { 14 | pkgs = pinned.nixpkgs; 15 | inherit hsPkgs; 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs ? import ./pinned-nixpkgs.nix {} 2 | , compiler ? "default" 3 | , doBenchmark ? false }: 4 | 5 | let 6 | inherit (nixpkgs) pkgs; 7 | 8 | haskellPackages = if compiler == "default" 9 | then pkgs.haskellPackages 10 | else pkgs.haskell.packages.${compiler}; 11 | 12 | variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; 13 | 14 | drv = variant (haskellPackages.callPackage ./. {}); 15 | 16 | in 17 | 18 | if pkgs.lib.inNixShell then drv.env else drv 19 | -------------------------------------------------------------------------------- /src-generate/Spec.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | {-# OPTIONS_GHC -Wno-orphans #-} 3 | module Spec where 4 | 5 | import Data.Aeson 6 | import Data.Aeson.TH 7 | import Data.Char 8 | import Data.Monoid 9 | import Data.Text (Text) 10 | import Data.Vector (Vector) 11 | import qualified Data.Vector as V 12 | import Data.HashMap.Strict (HashMap) 13 | import qualified Data.HashMap.Strict as HM 14 | import Data.Set (Set) 15 | import qualified Data.Set as S 16 | 17 | import Types 18 | 19 | -- this is incredibly ad hoc. 20 | instance FromJSON Type where 21 | parseJSON = withText "C type" $ \str -> 22 | case runCParser (const True) "" str parseType of 23 | Left err -> fail $ show err 24 | Right val -> return val 25 | 26 | data GdnativeApis = GdnativeApis 27 | { core :: !GdnativeApi 28 | , extensions :: !(Vector GdnativeApi) 29 | } deriving (Show, Eq) 30 | 31 | data Ver = Ver { major :: !Int, minor :: !Int} 32 | deriving (Show, Eq) 33 | 34 | data GdnativeApi = GdnativeApi 35 | { apiType :: !Text 36 | , apiVersion :: !Ver 37 | , apiNext :: !(Maybe GdnativeApi) 38 | , apiApi :: !(Vector GdnativeApiEntry) 39 | } deriving (Show, Eq) 40 | 41 | data GdnativeApiEntry = GdnativeApiEntry 42 | { name :: !Text 43 | , return_type :: !Type 44 | , arguments :: !(Vector (Type, Text)) 45 | } deriving (Show, Eq) 46 | 47 | deriveFromJSON defaultOptions ''Ver 48 | deriveFromJSON defaultOptions ''GdnativeApiEntry 49 | deriveFromJSON defaultOptions { fieldLabelModifier = map toLower . drop 3 } ''GdnativeApi 50 | deriveFromJSON defaultOptions ''GdnativeApis 51 | 52 | 53 | collectTypes :: GdnativeApis -> Set Type 54 | collectTypes apis = collectFromApi (core apis) <> mconcat (V.toList $ fmap collectFromApi $ extensions apis) 55 | where 56 | collectFromApi api = mconcat $ V.toList $ fmap collectFromEntry (apiApi api) 57 | collectFromEntry entry = S.singleton (return_type entry) <> (S.fromList $ V.toList $ fmap fst $ arguments entry) 58 | 59 | collectNames :: GdnativeApis -> Set Text 60 | collectNames apis = collectFromApi (core apis) <> mconcat (V.toList $ fmap collectFromApi $ extensions apis) 61 | where 62 | collectFromApi api = mconcat $ V.toList $ fmap collectFromEntry (apiApi api) 63 | collectFromEntry entry = S.fromList $ V.toList $ fmap snd $ arguments entry 64 | -------------------------------------------------------------------------------- /src/Godot/Api.hs: -------------------------------------------------------------------------------- 1 | module Godot.Api (module M) where 2 | 3 | import Godot.Api.Types as M 4 | 5 | -------------------------------------------------------------------------------- /src/Godot/Core/ARVRCamera.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.ARVRCamera () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Camera() -------------------------------------------------------------------------------- /src/Godot/Core/ARVRInterfaceGDNative.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.ARVRInterfaceGDNative () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.ARVRInterface() -------------------------------------------------------------------------------- /src/Godot/Core/AnimationNodeOutput.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AnimationNodeOutput () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AnimationNode() -------------------------------------------------------------------------------- /src/Godot/Core/AnimationNodeTimeScale.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AnimationNodeTimeScale () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AnimationNode() -------------------------------------------------------------------------------- /src/Godot/Core/AnimationNodeTimeSeek.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AnimationNodeTimeSeek () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AnimationNode() -------------------------------------------------------------------------------- /src/Godot/Core/AnimationRootNode.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AnimationRootNode () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AnimationNode() -------------------------------------------------------------------------------- /src/Godot/Core/AudioBusLayout.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioBusLayout () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Resource() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffect.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffect () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Resource() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffectBandLimitFilter.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffectBandLimitFilter () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioEffectFilter() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffectBandPassFilter.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffectBandPassFilter () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioEffectFilter() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffectEQ10.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffectEQ10 () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioEffectEQ() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffectEQ21.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffectEQ21 () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioEffectEQ() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffectEQ6.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffectEQ6 () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioEffectEQ() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffectHighPassFilter.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffectHighPassFilter () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioEffectFilter() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffectHighShelfFilter.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffectHighShelfFilter () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioEffectFilter() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffectInstance.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffectInstance () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Reference() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffectLowPassFilter.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffectLowPassFilter () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioEffectFilter() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffectLowShelfFilter.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffectLowShelfFilter () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioEffectFilter() -------------------------------------------------------------------------------- /src/Godot/Core/AudioEffectNotchFilter.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioEffectNotchFilter () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioEffectFilter() -------------------------------------------------------------------------------- /src/Godot/Core/AudioStream.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioStream (Godot.Core.AudioStream.get_length) 5 | where 6 | import Data.Coerce 7 | import Foreign.C 8 | import Godot.Internal.Dispatch 9 | import qualified Data.Vector as V 10 | import Linear(V2(..),V3(..),M22) 11 | import Data.Colour(withOpacity) 12 | import Data.Colour.SRGB(sRGB) 13 | import System.IO.Unsafe 14 | import Godot.Gdnative.Internal 15 | import Godot.Api.Types 16 | import Godot.Core.Resource() 17 | 18 | {-# NOINLINE bindAudioStream_get_length #-} 19 | 20 | -- | Returns the length of the audio stream in seconds. 21 | bindAudioStream_get_length :: MethodBind 22 | bindAudioStream_get_length 23 | = unsafePerformIO $ 24 | withCString "AudioStream" $ 25 | \ clsNamePtr -> 26 | withCString "get_length" $ 27 | \ methodNamePtr -> 28 | godot_method_bind_get_method clsNamePtr methodNamePtr 29 | 30 | -- | Returns the length of the audio stream in seconds. 31 | get_length :: 32 | (AudioStream :< cls, Object :< cls) => cls -> IO Float 33 | get_length cls 34 | = withVariantArray [] 35 | (\ (arrPtr, len) -> 36 | godot_method_bind_call bindAudioStream_get_length (upcast cls) 37 | arrPtr 38 | len 39 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 40 | 41 | instance NodeMethod AudioStream "get_length" '[] (IO Float) where 42 | nodeMethod = Godot.Core.AudioStream.get_length -------------------------------------------------------------------------------- /src/Godot/Core/AudioStreamMicrophone.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioStreamMicrophone () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioStream() -------------------------------------------------------------------------------- /src/Godot/Core/AudioStreamPlayback.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioStreamPlayback () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Reference() -------------------------------------------------------------------------------- /src/Godot/Core/AudioStreamPlaybackResampled.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.AudioStreamPlaybackResampled () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.AudioStreamPlayback() -------------------------------------------------------------------------------- /src/Godot/Core/BulletPhysicsDirectBodyState.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.BulletPhysicsDirectBodyState () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.PhysicsDirectBodyState() -------------------------------------------------------------------------------- /src/Godot/Core/BulletPhysicsServer.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.BulletPhysicsServer () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.PhysicsServer() -------------------------------------------------------------------------------- /src/Godot/Core/CSGCombiner.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.CSGCombiner () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.CSGShape() -------------------------------------------------------------------------------- /src/Godot/Core/CheckBox.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.CheckBox () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Button() -------------------------------------------------------------------------------- /src/Godot/Core/CheckButton.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.CheckButton () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Button() -------------------------------------------------------------------------------- /src/Godot/Core/ConfirmationDialog.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.ConfirmationDialog 5 | (Godot.Core.ConfirmationDialog.get_cancel) where 6 | import Data.Coerce 7 | import Foreign.C 8 | import Godot.Internal.Dispatch 9 | import qualified Data.Vector as V 10 | import Linear(V2(..),V3(..),M22) 11 | import Data.Colour(withOpacity) 12 | import Data.Colour.SRGB(sRGB) 13 | import System.IO.Unsafe 14 | import Godot.Gdnative.Internal 15 | import Godot.Api.Types 16 | import Godot.Core.AcceptDialog() 17 | 18 | {-# NOINLINE bindConfirmationDialog_get_cancel #-} 19 | 20 | -- | Returns the cancel button. 21 | bindConfirmationDialog_get_cancel :: MethodBind 22 | bindConfirmationDialog_get_cancel 23 | = unsafePerformIO $ 24 | withCString "ConfirmationDialog" $ 25 | \ clsNamePtr -> 26 | withCString "get_cancel" $ 27 | \ methodNamePtr -> 28 | godot_method_bind_get_method clsNamePtr methodNamePtr 29 | 30 | -- | Returns the cancel button. 31 | get_cancel :: 32 | (ConfirmationDialog :< cls, Object :< cls) => cls -> IO Button 33 | get_cancel cls 34 | = withVariantArray [] 35 | (\ (arrPtr, len) -> 36 | godot_method_bind_call bindConfirmationDialog_get_cancel 37 | (upcast cls) 38 | arrPtr 39 | len 40 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 41 | 42 | instance NodeMethod ConfirmationDialog "get_cancel" '[] (IO Button) 43 | where 44 | nodeMethod = Godot.Core.ConfirmationDialog.get_cancel -------------------------------------------------------------------------------- /src/Godot/Core/CryptoKey.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.CryptoKey 5 | (Godot.Core.CryptoKey.load, Godot.Core.CryptoKey.save) where 6 | import Data.Coerce 7 | import Foreign.C 8 | import Godot.Internal.Dispatch 9 | import qualified Data.Vector as V 10 | import Linear(V2(..),V3(..),M22) 11 | import Data.Colour(withOpacity) 12 | import Data.Colour.SRGB(sRGB) 13 | import System.IO.Unsafe 14 | import Godot.Gdnative.Internal 15 | import Godot.Api.Types 16 | import Godot.Core.Resource() 17 | 18 | {-# NOINLINE bindCryptoKey_load #-} 19 | 20 | -- | Loads a key from @path@ ("*.key" file). 21 | bindCryptoKey_load :: MethodBind 22 | bindCryptoKey_load 23 | = unsafePerformIO $ 24 | withCString "CryptoKey" $ 25 | \ clsNamePtr -> 26 | withCString "load" $ 27 | \ methodNamePtr -> 28 | godot_method_bind_get_method clsNamePtr methodNamePtr 29 | 30 | -- | Loads a key from @path@ ("*.key" file). 31 | load :: 32 | (CryptoKey :< cls, Object :< cls) => cls -> GodotString -> IO Int 33 | load cls arg1 34 | = withVariantArray [toVariant arg1] 35 | (\ (arrPtr, len) -> 36 | godot_method_bind_call bindCryptoKey_load (upcast cls) arrPtr len 37 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 38 | 39 | instance NodeMethod CryptoKey "load" '[GodotString] (IO Int) where 40 | nodeMethod = Godot.Core.CryptoKey.load 41 | 42 | {-# NOINLINE bindCryptoKey_save #-} 43 | 44 | -- | Saves a key to the given @path@ (should be a "*.key" file). 45 | bindCryptoKey_save :: MethodBind 46 | bindCryptoKey_save 47 | = unsafePerformIO $ 48 | withCString "CryptoKey" $ 49 | \ clsNamePtr -> 50 | withCString "save" $ 51 | \ methodNamePtr -> 52 | godot_method_bind_get_method clsNamePtr methodNamePtr 53 | 54 | -- | Saves a key to the given @path@ (should be a "*.key" file). 55 | save :: 56 | (CryptoKey :< cls, Object :< cls) => cls -> GodotString -> IO Int 57 | save cls arg1 58 | = withVariantArray [toVariant arg1] 59 | (\ (arrPtr, len) -> 60 | godot_method_bind_call bindCryptoKey_save (upcast cls) arrPtr len 61 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 62 | 63 | instance NodeMethod CryptoKey "save" '[GodotString] (IO Int) where 64 | nodeMethod = Godot.Core.CryptoKey.save -------------------------------------------------------------------------------- /src/Godot/Core/GDScript.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.GDScript 5 | (Godot.Core.GDScript.get_as_byte_code, Godot.Core.GDScript.new) 6 | where 7 | import Data.Coerce 8 | import Foreign.C 9 | import Godot.Internal.Dispatch 10 | import qualified Data.Vector as V 11 | import Linear(V2(..),V3(..),M22) 12 | import Data.Colour(withOpacity) 13 | import Data.Colour.SRGB(sRGB) 14 | import System.IO.Unsafe 15 | import Godot.Gdnative.Internal 16 | import Godot.Api.Types 17 | import Godot.Core.Script() 18 | 19 | {-# NOINLINE bindGDScript_get_as_byte_code #-} 20 | 21 | bindGDScript_get_as_byte_code :: MethodBind 22 | bindGDScript_get_as_byte_code 23 | = unsafePerformIO $ 24 | withCString "GDScript" $ 25 | \ clsNamePtr -> 26 | withCString "get_as_byte_code" $ 27 | \ methodNamePtr -> 28 | godot_method_bind_get_method clsNamePtr methodNamePtr 29 | 30 | get_as_byte_code :: 31 | (GDScript :< cls, Object :< cls) => cls -> IO PoolByteArray 32 | get_as_byte_code cls 33 | = withVariantArray [] 34 | (\ (arrPtr, len) -> 35 | godot_method_bind_call bindGDScript_get_as_byte_code (upcast cls) 36 | arrPtr 37 | len 38 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 39 | 40 | instance NodeMethod GDScript "get_as_byte_code" '[] 41 | (IO PoolByteArray) 42 | where 43 | nodeMethod = Godot.Core.GDScript.get_as_byte_code 44 | 45 | {-# NOINLINE bindGDScript_new #-} 46 | 47 | bindGDScript_new :: MethodBind 48 | bindGDScript_new 49 | = unsafePerformIO $ 50 | withCString "GDScript" $ 51 | \ clsNamePtr -> 52 | withCString "new" $ 53 | \ methodNamePtr -> 54 | godot_method_bind_get_method clsNamePtr methodNamePtr 55 | 56 | new :: 57 | (GDScript :< cls, Object :< cls) => 58 | cls -> [Variant 'GodotTy] -> IO GodotVariant 59 | new cls varargs 60 | = withVariantArray ([] ++ varargs) 61 | (\ (arrPtr, len) -> 62 | godot_method_bind_call bindGDScript_new (upcast cls) arrPtr len >>= 63 | \ (err, res) -> throwIfErr err >> fromGodotVariant res) 64 | 65 | instance NodeMethod GDScript "new" '[[Variant 'GodotTy]] 66 | (IO GodotVariant) 67 | where 68 | nodeMethod = Godot.Core.GDScript.new -------------------------------------------------------------------------------- /src/Godot/Core/HBoxContainer.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.HBoxContainer () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.BoxContainer() -------------------------------------------------------------------------------- /src/Godot/Core/HScrollBar.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.HScrollBar () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.ScrollBar() -------------------------------------------------------------------------------- /src/Godot/Core/HSeparator.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.HSeparator () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Separator() -------------------------------------------------------------------------------- /src/Godot/Core/HSlider.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.HSlider () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Slider() -------------------------------------------------------------------------------- /src/Godot/Core/HSplitContainer.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.HSplitContainer () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.SplitContainer() -------------------------------------------------------------------------------- /src/Godot/Core/IP_Unix.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.IP_Unix () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.IP() -------------------------------------------------------------------------------- /src/Godot/Core/InputDefault.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.InputDefault () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Input() -------------------------------------------------------------------------------- /src/Godot/Core/JavaClass.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.JavaClass () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Reference() -------------------------------------------------------------------------------- /src/Godot/Core/JavaClassWrapper.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.JavaClassWrapper 5 | (Godot.Core.JavaClassWrapper.wrap) where 6 | import Data.Coerce 7 | import Foreign.C 8 | import Godot.Internal.Dispatch 9 | import qualified Data.Vector as V 10 | import Linear(V2(..),V3(..),M22) 11 | import Data.Colour(withOpacity) 12 | import Data.Colour.SRGB(sRGB) 13 | import System.IO.Unsafe 14 | import Godot.Gdnative.Internal 15 | import Godot.Api.Types 16 | import Godot.Core.Object() 17 | 18 | {-# NOINLINE bindJavaClassWrapper_wrap #-} 19 | 20 | bindJavaClassWrapper_wrap :: MethodBind 21 | bindJavaClassWrapper_wrap 22 | = unsafePerformIO $ 23 | withCString "JavaClassWrapper" $ 24 | \ clsNamePtr -> 25 | withCString "wrap" $ 26 | \ methodNamePtr -> 27 | godot_method_bind_get_method clsNamePtr methodNamePtr 28 | 29 | wrap :: 30 | (JavaClassWrapper :< cls, Object :< cls) => 31 | cls -> GodotString -> IO JavaClass 32 | wrap cls arg1 33 | = withVariantArray [toVariant arg1] 34 | (\ (arrPtr, len) -> 35 | godot_method_bind_call bindJavaClassWrapper_wrap (upcast cls) 36 | arrPtr 37 | len 38 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 39 | 40 | instance NodeMethod JavaClassWrapper "wrap" '[GodotString] 41 | (IO JavaClass) 42 | where 43 | nodeMethod = Godot.Core.JavaClassWrapper.wrap -------------------------------------------------------------------------------- /src/Godot/Core/JavaScript.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.JavaScript (Godot.Core.JavaScript.eval) where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Object() 16 | 17 | {-# NOINLINE bindJavaScript_eval #-} 18 | 19 | -- | Execute the string @code@ as JavaScript code within the browser window. This is a call to the actual global JavaScript function @eval()@. 20 | -- If @use_global_execution_context@ is @true@, the code will be evaluated in the global execution context. Otherwise, it is evaluated in the execution context of a function within the engine's runtime environment. 21 | bindJavaScript_eval :: MethodBind 22 | bindJavaScript_eval 23 | = unsafePerformIO $ 24 | withCString "JavaScript" $ 25 | \ clsNamePtr -> 26 | withCString "eval" $ 27 | \ methodNamePtr -> 28 | godot_method_bind_get_method clsNamePtr methodNamePtr 29 | 30 | -- | Execute the string @code@ as JavaScript code within the browser window. This is a call to the actual global JavaScript function @eval()@. 31 | -- If @use_global_execution_context@ is @true@, the code will be evaluated in the global execution context. Otherwise, it is evaluated in the execution context of a function within the engine's runtime environment. 32 | eval :: 33 | (JavaScript :< cls, Object :< cls) => 34 | cls -> GodotString -> Maybe Bool -> IO GodotVariant 35 | eval cls arg1 arg2 36 | = withVariantArray 37 | [toVariant arg1, maybe (VariantBool False) toVariant arg2] 38 | (\ (arrPtr, len) -> 39 | godot_method_bind_call bindJavaScript_eval (upcast cls) arrPtr len 40 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 41 | 42 | instance NodeMethod JavaScript "eval" '[GodotString, Maybe Bool] 43 | (IO GodotVariant) 44 | where 45 | nodeMethod = Godot.Core.JavaScript.eval -------------------------------------------------------------------------------- /src/Godot/Core/MarginContainer.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.MarginContainer () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Container() -------------------------------------------------------------------------------- /src/Godot/Core/MultiplayerPeerGDNative.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.MultiplayerPeerGDNative () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.NetworkedMultiplayerPeer() -------------------------------------------------------------------------------- /src/Godot/Core/PHashTranslation.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.PHashTranslation 5 | (Godot.Core.PHashTranslation.generate) where 6 | import Data.Coerce 7 | import Foreign.C 8 | import Godot.Internal.Dispatch 9 | import qualified Data.Vector as V 10 | import Linear(V2(..),V3(..),M22) 11 | import Data.Colour(withOpacity) 12 | import Data.Colour.SRGB(sRGB) 13 | import System.IO.Unsafe 14 | import Godot.Gdnative.Internal 15 | import Godot.Api.Types 16 | import Godot.Core.Translation() 17 | 18 | {-# NOINLINE bindPHashTranslation_generate #-} 19 | 20 | -- | Generates and sets an optimized translation from the given @Translation@ resource. 21 | bindPHashTranslation_generate :: MethodBind 22 | bindPHashTranslation_generate 23 | = unsafePerformIO $ 24 | withCString "PHashTranslation" $ 25 | \ clsNamePtr -> 26 | withCString "generate" $ 27 | \ methodNamePtr -> 28 | godot_method_bind_get_method clsNamePtr methodNamePtr 29 | 30 | -- | Generates and sets an optimized translation from the given @Translation@ resource. 31 | generate :: 32 | (PHashTranslation :< cls, Object :< cls) => 33 | cls -> Translation -> IO () 34 | generate cls arg1 35 | = withVariantArray [toVariant arg1] 36 | (\ (arrPtr, len) -> 37 | godot_method_bind_call bindPHashTranslation_generate (upcast cls) 38 | arrPtr 39 | len 40 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 41 | 42 | instance NodeMethod PHashTranslation "generate" '[Translation] 43 | (IO ()) 44 | where 45 | nodeMethod = Godot.Core.PHashTranslation.generate -------------------------------------------------------------------------------- /src/Godot/Core/PacketPeerGDNative.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.PacketPeerGDNative () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.PacketPeer() -------------------------------------------------------------------------------- /src/Godot/Core/Panel.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.Panel () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Control() -------------------------------------------------------------------------------- /src/Godot/Core/PanelContainer.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.PanelContainer () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Container() -------------------------------------------------------------------------------- /src/Godot/Core/Physics2DDirectBodyStateSW.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.Physics2DDirectBodyStateSW () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Physics2DDirectBodyState() -------------------------------------------------------------------------------- /src/Godot/Core/Physics2DServerSW.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.Physics2DServerSW () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Physics2DServer() -------------------------------------------------------------------------------- /src/Godot/Core/PluginScript.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.PluginScript (Godot.Core.PluginScript.new) where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Script() 16 | 17 | {-# NOINLINE bindPluginScript_new #-} 18 | 19 | bindPluginScript_new :: MethodBind 20 | bindPluginScript_new 21 | = unsafePerformIO $ 22 | withCString "PluginScript" $ 23 | \ clsNamePtr -> 24 | withCString "new" $ 25 | \ methodNamePtr -> 26 | godot_method_bind_get_method clsNamePtr methodNamePtr 27 | 28 | new :: 29 | (PluginScript :< cls, Object :< cls) => 30 | cls -> [Variant 'GodotTy] -> IO GodotVariant 31 | new cls varargs 32 | = withVariantArray ([] ++ varargs) 33 | (\ (arrPtr, len) -> 34 | godot_method_bind_call bindPluginScript_new (upcast cls) arrPtr len 35 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 36 | 37 | instance NodeMethod PluginScript "new" '[[Variant 'GodotTy]] 38 | (IO GodotVariant) 39 | where 40 | nodeMethod = Godot.Core.PluginScript.new -------------------------------------------------------------------------------- /src/Godot/Core/PointMesh.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.PointMesh () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.PrimitiveMesh() -------------------------------------------------------------------------------- /src/Godot/Core/PopupDialog.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.PopupDialog () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Popup() -------------------------------------------------------------------------------- /src/Godot/Core/PopupPanel.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.PopupPanel () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Popup() -------------------------------------------------------------------------------- /src/Godot/Core/Position3D.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.Position3D () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Spatial() -------------------------------------------------------------------------------- /src/Godot/Core/ResourceFormatLoaderCrypto.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.ResourceFormatLoaderCrypto () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.ResourceFormatLoader() -------------------------------------------------------------------------------- /src/Godot/Core/ResourceFormatSaverCrypto.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.ResourceFormatSaverCrypto () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.ResourceFormatSaver() -------------------------------------------------------------------------------- /src/Godot/Core/ResourceImporter.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.ResourceImporter () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Reference() -------------------------------------------------------------------------------- /src/Godot/Core/RichTextEffect.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.RichTextEffect 5 | (Godot.Core.RichTextEffect._process_custom_fx) where 6 | import Data.Coerce 7 | import Foreign.C 8 | import Godot.Internal.Dispatch 9 | import qualified Data.Vector as V 10 | import Linear(V2(..),V3(..),M22) 11 | import Data.Colour(withOpacity) 12 | import Data.Colour.SRGB(sRGB) 13 | import System.IO.Unsafe 14 | import Godot.Gdnative.Internal 15 | import Godot.Api.Types 16 | import Godot.Core.Resource() 17 | 18 | {-# NOINLINE bindRichTextEffect__process_custom_fx #-} 19 | 20 | -- | Override this method to modify properties in @char_fx@. The method must return @true@ if the character could be transformed successfully. If the method returns @false@, it will skip transformation to avoid displaying broken text. 21 | bindRichTextEffect__process_custom_fx :: MethodBind 22 | bindRichTextEffect__process_custom_fx 23 | = unsafePerformIO $ 24 | withCString "RichTextEffect" $ 25 | \ clsNamePtr -> 26 | withCString "_process_custom_fx" $ 27 | \ methodNamePtr -> 28 | godot_method_bind_get_method clsNamePtr methodNamePtr 29 | 30 | -- | Override this method to modify properties in @char_fx@. The method must return @true@ if the character could be transformed successfully. If the method returns @false@, it will skip transformation to avoid displaying broken text. 31 | _process_custom_fx :: 32 | (RichTextEffect :< cls, Object :< cls) => 33 | cls -> CharFXTransform -> IO Bool 34 | _process_custom_fx cls arg1 35 | = withVariantArray [toVariant arg1] 36 | (\ (arrPtr, len) -> 37 | godot_method_bind_call bindRichTextEffect__process_custom_fx 38 | (upcast cls) 39 | arrPtr 40 | len 41 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 42 | 43 | instance NodeMethod RichTextEffect "_process_custom_fx" 44 | '[CharFXTransform] 45 | (IO Bool) 46 | where 47 | nodeMethod = Godot.Core.RichTextEffect._process_custom_fx -------------------------------------------------------------------------------- /src/Godot/Core/Separator.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.Separator () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Control() -------------------------------------------------------------------------------- /src/Godot/Core/SpatialGizmo.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.SpatialGizmo () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Reference() -------------------------------------------------------------------------------- /src/Godot/Core/StreamPeerGDNative.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.StreamPeerGDNative () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.StreamPeer() -------------------------------------------------------------------------------- /src/Godot/Core/StyleBoxEmpty.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.StyleBoxEmpty () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.StyleBox() -------------------------------------------------------------------------------- /src/Godot/Core/TextFile.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.TextFile () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Resource() -------------------------------------------------------------------------------- /src/Godot/Core/Texture3D.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.Texture3D () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.TextureLayered() -------------------------------------------------------------------------------- /src/Godot/Core/TextureArray.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.TextureArray () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.TextureLayered() -------------------------------------------------------------------------------- /src/Godot/Core/ToolButton.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.ToolButton () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Button() -------------------------------------------------------------------------------- /src/Godot/Core/TriangleMesh.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.TriangleMesh () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Reference() -------------------------------------------------------------------------------- /src/Godot/Core/VBoxContainer.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VBoxContainer () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.BoxContainer() -------------------------------------------------------------------------------- /src/Godot/Core/VScrollBar.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VScrollBar () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.ScrollBar() -------------------------------------------------------------------------------- /src/Godot/Core/VSeparator.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VSeparator () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Separator() -------------------------------------------------------------------------------- /src/Godot/Core/VSlider.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VSlider () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Slider() -------------------------------------------------------------------------------- /src/Godot/Core/VSplitContainer.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VSplitContainer () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.SplitContainer() -------------------------------------------------------------------------------- /src/Godot/Core/VideoStream.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VideoStream () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Resource() -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptComposeArray.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptComposeArray () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualScriptLists() -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptCondition.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptCondition () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualScriptNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptExpression.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptExpression () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualScriptNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptFunction.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptFunction () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualScriptNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptIndexGet.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptIndexGet () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualScriptNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptIndexSet.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptIndexSet () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualScriptNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptIterator.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptIterator () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualScriptNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptSceneTree.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptSceneTree () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualScriptNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptSelf.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptSelf () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualScriptNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptSubCall.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptSubCall 5 | (Godot.Core.VisualScriptSubCall._subcall) where 6 | import Data.Coerce 7 | import Foreign.C 8 | import Godot.Internal.Dispatch 9 | import qualified Data.Vector as V 10 | import Linear(V2(..),V3(..),M22) 11 | import Data.Colour(withOpacity) 12 | import Data.Colour.SRGB(sRGB) 13 | import System.IO.Unsafe 14 | import Godot.Gdnative.Internal 15 | import Godot.Api.Types 16 | import Godot.Core.VisualScriptNode() 17 | 18 | {-# NOINLINE bindVisualScriptSubCall__subcall #-} 19 | 20 | bindVisualScriptSubCall__subcall :: MethodBind 21 | bindVisualScriptSubCall__subcall 22 | = unsafePerformIO $ 23 | withCString "VisualScriptSubCall" $ 24 | \ clsNamePtr -> 25 | withCString "_subcall" $ 26 | \ methodNamePtr -> 27 | godot_method_bind_get_method clsNamePtr methodNamePtr 28 | 29 | _subcall :: 30 | (VisualScriptSubCall :< cls, Object :< cls) => 31 | cls -> GodotVariant -> IO GodotVariant 32 | _subcall cls arg1 33 | = withVariantArray [toVariant arg1] 34 | (\ (arrPtr, len) -> 35 | godot_method_bind_call bindVisualScriptSubCall__subcall 36 | (upcast cls) 37 | arrPtr 38 | len 39 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 40 | 41 | instance NodeMethod VisualScriptSubCall "_subcall" '[GodotVariant] 42 | (IO GodotVariant) 43 | where 44 | nodeMethod = Godot.Core.VisualScriptSubCall._subcall -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptSwitch.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptSwitch () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualScriptNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualScriptWhile.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualScriptWhile () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualScriptNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeBooleanUniform.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeBooleanUniform () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNodeUniform() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeColorUniform.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeColorUniform () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNodeUniform() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeCubeMapUniform.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeCubeMapUniform () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNodeTextureUniform() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeDeterminant.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeDeterminant () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeDotProduct.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeDotProduct () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeFaceForward.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeFaceForward () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeFresnel.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeFresnel () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeGlobalExpression.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeGlobalExpression () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNodeExpression() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeIf.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeIf () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeOuterProduct.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeOuterProduct () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeOutput.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeOutput () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeScalarClamp.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeScalarClamp () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeScalarInterp.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeScalarInterp () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeScalarSmoothStep.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeScalarSmoothStep () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeScalarSwitch.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeScalarSwitch () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNodeSwitch() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeScalarUniform.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeScalarUniform () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNodeUniform() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeSwitch.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeSwitch () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeTextureUniformTriplanar.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeTextureUniformTriplanar () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNodeTextureUniform() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeTransformCompose.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeTransformCompose () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeTransformDecompose.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeTransformDecompose () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeTransformUniform.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeTransformUniform () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNodeUniform() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVec3Uniform.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVec3Uniform () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNodeUniform() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVectorClamp.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVectorClamp () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVectorCompose.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVectorCompose () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVectorDecompose.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVectorDecompose () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVectorDistance.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVectorDistance () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVectorInterp.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVectorInterp () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVectorLen.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVectorLen () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVectorRefract.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVectorRefract () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVectorScalarMix.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVectorScalarMix () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVectorScalarSmoothStep.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVectorScalarSmoothStep () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVectorScalarStep.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVectorScalarStep () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/VisualShaderNodeVectorSmoothStep.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.VisualShaderNodeVectorSmoothStep () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.VisualShaderNode() -------------------------------------------------------------------------------- /src/Godot/Core/WeakRef.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.WeakRef (Godot.Core.WeakRef.get_ref) where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Reference() 16 | 17 | {-# NOINLINE bindWeakRef_get_ref #-} 18 | 19 | -- | Returns the @Object@ this weakref is referring to. 20 | bindWeakRef_get_ref :: MethodBind 21 | bindWeakRef_get_ref 22 | = unsafePerformIO $ 23 | withCString "WeakRef" $ 24 | \ clsNamePtr -> 25 | withCString "get_ref" $ 26 | \ methodNamePtr -> 27 | godot_method_bind_get_method clsNamePtr methodNamePtr 28 | 29 | -- | Returns the @Object@ this weakref is referring to. 30 | get_ref :: 31 | (WeakRef :< cls, Object :< cls) => cls -> IO GodotVariant 32 | get_ref cls 33 | = withVariantArray [] 34 | (\ (arrPtr, len) -> 35 | godot_method_bind_call bindWeakRef_get_ref (upcast cls) arrPtr len 36 | >>= \ (err, res) -> throwIfErr err >> fromGodotVariant res) 37 | 38 | instance NodeMethod WeakRef "get_ref" '[] (IO GodotVariant) where 39 | nodeMethod = Godot.Core.WeakRef.get_ref -------------------------------------------------------------------------------- /src/Godot/Core/WebRTCDataChannelGDNative.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.WebRTCDataChannelGDNative () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.WebRTCDataChannel() -------------------------------------------------------------------------------- /src/Godot/Core/WebRTCPeerConnectionGDNative.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Core.WebRTCPeerConnectionGDNative () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.WebRTCPeerConnection() -------------------------------------------------------------------------------- /src/Godot/Gdnative.hs: -------------------------------------------------------------------------------- 1 | module Godot.Gdnative(module T, module I) where 2 | import Godot.Gdnative.Internal.Types as T 3 | import Godot.Gdnative.Internal as I hiding (Rect2,Basis,Transform,Transform2d,NodePath,Color,Signal,PropertyAttributes,SignalArgument) 4 | -------------------------------------------------------------------------------- /src/Godot/Gdnative/Internal.hs: -------------------------------------------------------------------------------- 1 | module Godot.Gdnative.Internal (module M) where 2 | 3 | import Godot.Gdnative.Internal.Gdnative as M 4 | import Godot.Gdnative.Internal.Api as M 5 | import Godot.Gdnative.Internal.Types as M hiding (Rect2,Basis,Transform,Transform2d,Color,Signal) 6 | -------------------------------------------------------------------------------- /src/Godot/Gdnative/Internal/Api.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE TemplateHaskell #-} 2 | module Godot.Gdnative.Internal.Api where 3 | 4 | import Data.Aeson hiding (Array,Object) 5 | import qualified Data.ByteString.Lazy as BL 6 | import Data.IORef 7 | 8 | import Foreign.C 9 | 10 | import Language.Haskell.TH 11 | 12 | import Data.ByteString.Internal (accursedUnutterablePerformIO) 13 | 14 | import Godot.Gdnative.Internal.Gdnative 15 | 16 | import Generate 17 | 18 | gdnativeCoreApiStruct :: GdnativeCoreApiStruct 19 | gdnativeCoreApiStruct = accursedUnutterablePerformIO $ readIORef gdnativeCoreApiStructRef 20 | 21 | gdnativeCore11ApiStruct :: GdnativeCore11ApiStruct 22 | gdnativeCore11ApiStruct = accursedUnutterablePerformIO $ readIORef gdnativeCore11ApiStructRef 23 | 24 | gdnativeCore12ApiStruct :: GdnativeCore12ApiStruct 25 | gdnativeCore12ApiStruct = accursedUnutterablePerformIO $ readIORef gdnativeCore12ApiStructRef 26 | 27 | gdnativeExtNativescriptApiStruct :: GdnativeExtNativescriptApiStruct 28 | gdnativeExtNativescriptApiStruct = accursedUnutterablePerformIO $ readIORef gdnativeExtNativescriptApiStructRef 29 | 30 | gdnativeExtNativescript11ApiStruct :: GdnativeExtNativescript11ApiStruct 31 | gdnativeExtNativescript11ApiStruct = accursedUnutterablePerformIO $ readIORef gdnativeExtNativescript11ApiStructRef 32 | 33 | gdnativeExtPluginscriptApiStruct :: GdnativeExtPluginscriptApiStruct 34 | gdnativeExtPluginscriptApiStruct = accursedUnutterablePerformIO $ readIORef gdnativeExtPluginscriptApiStructRef 35 | 36 | gdnativeExtArvrApiStruct :: GdnativeExtArvrApiStruct 37 | gdnativeExtArvrApiStruct = accursedUnutterablePerformIO $ readIORef gdnativeExtArvrApiStructRef 38 | 39 | gdnativeExtVideodecoderApiStruct :: GdnativeExtVideodecoderApiStruct 40 | gdnativeExtVideodecoderApiStruct = accursedUnutterablePerformIO $ readIORef gdnativeExtVideodecoderApiStructRef 41 | 42 | gdnativeExtNetApiStruct :: GdnativeExtNetApiStruct 43 | gdnativeExtNetApiStruct = accursedUnutterablePerformIO $ readIORef gdnativeExtNetApiStructRef 44 | 45 | gdnativeExtNet32ApiStruct :: GdnativeExtNet32ApiStruct 46 | gdnativeExtNet32ApiStruct = accursedUnutterablePerformIO $ readIORef gdnativeExtNet32ApiStructRef 47 | 48 | $(do 49 | maybeApis <- eitherDecode <$> runIO (BL.readFile "godot_headers/gdnative_api.json") 50 | case maybeApis of 51 | Right apis -> apisToHs apis 52 | Left err -> error err) 53 | -------------------------------------------------------------------------------- /src/Godot/Gdnative/Internal/TH.hs: -------------------------------------------------------------------------------- 1 | {-#LANGUAGE TemplateHaskell#-} 2 | module Godot.Gdnative.Internal.TH where 3 | 4 | import Data.Maybe 5 | import Godot.Gdnative.Internal.Gdnative 6 | import Language.Haskell.TH 7 | import Language.Haskell.TH.Syntax 8 | import Foreign 9 | import qualified Data.Text as T 10 | 11 | generateAsVariantInstances :: Q [Dec] 12 | generateAsVariantInstances = do 13 | (TyConI (DataD _ _ bndrs _ cons _)) <- lookupTypeName "Variant" >>= \(Just x) -> reify x 14 | let tys = mapMaybe getCon cons 15 | mapM mkInstance tys 16 | 17 | where 18 | getCon (NormalC name [(_, AppT (AppT _ _) ty)]) = Just (name, ty) 19 | getCon (NormalC name [(_, ty)]) = Just (name, ty) 20 | getCon _ = Nothing 21 | mkInstance (name, ty) 22 | = instanceD (cxt []) (appT (conT $ mkName "AsVariant") (return ty)) 23 | [ valD (varP $ mkName "toVariant") (normalB $ conE $ mkName $ nameBase name) [] 24 | , valD (varP $ mkName "fromVariant") (normalB 25 | [| \var -> case var of 26 | $(conP (mkName $ nameBase name) [varP $ mkName "x"]) -> Just x 27 | _ -> Nothing |]) [] 28 | , valD (varP $ mkName "variantType") (normalB 29 | [| \_ -> $(conE $ mkName $ T.unpack $ T.replace "Variant" "VariantType" $ T.pack $ nameBase name) |]) [] ] 30 | -------------------------------------------------------------------------------- /src/Godot/Tools/AnimationTrackEditPlugin.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Tools.AnimationTrackEditPlugin () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Core.Reference() -------------------------------------------------------------------------------- /src/Godot/Tools/EditorSceneImporterAssimp.hs: -------------------------------------------------------------------------------- 1 | {-# LANGUAGE DerivingStrategies, GeneralizedNewtypeDeriving, 2 | TypeFamilies, TypeOperators, FlexibleContexts, DataKinds, 3 | MultiParamTypeClasses #-} 4 | module Godot.Tools.EditorSceneImporterAssimp () where 5 | import Data.Coerce 6 | import Foreign.C 7 | import Godot.Internal.Dispatch 8 | import qualified Data.Vector as V 9 | import Linear(V2(..),V3(..),M22) 10 | import Data.Colour(withOpacity) 11 | import Data.Colour.SRGB(sRGB) 12 | import System.IO.Unsafe 13 | import Godot.Gdnative.Internal 14 | import Godot.Api.Types 15 | import Godot.Tools.EditorSceneImporter() -------------------------------------------------------------------------------- /stack-shell.nix: -------------------------------------------------------------------------------- 1 | { nixpkgs ? import ./pinned-nixpkgs.nix {} 2 | , ghc }: 3 | 4 | with nixpkgs; 5 | 6 | haskell.lib.buildStackProject { 7 | inherit ghc; 8 | name = "godotHaskell"; 9 | buildInputs = []; 10 | } 11 | -------------------------------------------------------------------------------- /stack.yaml.lock: -------------------------------------------------------------------------------- 1 | # This file was autogenerated by Stack. 2 | # You should not edit this file by hand. 3 | # For more information, please see the documentation at: 4 | # https://docs.haskellstack.org/en/stable/lock_files 5 | 6 | packages: [] 7 | snapshots: 8 | - completed: 9 | size: 565469 10 | url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2021/2/6.yaml 11 | sha256: 7108f8cb8c928699c6c3c6574d3f6fc132db8bbba6a3987f9446fb35fd67dbf6 12 | original: nightly-2021-02-06 13 | -------------------------------------------------------------------------------- /template/README.md: -------------------------------------------------------------------------------- 1 | # Template and project demo 2 | 3 | ## Updating the demo: 4 | 5 | ./mkdemo.sh 6 | 7 | This will update the template and recreate the demo. The demo will have all 8 | references to godot-haskell **redirected to the local checkout** so as not to 9 | require another compilation. 10 | 11 | ## Updating the template file 12 | 13 | ./update-template.sh 14 | 15 | This script updates the template file with the revision and hash of the latest 16 | commit in origin/master or revision supplied as argument. 17 | 18 | ## Using the template 19 | 20 | ``` 21 | stack new myproject templatefile 22 | ``` 23 | 24 | `templatefile` is path to `godot-haskell.hsfiles`, either locally or as a link. 25 | -------------------------------------------------------------------------------- /template/demo/Makefile: -------------------------------------------------------------------------------- 1 | NAME = demo 2 | 3 | UNAME_S := $(shell uname -s) 4 | ifeq ($(UNAME_S),Linux) 5 | LIBNAME = lib$(NAME).so 6 | endif 7 | ifeq ($(UNAME_S),Darwin) 8 | LIBNAME = lib$(NAME).dylib 9 | endif 10 | 11 | STACKLIBFILE = $(shell stack path --local-install-root)/lib/$(LIBNAME) 12 | GODOTPROJECT = $(shell stack path --project-root)/game 13 | all: stack 14 | nix: 15 | nix-build shell.nix 16 | cp result/lib/ghc-*/$(LIBNAME) $(GODOTPROJECT)/lib 17 | stack: 18 | stack build --fast 19 | cp $(STACKLIBFILE) $(GODOTPROJECT)/lib 20 | stack-nix: 21 | stack --nix clean $(NAME) 22 | stack --nix build 23 | cp $(shell stack --nix path --local-install-root)/lib/$(LIBNAME) $(GODOTPROJECT)/lib 24 | stack-run: 25 | nix-build shell.nix 26 | cp $(STACKLIBFILE) $(GODOTPROJECT)/lib 27 | godot --path ./game 28 | stack-watch: 29 | stack build --file-watch --exec "cp $(STACKLIBFILE) $(GODOTPROJECT)/lib" 30 | -------------------------------------------------------------------------------- /template/demo/ffi/cbits/flib.c: -------------------------------------------------------------------------------- 1 | #include "HsFFI.h" 2 | 3 | static void flib_init() __attribute__((constructor)); 4 | static void flib_init() { 5 | static char *argv[] = { "libdemo", 0 }, **argv_ = argv; 6 | static int argc = 1; 7 | hs_init(&argc, &argv_); 8 | } 9 | 10 | static void flib_fini() __attribute__((destructor)); 11 | static void flib_fini() { 12 | hs_exit(); 13 | } 14 | 15 | 16 | -------------------------------------------------------------------------------- /template/demo/game/Main.gdns: -------------------------------------------------------------------------------- 1 | [gd_resource type="NativeScript" load_steps=2 format=2] 2 | 3 | [ext_resource path="res://lib/libdemo.gdnlib" type="GDNativeLibrary" id=1] 4 | 5 | [resource] 6 | 7 | class_name = "Main" 8 | library = ExtResource( 1 ) 9 | script_class_name = "Main" 10 | 11 | -------------------------------------------------------------------------------- /template/demo/game/lib/libdemo.gdnlib: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | singleton=false 4 | load_once=true 5 | symbol_prefix="godot_" 6 | reloadable=false 7 | 8 | [entry] 9 | 10 | X11.64="res://lib/libdemo.so" 11 | OSX.64="res://lib/libdemo.dylib" 12 | 13 | -------------------------------------------------------------------------------- /template/demo/game/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ { 12 | "base": "Node", 13 | "class": "Main", 14 | "language": "NativeScript", 15 | "path": "res://Main.gdns" 16 | } ] 17 | _global_script_class_icons={ 18 | "Main": "" 19 | } 20 | 21 | [application] 22 | 23 | config/name="demo" 24 | run/main_scene="res://Main.tscn" 25 | 26 | [gdnative] 27 | 28 | singletons=[ ] 29 | -------------------------------------------------------------------------------- /template/mkdemo.sh: -------------------------------------------------------------------------------- 1 | # This script generates a minimal demo using the stack template after updating it. 2 | 3 | rm -rf demo 4 | ./update-template.sh 5 | stack new demo ./godot-haskell.hsfiles 6 | 7 | # Make template point to this local checkout of godot-haskell 8 | # stack.yaml: 9 | sed -i 's/git: .*/..\/..\//' demo/stack.yaml 10 | sed -i '/ commit: .*/d' demo/stack.yaml 11 | # shell.nix: 12 | sed -i 's/.\/godot-haskell.nix {fetchFromGitHub = pkgs.fetchFromGitHub;};/..\/..\/. {};/' demo/shell.nix 13 | -------------------------------------------------------------------------------- /template/update-template.sh: -------------------------------------------------------------------------------- 1 | # This script updates the template file with the revision and hash of the latest 2 | # commit in origin/master or revision supplied as argument. 3 | 4 | REV=$1 5 | if [ -z $REV ]; then 6 | REV=$(git show origin/master | grep commit | head -n 1 | cut -d ' ' -f 2) 7 | fi 8 | 9 | SHA256=$(nix-prefetch-git https://github.com/SimulaVR/godot-haskell $REV --fetch-submodules | grep sha256 | cut -d '"' -f 4) 10 | 11 | sed -i "s/commit: .* # godot-haskell rev/commit: ${REV} # godot-haskell rev/" godot-haskell.hsfiles 12 | sed -i "s/rev = .*; # godot-haskell rev/rev = \"${REV}\"; # godot-haskell rev/" godot-haskell.hsfiles 13 | sed -i "s/sha256 = .*;/sha256 = \"${SHA256}\";/" godot-haskell.hsfiles 14 | -------------------------------------------------------------------------------- /update-nixpkgs.sh: -------------------------------------------------------------------------------- 1 | if (( $# != 1 )); then 2 | echo "Usage: ./update-nixpkgs.sh " 3 | echo "Examples:" 4 | echo " ./update-nixpkgs.sh nixos-19.09" 5 | echo " ./update-nixpkgs.sh nixpkgs-unstable" 6 | exit 7 | fi 8 | CHANNEL=$1 9 | echo "Updating pinned nixpkgs to most recent ${CHANNEL}" 10 | 11 | SHA256=$(sha256sum ./nixpkgs-version.json) 12 | nix-prefetch-git https://github.com/nixos/nixpkgs-channels.git refs/heads/$CHANNEL \ 13 | 2>/dev/null > ./nixpkgs-version.json 14 | NEWSHA256=$(sha256sum ./nixpkgs-version.json) 15 | 16 | if [ "$SHA256" = "$NEWSHA256" ] 17 | then 18 | echo "Done, but the contents of nixpkgs-version.json is the same." 19 | else 20 | echo "Done. File nixpkgs-version.json was updated." 21 | fi 22 | --------------------------------------------------------------------------------