Hello,
I am working with Mindwave EEG Headset and reading users brain activity using my metro test app for school project. I have (thankfully) overcome a lot compatibility issues with this headset and Windows 10 UWA - but at the end I got that thing working and reading data flawlessly in my UWA app.
I have never worked with any graphically rich nor any “game engines” or even 2D graphics but I saw this webpage yesterday: http://gregtatum.com/poems/stochasticity/1/ and I was stunned and immediately interested in building something similar that will react to user brain activity thanks to my already working EEG app. I was searching for some framework that is already compatible with W10 UWA and MonoGame came up, so that is why I am here
I already spend few hours searching for some samples on github and around the web but did not found anything similar…can somebody in this great community provide me with similar simple sample code or any tutorial that can help a beginner build something similar, not necessary this beautiful but I want to have some “graphical representation” of user brainwaves in my project. If somebody can write me sample code that I can build on I will shure credit you in the application itself. Every help is much appreciated.
Thank you in advance and have a nice day Monogame community !
// Put in LoadContent or Initialize (create fields in the game class)
Texture2D texture = new Texture2D(this.GraphicsDevice, 400, 240);
Color[] color = new Color[400 * 240];
SpriteBatch spriteBatch = new SpriteBatch(this.GraphicsDevice);
// Put in Update
// Set color array contents
color[0] = new Color(255, 0, 0); // Red
color[1] = new Color(0, 255, 0); // Green
color[2] = new Color(0, 0, 255); // Blue
// Set the texture content
texture.SetData<Color>(color);
// Put in Draw
spriteBatch.Begin();
spriteBatch.Draw(texture, Vector2.Zero, Color.White);
spriteBatch.End();
You can use this.GraphicsDevice.Viewport.Width and this.GraphicsDevice.Viewport.Height to get the actual screen resolution.
Thanks for the fast reply, looks pretty straightforward. But I ran into a strange problem. I put your code into specified parts and created fields in game class, but it still does not draw anything. Can you paste me the whole .cs file please if you have some time ?