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

Pages: [1] 2
1
Graphics / locale error by using sf::STring
« on: February 04, 2009, 04:38:19 pm »
hi,
When I use sf::String in my program (just sf::String test("hi")), I get the following error:
Code: [Select]

locale::facet::_S_create_c_locale name not valid - terminating...

what does this mean and is there a way for me to fix this?

2
SFML website / SFML 1.4 Documentation no link to source?
« on: January 09, 2009, 04:49:34 pm »
Hi,
I miss the direct links from the documentation of SFML 1.4 to the implementation of a function.
They may have been removed because they aren't necessary but even if they aren't necessary I found them really usefull not only to learn something about the usage of sfml but also to learn something in general.
(Of course I can still view the sources but the links in the documentation were usefull).

3
Graphics / GetPixelsPtr() power of two it pot is not allowed?
« on: January 08, 2009, 08:40:00 pm »
Hi,
I'm using sf::Image to load an image from a file and I'm using GetPixelsPtr() to get the pixeldata. The documentation states that the size of the image is GetWidth() * GetHeight() * 4 but is this always true? For example if there's no GL_ARB_texture_non_power_of_two is GetPixelsPtr NPOT?
And is there an easy way to get a pot pixel data with sfml(I mean sfml has to do this somewhere so...)

4
Graphics / mixing sf::String with OpenGL - text is always white.
« on: January 06, 2009, 07:46:40 pm »
Hi, I want to use SFML to create a window and handle input for OpenGL but I also want to use SFML for drawing strings(because it seams easy to me and I don't want to search for another OpenGL textlibrary).
Now I have a code to draw an image(with texturemapping) but when I execute the function, no matter if it is before or after the textdrawing, the drawn string is always white.
That's the relevant codepart:
Code: [Select]

img->draw(); // if I comment this line out the text is red as it should be

if(m_show_fps)
{
static int i(0);
stringstream fps("");
fps << "fps: " << static_cast<int>(1/m_window->GetFrameTime()) << endl;
sf::String fps_drawable(fps.str(), Font::GetDefaultFont(), 10);
fps_drawable.SetColor(Color::Red);
m_window->Draw(fps_drawable);
}

And image::draw
Code: [Select]

void image::draw() const
{
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

glEnable(GL_TEXTURE_2D);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glBindTexture(GL_TEXTURE_2D, m_tex_name);

glVertexPointer(coord_per_vertex, GL_SHORT, coord_per_vertex*sizeof(GLshort), &m_vertices[0]);
glTexCoordPointer(texel_per_vertex, GL_FLOAT, texel_per_vertex*sizeof(GLfloat), &m_tex_coords[0]);

glDrawElements(GL_QUADS, vertices_per_square, GL_UNSIGNED_BYTE, &m_indices[0]);
glFlush();
}

5
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?

6
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?

7
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 :(

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

9
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?

10
Window / wxWidgets and SFML on Linux(wxGTK)
« on: July 19, 2008, 10:09:32 pm »
Hi, I have a little problem with an error that's very hard to debug, because it doesn't occur everytime. It's probably something with Multithreading.
It directly shuts down when the program starts, I think that it's because of something in which sfml is involved, but I can't tell for sure(because I can't find anything out about a randomly occuring problem)

I hope you can help me :/
that's the output
Quote

The program 'HephaistosGameForge' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
  (Details: serial 33 error_code 3 request_code 3 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
Locking assertion failure.  Backtrace:
#0 /usr/lib/libxcb-xlib.so.0 [0x7fd67ac3297c]
#1 /usr/lib/libxcb-xlib.so.0(xcb_xlib_lock+0x15) [0x7fd67ac32a15]
#2 /usr/lib/libX11.so.6 [0x7fd67ce3a323]
#3 /usr/lib/libGL.so.1 [0x7fd680e7f0e6]

When I run it with --sync the error never occures!

I can post the sfml code but it's nearly copied out of the tutorial
Code: [Select]

  1 #ifndef SFMLWXSCROLLEDWINDOW_H_INCLUDE
  2 #define SFMLWXSCROLLEDWINDOW_H_INCLUDE
  3
  4 #include <SFML/Graphics.hpp>
  5 #include <wx/wx.h>
  6
  7 class SFMLwxScrolledWindow : public wxScrolledWindow, public sf::RenderWindow
  8   {
  9   public:
 10     SFMLwxScrolledWindow(wxWindow* Parent = NULL, wxWindowID Id = -1, const wxPoint& Position = wxDefaultPosition, const wxSize& Size = wxDefaultSize, long Style = 0);
 11     virtual ~SFMLwxScrolledWindow();
 12   private:
 13     DECLARE_EVENT_TABLE()
 14   };
 15
 16 #endif


  1 #include "SFMLwxScrolledWindow.h"
  2
  3 #ifdef __WXGTK__
  4     #include <gdk/gdkx.h>
  5     #include <gtk/gtk.h>
  6     #include <wx/gtk/win_gtk.h>
  7 #endif
  8
  9 BEGIN_EVENT_TABLE(SFMLwxScrolledWindow, wxScrolledWindow)
 10 END_EVENT_TABLE()
 11
 12
 13 SFMLwxScrolledWindow::SFMLwxScrolledWindow(wxWindow* Parent, wxWindowID Id, const wxPoint& Position, const wxSize& Size, long Style) :
 14   wxScrolledWindow(Parent, Id, Position, Size, Style)
 15   {
 16   #ifdef __WXGTK__
 17     //Get the lowlevel Window
 18     gtk_widget_realize(m_wxwindow);
 19     gtk_widget_set_double_buffered(m_wxwindow, false);
 20     GdkWindow* Win = GTK_PIZZA(m_wxwindow)->bin_window;
 21     XFlush(GDK_WINDOW_XDISPLAY(Win));
 22     sf::RenderWindow::Create(GDK_WINDOW_XWINDOW(Win));
 23   #else
 24     sf::RenderWindow::Create(GetHandle());
 25   #endif
 26   }
 27
 28 SFMLwxScrolledWindow::~SFMLwxScrolledWindow()
 29   {}


I really hope you can help me, because I've completly no idea how I can found the cause of this problem.

11
General / Linux - Debuglibs
« on: July 19, 2008, 05:44:44 pm »
Hi,
Because there are no debuglibs with the linux version(why?) I tried to compile it by myself.
But how can I compile the debuglibs?

And when I try to compile the releaseversion I get the following error
Quote

g++ -o SoundFile.o -c SoundFile.cpp -W -Wall -pedantic -I../../../include -I../../ -DNDEBUG -O2 -fPIC
In file included from SoundFile.cpp:29:
../../SFML/Audio/SoundFileDefault.hpp:32:21: error: sndfile.h: No such file or directory
In file included from SoundFile.cpp:29:
../../SFML/Audio/SoundFileDefault.hpp:128: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:129: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:130: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:131: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:132: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:141: error: ‘sf_count_t’ does not name a type
../../SFML/Audio/SoundFileDefault.hpp:147: error: ISO C++ forbids declaration of ‘SNDFILE’ with no type
../../SFML/Audio/SoundFileDefault.hpp:147: error: expected ‘;’ before ‘*’ token

What do I have to install to have a sndfile.h ?

12
Graphics / Why is SFML in Debugconfiguration so slow?
« on: April 04, 2008, 03:54:40 am »
Hi
I recognized that I have a about 15 times faster output when I compile in Release mode, so debug mode is way to slow to debug what I'm doing.
(about 530 fps when showing nothing in both mode, a really small map 32*32 px per tile and 20*15 tiles(always the same tile) has about 18 fps in Debug mode and about 275 fps in Releaseconfiguration)
Is there a way to speed it up?

13
Graphics / Draw on wxWidgets with double-Buffering
« on: March 26, 2008, 04:54:58 pm »
Hi
I want to draw on a control with SFML and wxWidgets(I need SFML there but I also have to draw primitives like lines, so I have to use the normal wxWidgets drawing, too).
It works fine as long as I use wxPaintDC, but when I use wxBufferedPaintDC I can't draw with sfml.
But I need double buffering? What shall I do?

14
Graphics / Delete sf::Image in destructor?
« on: March 25, 2008, 11:04:53 pm »
Hi
I have an sf::image created with new in the constructorcode of my object.
For testing purposes I have created an std::string with new at the same location.
When I'm deleting the sf::image in the destructor I get an access violation(I'm not using this object in any place I just created and deleted it)
It's not a problem with my class, because I can delete the string without problems.
So how can I delete the sf::Image without an access violation?(I have the same problem with an Smart Pointer(boost::shared_ptr) or when not using a pointer at all.

15
Graphics / how do I use sf::Image::LoadFromMemory correctly?
« on: February 28, 2008, 05:35:14 pm »
I tried the following
Code: [Select]

  std::ifstream file("C:\\Main\\Tools\\RMXP\\RTP\\Graphics\\Tilesets\\001-Grassland01.png");
  int size = FileSize("C:\\Main\\Tools\\RMXP\\RTP\\Graphics\\Tilesets\\001-Grassland01.png");
  char* image = new char[size];
  file.get(image, size);
  sf::Image img;
  img.LoadFromMemory(image, size);

But it doesn't work (Image not of any known type or corrupt), the file is okay, so what do I have to do to load an image from Memory?

Pages: [1] 2
anything