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

Pages: [1]
1
Audio / accessing soundrecorder-data while recording
« on: July 19, 2011, 05:56:52 pm »
Hi,

we want to implement a "voicekey" in software, i.e. a sound activated relay.
Therefore, we need to 'listen' online to the sound data while recording.
Is it possible to read the data recorded with the sound recorder while
recording? Aim: measuring the time from start recording until a specific
sound pressure level is exeeded.

Thanks in advance - Sven

BTW: we are still with sfml 1.4 (never change a running system in
experimental psychology)

2
Graphics / dummy question on sf::Image::CopyScreen
« on: November 21, 2008, 04:19:09 pm »
Hi,

after discovering sf::Image::CopyScreen I thought I could draw some text on the screen, invoke Image::CopyScreen to copy the relevant part of the screen to an image and after that to set a corresponding sprite.

Code: [Select]

sf::String Letter("B", Arial100, 100) ;
sf::Image Image1 ;
sf::Sprite Sprite1;

Letter.SetPosition( 0, 0 ) ;
Screen.Draw( Letter) ;
Image1.CopyScreen( Screen, sf::IntRect(0, 0, 100, 100) ) ;
Sprite1.SetImage( Image1 );


But this results in an 'empty' image/sprite. Thus, something must be wrong with my thinking Image::CopyScreen works.

Please, can someone enlighten me :-)

Thanx - Sven

3
Graphics / svn: Image.LoadFromFile and Image.Create crashes
« on: November 17, 2008, 11:32:36 am »
Hi...

Code: [Select]
sf::Image Image1 ;
Image1.Create( 100, 100, sf::Color::Blue ) ;


crashes with 0xC0000005. This holds true for several different computers running Windows XP SP2 or SP3. On _some_ pretty new machines the code runs without error.

If I create a really small image, say Create( 10, 10,...) the program doesn't crash but the image is garbage (random pixels in the image area).

The same behavior can be seen with Image.LoadFromFile():

Code: [Select]
sf::Image Image1 ;
Image1.LoadFromFile("mypic.bmp") ;


crashes on some machines, on others a garbage picture is displayed, on very new computers it works.

This whole thing seems similar to the svn: font problem
http://www.sfml-dev.org/forum/viewtopic.php?t=704

Since the created or loaded images are garbage, maybe a memory allocation problem, same could be the reason for crashes on font load.

ciao - Sven

4
Graphics / FlipX and FlipY for sfml strings
« on: November 14, 2008, 03:31:06 pm »
Hi...

for sprites FlipX and FlipY allow to flip them, but for
strings these functions are missing. Unfortunately I
need them. Is there an easy way to get what I need?

Thanks for your help - Sven

5
Graphics / svn: font problem
« on: October 15, 2008, 02:01:50 pm »
Hi,

I switched from sfml 1.3 to the svn-version, now I experience
a fundamental problem with fonts:

the program crashes after font loading with error code
0xC0000005.

I verified this with the sfml tutorial demo graphics-fonts.cpp

Any help is appreciated,

Sven

6
Window / useless UseVerticalSync()?!?
« on: September 12, 2008, 02:22:36 pm »
Hi all,

while testing frame rates I came upon the following problem: changing between UseVerticalSync(true) and UseVerticalSync(false) does not make any difference. On my desktop computer I have a frame rate of 250 Hz (graphics card set to 60 Hz) irrespective of VerticalSync true or false. On my Laptop I have a frame rate of 40 (!) Hz (graphics card set to 60 Hz).


Code: [Select]
 while( Screen0.IsOpened() ) {
        Screen0.UseVerticalSync(true);  // or false
        Clock.Reset() ;
        do {
            Screen0.Draw( Text ) ;
            Framerate = 1.0f / Screen0.GetFrameTime();
            std::sprintf( buf, "Refreshrate %5.2f Hz", Framerate ) ;
            Text2.SetText( buf ) ;
            Screen0.Draw( Text2 ) ;
            Screen0.Display() ;
        } while( Clock.GetElapsedTime() < 5.0f ) ;
      Screen0.Close() ;
    }


