# Latest

**URL:** https://discourse.piston.rs/latest.md

[Latest](https://discourse.piston.rs/latest.md) · [Categories](https://discourse.piston.rs/categories.md)

---

## [Welcome to Discourse](https://discourse.piston.rs/t/welcome-to-discourse/8)

<div class="topic-metadata">

**Author:** [@system](https://discourse.piston.rs/u/system)\
**Replies:** 0\
**Last updated:** [February 25, 2016, 11:11pm UTC](https://discourse.piston.rs/t/welcome-to-discourse/8 "2016-02-25T23:11:58Z")

</div>

The first paragraph of this pinned topic will be visible as a welcome message to all new visitors on your homepage. It's important! Edit this into a brief description of your community: Who is it for? What can they …

---

## [How to work with another event\_loop?](https://discourse.piston.rs/t/how-to-work-with-another-event-loop/178)

<div class="topic-metadata">

**Author:** [@jiyinyiyong](https://discourse.piston.rs/u/jiyinyiyong)\
**Replies:** 0\
**Last updated:** [May 9, 2021, 6:00pm UTC](https://discourse.piston.rs/t/how-to-work-with-another-event-loop/178 "2021-05-09T18:00:38Z")

</div>

the API wrapped window into an iterator and uses a lazy mode to control it. In my program I also have a loop of notify to watch file and do some stuffs. I think it might be impossible to use iterator here so I turned off…

---

## [How to react on window resize?](https://discourse.piston.rs/t/how-to-react-on-window-resize/175)

<div class="topic-metadata">

**Author:** [@amarao](https://discourse.piston.rs/u/amarao)\
**Replies:** 1\
**Last updated:** [September 13, 2020, 10:28am UTC](https://discourse.piston.rs/t/how-to-react-on-window-resize/175 "2020-09-13T10:28:55Z")

</div>

I’m learning both rust and piston at the same time. I made my app (a prototype), and it works, but there are few strange behaviors I can’t explain. My code is here: main.rs. The problem with my current code is that res…

---

## [Drawing transparent windows with piston\_window](https://discourse.piston.rs/t/drawing-transparent-windows-with-piston-window/164)

<div class="topic-metadata">

**Author:** [@Scrumplex](https://discourse.piston.rs/u/Scrumplex)\
**Replies:** 1\
**Last updated:** [March 18, 2020, 6:49am UTC](https://discourse.piston.rs/t/drawing-transparent-windows-with-piston-window/164 "2020-03-18T06:49:46Z")

</div>

I am currently trying to create a transparent window in piston\_window. I am on Linux and only plan to support Linux platforms. Is there a way I can pass this to Glutin?

---

## [Easy convenient EventHandler trait](https://discourse.piston.rs/t/easy-convenient-eventhandler-trait/167)

<div class="topic-metadata">

**Author:** [@digital](https://discourse.piston.rs/u/digital)\
**Replies:** 0\
**Last updated:** [July 19, 2019, 3:50pm UTC](https://discourse.piston.rs/t/easy-convenient-eventhandler-trait/167 "2019-07-19T15:50:50Z")

</div>

Hello, piston world! I’m coming from ggez which has this neat mechanism to easily work with events, a trait called EventHandler. It has functions for all events and provides (usually empty) default implementations for…

---

## [Hide window doesn't minimize it](https://discourse.piston.rs/t/hide-window-doesnt-minimize-it/161)

<div class="topic-metadata">

**Author:** [@cscortes](https://discourse.piston.rs/u/cscortes)\
**Replies:** 0\
**Last updated:** [December 12, 2018, 5:28am UTC](https://discourse.piston.rs/t/hide-window-doesnt-minimize-it/161 "2018-12-12T05:28:11Z")

</div>

Hi: I am using SDL2 window, and I wanted to minimize my window. I have only found the hide api. This hide api does too much. It actually removes the app from the window list and the window is really hidden. Is there…

---

## [Window size bigger then specified](https://discourse.piston.rs/t/window-size-bigger-then-specified/159)

<div class="topic-metadata">

**Author:** [@varomix](https://discourse.piston.rs/u/varomix)\
**Replies:** 2\
**Last updated:** [December 3, 2018, 7:25pm UTC](https://discourse.piston.rs/t/window-size-bigger-then-specified/159 "2018-12-03T19:25:04Z")

</div>

Hi guys I’m starting with Piston, I like it, but not sure why the window is bigger than the size I specify, even happens with the piston example Hello\_world that’s the code directly taken from github and running it, I …

---

## [Piston application panics on Raspberry Pi](https://discourse.piston.rs/t/piston-application-panics-on-raspberry-pi/156)

<div class="topic-metadata">

**Author:** [@wezm](https://discourse.piston.rs/u/wezm)\
**Replies:** 0\
**Last updated:** [August 7, 2018, 9:43pm UTC](https://discourse.piston.rs/t/piston-application-panics-on-raspberry-pi/156 "2018-08-07T21:43:16Z")

</div>

I have built a small application with Piston to show a slideshow of photos from my Flickr photostream: The goal is to have it run on a SBC like a Raspberry Pi. It runs fine on desktop Linux machines but when running o…

---

## [Questions on shaders](https://discourse.piston.rs/t/questions-on-shaders/154)

<div class="topic-metadata">

**Author:** [@jackmott](https://discourse.piston.rs/u/jackmott)\
**Replies:** 0\
**Last updated:** [August 4, 2018, 7:55pm UTC](https://discourse.piston.rs/t/questions-on-shaders/154 "2018-08-04T19:55:26Z")

</div>

I’m just starting to evaluate the Piston game engine, having gone through the tutorials and played with the sprite example. So far things looks good. I’m wondering if and how one can combine working with 2d graphics as…

---

## [Input::Text event produces weird output](https://discourse.piston.rs/t/input-text-event-produces-weird-output/145)

<div class="topic-metadata">

**Author:** [@sunjay](https://discourse.piston.rs/u/sunjay)\
**Replies:** 0\
**Last updated:** [October 5, 2017, 1:58am UTC](https://discourse.piston.rs/t/input-text-event-produces-weird-output/145 "2017-10-05T01:58:45Z")

</div>

Hi, Is this supposed to happen? When I look at the text in Input::Text events, everything works correctly if I’m just hitting regular keys like a, b, c, etc. but if I hit Ctrl + any of those keys, I start to get Text("\\…

---

## [Various Piston ecosystem questions](https://discourse.piston.rs/t/various-piston-ecosystem-questions/143)

<div class="topic-metadata">

**Author:** [@theobat](https://discourse.piston.rs/u/theobat)\
**Replies:** 0\
**Last updated:** [September 10, 2017, 10:44am UTC](https://discourse.piston.rs/t/various-piston-ecosystem-questions/143 "2017-09-10T10:44:20Z")

</div>

Hi, I’m a newcomer to rust, game dev (I’ve been a web dev for a few years now) and to piston. The questions that are bugging me are: Is there real support for 3d rendering in piston at the moment ? (If not how much wo…

---

## [How to Divide a Canvas in Two?](https://discourse.piston.rs/t/how-to-divide-a-canvas-in-two/138)

<div class="topic-metadata">

**Author:** [@backnforth](https://discourse.piston.rs/u/backnforth)\
**Replies:** 2\
**Last updated:** [July 9, 2017, 6:37pm UTC](https://discourse.piston.rs/t/how-to-divide-a-canvas-in-two/138 "2017-07-09T18:37:22Z")

</div>

Hi, I'm wondering how I may be able to divide a canvas. I'm looking to divide it horizontally and place text on the bottom part of the canvas. I also want to be able to adjust the size of the bottom canvas to be able to …

---

## [Some Thoughts About Rust Gamedev and the Future of the Piston Ecosystem](https://discourse.piston.rs/t/some-thoughts-about-rust-gamedev-and-the-future-of-the-piston-ecosystem/140)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 1\
**Last updated:** [July 9, 2017, 6:09pm UTC](https://discourse.piston.rs/t/some-thoughts-about-rust-gamedev-and-the-future-of-the-piston-ecosystem/140 "2017-07-09T18:09:06Z")

</div>

Originally posted on /r/rustgamedev: https://www.reddit.com/r/rust\_gamedev/comments/6ly9ol/some\_thoughts\_about\_rust\_gamedev\_and\_the\_future/ Posting this here so we can continue the discussion. I've just watched https…

---

## [Design a constraint DSL for synthesizing from meta grammar](https://discourse.piston.rs/t/design-a-constraint-dsl-for-synthesizing-from-meta-grammar/132)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 1\
**Last updated:** [January 7, 2017, 5:19am UTC](https://discourse.piston.rs/t/design-a-constraint-dsl-for-synthesizing-from-meta-grammar/132 "2017-01-07T05:19:34Z")

</div>

Came over this idea when reading https://arxiv.org/pdf/1608.04112v4.pdf and playing with activity-focused natural language grammar http://discourse.piston.rs/t/playing-with-activity-focused-natural-language-grammar/131. …

---

## [Playing with activity-focused natural language grammar](https://discourse.piston.rs/t/playing-with-activity-focused-natural-language-grammar/131)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 1\
**Last updated:** [January 3, 2017, 11:42pm UTC](https://discourse.piston.rs/t/playing-with-activity-focused-natural-language-grammar/131 "2017-01-03T23:42:00Z")

</div>

Natural language is difficult to formalize, yet there are some interesting reflective properties when you construct the grammar around activities, for example this sentence: tell Albus that Beatrix will assassinate Ha…

---

## [Congratz Disney - You ruined Star Wars](https://discourse.piston.rs/t/congratz-disney-you-ruined-star-wars/130)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 0\
**Last updated:** [December 23, 2016, 5:44pm UTC](https://discourse.piston.rs/t/congratz-disney-you-ruined-star-wars/130 "2016-12-23T17:44:56Z")

</div>

Two days ago I watched "Rogue One: A Star War Story". The film was moving, spectacular well made, and directed at an modern audience and relevant to the military-politic situation of our world today. It is the last par…

---

## [A weird, perhaps impossible plan to deal with all the extra C02 in the athmosphere](https://discourse.piston.rs/t/a-weird-perhaps-impossible-plan-to-deal-with-all-the-extra-c02-in-the-athmosphere/129)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 1\
**Last updated:** [December 7, 2016, 1:45am UTC](https://discourse.piston.rs/t/a-weird-perhaps-impossible-plan-to-deal-with-all-the-extra-c02-in-the-athmosphere/129 "2016-12-07T01:45:45Z")

</div>

Currently, the CO2 levels are 400 ppm (part per million), but it used to be 270 or something. This means there is a lot of molecules that could be put to better use. I think about this sometimes, and yesterday I had an…

---

## [The road to the Last Piece - computing with partial knowledge](https://discourse.piston.rs/t/the-road-to-the-last-piece-computing-with-partial-knowledge/128)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 0\
**Last updated:** [October 17, 2016, 4:40pm UTC](https://discourse.piston.rs/t/the-road-to-the-last-piece-computing-with-partial-knowledge/128 "2016-10-17T16:40:08Z")

</div>

For my project I have now 3 vital pieces in place: A scripting language for in-game programming (Dyon), an idea for balancing an economic system (Mix-Algorithm) and a fictional physical world that explains super heroes (…

---

## [The Youngness Problem - When mind blowing reality snowballs into super heroes](https://discourse.piston.rs/t/the-youngness-problem-when-mind-blowing-reality-snowballs-into-super-heroes/127)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 1\
**Last updated:** [October 14, 2016, 5:09pm UTC](https://discourse.piston.rs/t/the-youngness-problem-when-mind-blowing-reality-snowballs-into-super-heroes/127 "2016-10-14T17:09:14Z")

</div>

This is an idea that I have been working on to understand this year, but was afraid to tell anyone. Usually it is safe to tell people something mind blowing, that gives you a "whoa" experience and that's it. Nothing chan…

---

## [The future of AI - and why I am thinking a lot about UBI](https://discourse.piston.rs/t/the-future-of-ai-and-why-i-am-thinking-a-lot-about-ubi/125)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 0\
**Last updated:** [September 25, 2016, 11:00pm UTC](https://discourse.piston.rs/t/the-future-of-ai-and-why-i-am-thinking-a-lot-about-ubi/125 "2016-09-25T23:00:04Z")

</div>

UBI = Universal Basic Income A lot of people are discussion this now, and here is my take on how the future will be like, using my background from AI, research on algorithms etc. I am posting this here, so people can c…

---

## [Dynamically update a texture / sprite](https://discourse.piston.rs/t/dynamically-update-a-texture-sprite/123)

<div class="topic-metadata">

**Author:** [@lnbb](https://discourse.piston.rs/u/lnbb)\
**Replies:** 1\
**Last updated:** [September 22, 2016, 10:00pm UTC](https://discourse.piston.rs/t/dynamically-update-a-texture-sprite/123 "2016-09-22T22:00:33Z")

</div>

Hi, I'm trying to render a video to a texture. I got it working somehow using an generated ImageBuffer and passing that to the update method: texture.update(&mut window.encoder, &img) Now I want to use this texture…

---

## [Analysis: Why generics scales more than linearly in cost as abstraction](https://discourse.piston.rs/t/analysis-why-generics-scales-more-than-linearly-in-cost-as-abstraction/120)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 0\
**Last updated:** [August 4, 2016, 12:28pm UTC](https://discourse.piston.rs/t/analysis-why-generics-scales-more-than-linearly-in-cost-as-abstraction/120 "2016-08-04T12:28:43Z")

</div>

I remember, several years back, when learning how powerful interfaces and generics was as an abstraction in C#. Rust takes this idea to the extreme: There are very few library abstractions that does not take advantage of…

---

## [Constraint solving using back tracking](https://discourse.piston.rs/t/constraint-solving-using-back-tracking/25)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 2\
**Last updated:** [May 2, 2016, 4:40pm UTC](https://discourse.piston.rs/t/constraint-solving-using-back-tracking/25 "2016-05-02T16:40:12Z")

</div>

I am learning a bit about constraint solving using back tracking. Back tracking is a general algorithm to solve problems where you have partial information about the solution. The algorithm I am using is deterministic …

---

## [About building-block mindset](https://discourse.piston.rs/t/about-building-block-mindset/22)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 0\
**Last updated:** [March 27, 2016, 9:31pm UTC](https://discourse.piston.rs/t/about-building-block-mindset/22 "2016-03-27T21:31:13Z")

</div>

My style of programming goes something like this: Identify and analyze a problem Make some reusable code out of it, a building block Refine and iterate over time Integrate and test with other building blocks This is…

---

## [Has the Piston project a too large scope?](https://discourse.piston.rs/t/has-the-piston-project-a-too-large-scope/19)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 2\
**Last updated:** [March 29, 2016, 9:15pm UTC](https://discourse.piston.rs/t/has-the-piston-project-a-too-large-scope/19 "2016-03-29T21:15:08Z")

</div>

Just some words about this because that is a common outside perspective. The ambitions behind the Piston project are hard challenges which requires an overall planning and architecture. Most people without many years o…

---

## [How productivity is tested in Piston](https://discourse.piston.rs/t/how-productivity-is-tested-in-piston/21)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 0\
**Last updated:** [March 24, 2016, 4:44pm UTC](https://discourse.piston.rs/t/how-productivity-is-tested-in-piston/21 "2016-03-24T16:44:53Z")

</div>

Piston is meant to be used in: commercial production for gamedev interactive applications animation software In addition there are fields that it might be useful: computer science education interactive prototypin…

---

## [Error: unresolved import \`piston::input::\*\`. Am I missing something?](https://discourse.piston.rs/t/error-unresolved-import-piston-input-am-i-missing-something/20)

<div class="topic-metadata">

**Author:** [@mikeroll](https://discourse.piston.rs/u/mikeroll)\
**Replies:** 1\
**Last updated:** [March 23, 2016, 1:07am UTC](https://discourse.piston.rs/t/error-unresolved-import-piston-input-am-i-missing-something/20 "2016-03-23T01:07:53Z")

</div>

Well the title says it: extern crate piston; use piston::input::\*; results in a error: unresolved import \`piston::input::\*\`. Could not find \`input\` in \`piston\` That's on stable rust 1.7.0 with piston = "0.19.0"

---

## [Welcome to the Piston discussion forum!](https://discourse.piston.rs/t/welcome-to-the-piston-discussion-forum/12)

<div class="topic-metadata">

**Author:** [@bvssvni](https://discourse.piston.rs/u/bvssvni)\
**Replies:** 0\
**Last updated:** [March 6, 2016, 4:21pm UTC](https://discourse.piston.rs/t/welcome-to-the-piston-discussion-forum/12 "2016-03-06T16:21:48Z")

</div>

Discourse has generously offered free hosting for the Piston project. This forum is for general discussion about Piston, such as: Things that are not related in particular to a single library Asking for help about u…
