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 - katrin

Pages: [1]
1
General / SFML 1.6. and iostream
« on: May 25, 2010, 02:20:31 pm »
Hi,

I've searched the forum but either with the wrong key-words or the wrong problem :-). So here is my problem:

I would want to move from SFML 1.4 to 1.6 and experience a problem with the following little program:

Code: [Select]


#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
    cout << "hello world" << endl;

    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();
    }


    return EXIT_SUCCESS;

}



Using Code::Blocks 8.02 and static linking with
Mingw gcc4.4 and SFML 1.4 -> everything is fine!
Mingw gcc4.4 and SFML1.6 -> program as is crashes!
What works:
1. If I comment out #include<iostream> and the output-to-console-line

2. If I leave iostream and the output to the console but comment out the window-application loop

Is there any known problem with SFML and iostream?

I appreciate any help!

2
Window / set mouse cursor to position
« on: June 08, 2009, 02:30:30 pm »
hi

in my current programm, i need the mouse cursor to be visible at a certain point of the programm - no prob, just set Window.ShowMouse( true ) :D . so far so good but i aktually want the mouse cursor to appear at a defined position.

i know how to *get* the mouse cursor position but is there any way to *set* the mouse cursor position???

any help appreciated

3
Audio / sf::SoundBufferRecorder problem
« on: October 30, 2008, 09:06:24 am »
I just came upon a problem with the sf::SoundBufferRecorder. I am trying to use it in a loop just like this:
Code: [Select]
sf::SoundBufferRecorder Recorder;
vector< sf::SoundBuffer> RecBuffer(n);

for (i=0; i<n; i++) {

     \\do something
     Recorder.Start() ;
     \\ Wait for something
     Recorder.Stop();

     RecBuffer[i]=Recorder.GetBuffer() ;
}


That does not work, because when saving the content of the RecBuffer, all file have the same size and content, namly the first input.

So what I did, I createt the sf::SoundBufferRecorder as an array and changed the loop accordingly. That works fine, but is it the right way?!
By the way, creating it as a vector (like the sf::SoundBuffer) instead of an array it gives me an error, that's why I am unsure about the array solution.

May be I did not properly understand the functionality of the sf::SoundBufferRecorder?!? Could anybody help?! I need to record stuff in a loop (experimental trials) and save it as file.

Oh, yeah, I'm using SFML 1.3 with XP SP2.

thanx

4
Window / no game loop: display() problems
« on: October 10, 2008, 02:37:10 pm »
hi folks,

first of all, i don't use a typical game loop since i'd like to prepare one screen while showing the other. thus i have at least two screens:

 
Code: [Select]

    sf::VideoMode DesktopMode = sf::VideoMode::GetDesktopMode();    
    sf::RenderWindow Screen[2] ;                                    

    for( i = 0 ; i < 2 ; i++ ) {                                    
        Screen[ i ].Create( DesktopMode, "", sf::Style::None ) ;  
        Screen[ i ].Show( true ) ;                                  
        Screen[ i ].SetFramerateLimit( 0 ) ;                        
        Screen[ i ].UseVerticalSync( true );                        
        Screen[ i ].ShowMouseCursor( false ) ;                    
        Screen[ i ].SetBackgroundColor(sf::Color(255, 255, 255));  
    }

    for( i = 0 ; i < 2 ; i++ ) {                                  
        Screen[ i ].Display() ;                                    
        Screen[ i ].Show( false ) ;
    }
    ...


now, one screen gets prepared, while showing the other:

Code: [Select]


    Screen[ 0 ].Show( true ) ;
    Screen[ 1 ].Show( false ) ;
    Clock.Reset() ;
    Screen[ 0 ].Display() ;                                        
    Screen[ 1 ].Draw( text ) ;                                    
    WaitUntilMS( Clock, 500 ) ;  // waiting for 500ms

    Screen[ 1 ].Show( true ) ;
    Screen[ 0 ].Show( false ) ;
    Clock.Reset() ;
    Screen[ 1 ].Display() ;
    Screen[ 0 ].Draw( anothertext ) ;                                    
    WaitUntilMS( Clock, 50 ) ;  // waiting for 50ms

    Screen[ 0 ].Show( true ) ;
    Screen[ 1 ].Show( false ) ;
    Clock.Reset() ;
    Screen[ 0 ].Display() ;
    Screen[ 1 ].Draw( yetanothertext ) ;                                      
    WaitUntilMS( Clock,50 ) ; // waiting for 50ms
   ...


this code works perfectly well on some computers, but not on others. on the non-working machines the first two displays are okay, while the third display shows a blend of display one and three.

does anybody have any idea or solution or works with muliple screens? my main goal is to prepare one screen, while showing the other.

any help is appreciated,
thanx
katrin

Pages: [1]
anything