Obviously UseVerticalSync does not work. Does anybody have any idea why?

7
Graphics / Problem with frame times
« on: July 10, 2008, 01:48:56 pm »
Hi, I'm just checking the display timing (sfml 1.3, WinXP SP3) and do
not understand all the results...

Code: [Select]
Screen0.UseVerticalSync(true);
        Clock.Reset() ;
        do {
            Screen0.Draw( Text ) ;
            Text.Move( 1,1 ) ;
            times[ i++ % 100 ] = Screen0.GetFrameTime() ;
            Screen0.Display() ;
        } while( Clock.GetElapsedTime() < 2.0f ) ;


Since the graphics refresh rate is 60 Hz, I expected a 16.6 ms frame time.
Actually, the frame times are 16.5 to 16.8 ms. That's fine.

Now, I'm doing the same without any output to the screen:

Code: [Select]
Screen0.UseVerticalSync(true);
        Clock.Reset() ;
        do {
             times[ i++ % 100 ] = Screen0.GetFrameTime() ;
            Screen0.Display() ;
        } while( Clock.GetElapsedTime() < 2.0f ) ;


Again I expect 16.6 ms frame time but I get 14.5 to 14.7 ms.
How is this possible with 60 Hz refresh rate and UseVerticalSync( true )?

Now I switched off vertical sync:

Code: [Select]
Screen0.UseVerticalSync(false);
        Clock.Reset() ;
        do {
             times[ i++ % 100 ] = Screen0.GetFrameTime() ;
            Screen0.Display() ;
        } while( Clock.GetElapsedTime() < 2.0f ) ;


Same timing results... as if UseVerticalSync(false) does not work.

Now I tried a little bit more graphics and vertical sync on:

Code: [Select]
Screen0.UseVerticalSync(true);
        Clock.Reset() ;
        do {
            Screen0.Draw( Line ) ;
            Screen0.Draw( Circle ) ;
            Screen0.Draw( Rect ) ;
            Screen0.Draw( Text ) ;
            Screen0.Draw( Polygon ) ;
            Text.Move( 1,1 ) ;
            Circle.Move(1,-1) ;
            Rect.Rotate(1) ;
            times[ i++ % 100 ] = Screen0.GetFrameTime() ;
            Screen0.Display() ;
        } while( Clock.GetElapsedTime() < 2.0f ) ;


This results in frame times of approx. 18-19 ms. How that? With
UseVerticalSync(true) I expect frame times as integer multiples of
1000 / FrameRate, for a 60 Hz graphics card 16.6 or 33.2 and so on.

Any idea?

Thanks in advance - Sven

8
General / SFML to control cognitive psychology experiments
« on: July 08, 2008, 05:09:50 pm »
Hi,

we are currently looking for a new programming environment/libraries
to program experiments for cognitive psychology. Until today we are
working with DOS (full hardware control), but a transition to windows
is unavoidable ...

Okay, we need high precision timing, access to the parallel port
AND good control of the display/screen. I would like to ask especially
for the display issue some questions. Maybe someone can give
use the necessary information to opt for or against sfml.

We always need more than one graphics display, one visible, the
others virtual screens, sometimes called double buffering or page
flipping. All screens are fully prepared (rendered) before the presentation
starts to avoid any latencies due to time consuming graphics commands
or file access to load pictures or whatelse.

A typical instruction sequence looks like this (pseudo-code)

for ( trial=1; trial < maxtrials; trial++ ) {
   prepare_all_screens() ;
   show_screen_1_for_some_time();
   show_screen_2_for_some_time();
   show_screen_3();
   start_timer();
   wait_for_participant_response();
   stop_timer();
}

Is it possible to have multiple virtual screens with sfml,
rendering to invisible screens, switching beween screens,
switching synchronized with the vertical retrace?

Thanx in advance - Sven

Pages: [1]
anything