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

Pages: 1 [2] 3 4
16
Graphics / is it possible to change an image?
« on: September 07, 2008, 06:25:14 pm »
Hi,
Is it possible to draw on an image and if not, why does Image has a save function?

17
Feature requests / True OOP
« on: August 16, 2008, 12:09:58 am »
Quote
An Apple does not have a GetSkinColor().. It has a SkinColor().

But it's still a method => an action.
You can get the Skin color of an apple => you can GetSkinColor()
but you can't SkinColor() an apple.

18
Feature requests / True OOP
« on: August 15, 2008, 05:56:26 pm »
I think what you're saying is just wrong(at least if I understand what you want to say: you're saying that you should access the membervariables directly, right?), because in a truly object oriented program classes should never make their membervariables public.
The concept is called data encapsulation and is one of the basic things in objectorientation.
Just because a class can offer public membervariables in C++ it's not said that it is object oriented.

19
General / Windows in Linux
« on: August 14, 2008, 06:14:39 pm »
Quote
You need a few external libraries, SFML is not just plain standard C++  

From what I see, you need at least Xlib and GLX development libraries.

But normally there's a ./configure which checks for those libraries ^^

However:
I just wanted to say, that I'm also using Ubuntu 8.04 with Compiz Fusion and I never had graphical problems(however, the sound isn't working, but that's another topic). It worked with activated compiz as well as with metacity.

20
General discussions / .hpp and floats
« on: August 11, 2008, 11:46:12 pm »
most people use .h(I think), but sfml is not the only lib which uses .hpp. Another (very popular) example would be boost.
However it doesn't matter which extension they have.

I think Float matters for vram, OpenGL and DirectX both use floats, so it wouldn't make sense that sfml takes doubles and then converts them.

21
Graphics / Does SFML draw slower on a wxWidgets Control
« on: August 07, 2008, 11:03:20 pm »
Hi,
I have a speed problem when I draw a map with 20*15 32*32 Tiles(Sprites).
I've already drawn something similiar directly on a RenderWindow(maybe you remember, I asked about speed in debugmode).

Before I start figuring out why it is so slow(gprof analyzes 0.19 cumulative seconds and 0.00 self seconds) I wanted to ask if there's something different with a wxWidgetswindow, so that drawing is generally slower?

22
Graphics / Compiz Fusion and SFML, could this be a SFML bug?
« on: August 06, 2008, 04:07:19 pm »
There's a difference between a graphical problem with SFML and Compiz Fusion on Ubuntu and a kind of crash of Compiz F.
For now everything seemed to be shown correctly, so it's not the problem described in the thread(however, the sound doesn't work, but this doesn't matter). Most times when I start my program, everything works fine, but sometimes Compiz "freezes".

