Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Pikablu

Pages: [1]
1
DotNet / Streaming music from web
« on: June 17, 2014, 09:53:44 pm »
Are there any examples for streaming music from the web? I've been trying to just pass an HttpResponseStream into the standard Music class, but I end up with a NotSupportedException saying the stream doesn't support seek operations. I'm using a normal ogg file (http://upload.wikimedia.org/wikipedia/en/4/45/ACDC_-_Back_In_Black-sample.ogg).

Am I supposed to do it in some other way, or is it just not supported?

Thanks

Here's my code:

        static void Main(string[] args) {
            RenderWindow window = new RenderWindow(new VideoMode(800, 600), "SFML_App", Styles.Titlebar);

            HttpWebRequest request;

            request = (HttpWebRequest)WebRequest.Create("http://upload.wikimedia.org/wikipedia/en/4/45/ACDC_-_Back_In_Black-sample.ogg");
            Stream stream = request.GetResponse().GetResponseStream();

            SFML.Audio.Music music = new SFML.Audio.Music(stream);
            music.Play();

            while (window.IsOpen()) {
                window.DispatchEvents();
            }
        }

2
DotNet / Problem with mouse + keyboard input
« on: December 07, 2013, 12:24:07 am »
Hey everyone,

I've been playing around with the .net binding for a while now, and I've come into a small problem with handling keyboard and mouse input at the same time. In what I've tried, whenever I type something and click on the window at the same time with the left mouse button, the click is ignored until I stop typing. However, typing and clicking with any other button will handle the clicks properly.

Here's an example which has the same effect (using sfml 2.1):

 
        static void Main(string[] args) {
            RenderWindow window = new RenderWindow(new VideoMode(800, 600), "SFML_App", Styles.Titlebar);

            window.MouseButtonPressed += window_MouseButtonPressed;

            while (window.IsOpen()) {
                window.DispatchEvents();
            }
        }

        static void window_MouseButtonPressed(object sender, MouseButtonEventArgs e) {
            Console.WriteLine("Clicked: " + System.Environment.TickCount);
        }
 

Any ideas?

Pages: [1]