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.


Messages - JDieskau

Pages: [1]
1
SFML projects / [Utility] Stroke
« on: February 17, 2010, 06:18:28 pm »
It looks very good. I will give it a try. But why are you using megaupload? It looks a little bit "unprofessional". Whats wrong with sourceforge/berlios/github/... ?

EDIT: What version of sfml do you use?

2
Graphics / Why is displaying a sf::Sprite so incredible slow? [DONE]
« on: April 02, 2009, 05:08:33 pm »
Code for testing:
Code: [Select]
#include <iostream>
#include <SFML/Graphics.hpp>

int main( int argc, char **argv )
{
  sf::RenderWindow App;
  App.Create( sf::VideoMode::GetDesktopMode(), "Test", sf::Style::Close );

  sf::Image img;
  if ( !img.LoadFromFile ( "test.png" ) ) {
    return false;
  }

  sf::Sprite spr;
  spr.SetImage( img );


  while ( true ) {
    App.Draw ( spr );

    App.Display();
    App.Clear();

    std::cout << 1.f / App.GetFrameTime() << std::endl;
  }
}

Quote
$file test.png
test.png: PNG image data, 1024 x 1024, 8-bit/color RGB, non-interlaced

I've got 6-7 fps on a 2,16Ghz Core2Duo with a GeForce 9600M GT....
What is wrong here? I use sfml 1.4 on Gentoo Linux.

EDIT: Ok, its apparently a bug in the nvidia-driver or xserver. If I turn dualview off, it works pretty good (2000fps).

3
Graphics / Mysterious error when loading an image and use sf::String
« on: April 02, 2009, 04:13:13 pm »
Quote from: "Tank"
What do settings::getVideo() and settings::getWindowSettings()?

And why are you using a pointer at all? You can declare the member variable App as sf::RenderWindow App. Then your constructor could look like:

Code: [Select]

CGame::CGame() :
  App( sf::VideoMode( ... ), "Blah" , ... )
{
  ...
}


Are you sure the window gets opened? You can check it with App.IsOpened(). Maybe either the video mode parameter or window settings parameter is wrong.

Thank you. Now its working!

4
Graphics / Mysterious error when loading an image and use sf::String
« on: April 02, 2009, 03:28:21 pm »
Quote from: "Tank"
What happens if your image's dimensions are powers of two? Some graphics card (mostly olders) don't support dimensions which aren't powers of two.

I'm not sure about this, but does it solve your problem when you first create the window and then load the image? Maybe that ordering is important. I guess Laurent can say more about that.

I created a 64x64px picture and its the same error. BUT you are right, I have to use the sf::Window::Create first!

But in my real project it doesnt help :(
I have a private Variable "sf::RenderWindow* App" in a Class called "CGame". The first what i do in the constructor is this:
Code: [Select]
 App = new sf::RenderWindow;
  App->Create( settings::getVideo(), "Game", sf::Style::Close, settings::getWindowSettings() );

And in main() the first is to create an object of "CGame". So whats wrong now?

5
Graphics / Mysterious error when loading an image and use sf::String
« on: April 02, 2009, 02:23:50 pm »
At first, sorry for my bad english. I hope someone understand me.

Here is a little test-code:
Code: [Select]
#include <iostream>
#include <SFML/Graphics.hpp>

int main( int argc, char **argv )
{
  sf::RenderWindow App;
  sf::String str ( " Test " );

  App.Create( sf::VideoMode::GetDesktopMode(), "Test", sf::Style::Close );

  while ( true ) {
    App.Draw ( str );
   
    App.Display();
    App.Clear();
  }


}

It draws a string in the left upper corner and should look like this:


Allright? Good. Now my problem. I extend the code to this:
Code: [Select]
#include <iostream>
#include <SFML/Graphics.hpp>

int main( int argc, char **argv )
{
  sf::RenderWindow App;
  sf::Image img;

  if ( !img.LoadFromFile ( "test.png" ) ) {
    return false;
  }

  sf::String str ( " Test " );

  App.Create( sf::VideoMode::GetDesktopMode(), "Test", sf::Style::Close );

  while ( true ) {
    App.Draw ( str );
   
    App.Display();
    App.Clear();
  }
}

Annotation:
Quote
$ file test.png
test.png: PNG image data, 50 x 50, 8-bit/color RGB, non-interlaced


And now it looks like shit:

In my opinion, the code is right. Whats wrong here?
Btw. if I instantiate the sf::String first, then it looks like picture 1 - all right. But something goes definitive wrong. Any idea?


I use Gentoo Linux. My tested sfml versions are: 1.4, trunk svn und brunch 2.0 svn

EDIT 1: With the svn version i get this error message:
Quote
Failed to create image, its internal size is too high (300x230)

Its an texturesize ore somesthing like that? OpenGL? But 300x230? I have a NVidia GeForce 9600M GT and the newest stable driver -> 180.29

6
General discussions / Benchmark : SDL vs SFML
« on: May 12, 2008, 12:53:35 pm »
Benchmark: 20080507
SFML Version: latest svn
SDL: 1.2.11

My maschine:
Quote
AMD Athlon 64 X2 Dual Core 6000+ 3.00GHz
2 GB DDR2-800 Ram
GeForce 8500GT
Ubuntu Linux ( 2.6.22-14-generic )


Result:
Quote
1/ Test : sprites
SDL  displayed 20 frames
SFML displayed 137 frames
--> SFML is 685% faster than SDL

2/ Test : alpha-blended sprites
SDL  displayed 7 frames
SFML displayed 98 frames
--> SFML is 1400% faster than SDL

3/ Test : rotating sprites
SDL  displayed 4 frames
SFML displayed 134 frames
--> SFML is 3350% faster than SDL

4/ Test : static text
SDL  displayed 1267 frames
SFML displayed 4600 frames
--> SFML is 363% faster than SDL

5/ Test : dynamic text
SDL  displayed 1020 frames
SFML displayed 1625 frames
--> SFML is 159% faster than SDL

Pages: [1]
anything