23
Graphics / Compiz Fusion and SFML, could this be a SFML bug?
« on: August 05, 2008, 07:43:27 pm »
Hi,
I have a big problem with my program, which started when I replaced the drawing code from wxWidgets with SFML Drawing Code(because of the performance).
Sometimes(about 1 third of all trys) during the execution of the program comiz fusion gets incredebly slow(first I thought X is frozen), it always happens during a compiz fusion effect. It only happens when my program is running, but even if it does nothing compiz sometimes crash during an effect. With metacity --replace everything works fine again, so I think it only occures with Compiz.
Because there should be no way how my Code could crash compiz fusion
I think it could be something with OpenGL(I'm not using OpenGL Code, but Compiz Fusion is and I think SFML is too(?))
I'm using SFML 1.3, wxWidgets, Boost and Ubuntu 8.04.

I hope you can help me :(

24
Graphics / Does SFML draw things that are not visible?
« on: July 30, 2008, 04:31:13 pm »
okay, then I will have to take care, that they're not to not loose performance on big maps...

n.T. = no Text

25
Graphics / Does SFML draw things that are not visible?
« on: July 30, 2008, 04:22:17 pm »
n.T.

26
Graphics / Resize VideoMode?
« on: July 24, 2008, 05:26:45 pm »
x.x I already tried that and it didn't work.
Now I tried it again and it works fine.
Well, Thanks

27
Graphics / Resize VideoMode?
« on: July 24, 2008, 05:11:35 pm »
That's not possible, because the User can resize it and I don't want any shrinking, stretching, or odd appearances(like the current).
So it wouldn't solve the problem.

28
Graphics / Resize VideoMode?
« on: July 24, 2008, 04:50:23 pm »
Ok,
RenderWindow::GetWidth() and RenderWindow::GetHeight() are both 20 while wxControl::GetSize()::GetWidth() and Height both have the expected values, after calling resizeSFWindow(true);(code in the post before).
The breakpoint at line 91 is reached.

29
Graphics / Resize VideoMode?
« on: July 24, 2008, 03:57:23 pm »
mhm, it doesn't work, at least not as I expected it to do.
I will explain what's the problem:
The window is a RenderWindow embedded in a wxControl.
First I just tried to draw on it, but it looked like this:

I expected that it looks like this, because the RenderWindow is created(with the Tutorialcode for wxGTK) before wxWidgets adjusts the size of the window(It's in a wxSizer).
So I thought I would have to resize the VideoMode(which was probably wrong) so I asked and tried the following Code:
Code: [Select]

 87 void MappingTool::resizeSFWindow(bool force)
 88   {
 89   static int width(0), height(0);
 90   if(width != GetSize().GetWidth() || height != GetSize().GetHeight() || force)
 91     GetDefaultView().SetHalfSize(GetSize().GetWidth()/2.0, GetSize().GetHeight()/2.0);
 92   width = GetSize().GetWidth();
 93   height = GetSize().GetHeight();
 94   }

But now it's looking like this:

(a few pixelrows are cut, but that doesn't matter, but it IS smaller than the first Image)

The first Image shows the upper left corner of the desired image, the second one is extremly shrinked.
So what could it be? How can I show the Image how it should be?


I don't think that you need it, but
here's the DrawingCode:
Code: [Select]

 52   wxPaintDC dc(this);
 53  
 54   sf::Sprite tileset;
 55   if(map)
 56     {
 57      
 58     if(currentTileset == MainTileset)
 59       tileset = ImageList::GetInstance()->GetSpriteByImage(map->GetMainTileset().GetImage());
 60     else if(currentTileset >= 0)
 61       tileset = ImageList::GetInstance()->GetSpriteByImage(map->GetSideTileset(currentTileset).GetImage());
 62     }
 63   sf::Shape rectangle(sf::Shape::Rectangle(0, 0, tileset.GetSize().x, tileset.GetSize().y, sf::Color(255, 255, 255, 255)));
 64   Draw(rectangle);
 65  
 66   if(map)
 67     Draw(tileset);
 68  
 69   Display();

And this is there Code where the Sprite comes from:
Code: [Select]

201 const sf::Sprite& ImageList::GetSpriteByImage(SFImageID id)
202   {
203   if(spriteIDs[id] == -1)
204     {
205     sf::Sprite sprite(sfImages[id]);
206     sfSprites[id] = sprite;
207     spriteIDs[id] = sfSprites.size() - 1;
208     }
209
210   return sfSprites[id];
211   }

and sfImages[id] is set up here:
Code: [Select]

 65 SpriteID ImageList::addSFImage(bf::path imagePath, std::string subDir)
 66   {
 67   bf::path ImageDir(copyImageToDirectory(imagePath, subDir));
 68
 69   std::string filePath((ImageDir/imagePath.leaf()).native_file_string());
 70   sf::Image image;
 71   image.LoadFromFile(filePath);
 72
 73   sfImages.push_back(image);
 74   spriteIDs[sfImages.size() - 1] = -1;
 75
 76   return sfImages.size() - 1;
 77   }

30
Graphics / Resize VideoMode?
« on: July 24, 2008, 01:07:32 am »
Hi,
I have a sfml RenderWindow which is also a wxControl and I don't want any stretching or shrinking or something else when I resize the wxControl.
So I tried to use the method sf::RenderWindow::Create to set up a new VideoMode, but it's opened in a new Window, and not where it should be.
What can I do?

Pages: 1 [2] 3 4