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

Pages: [1] 2
1
SFML wiki / Filter class
« on: January 10, 2010, 10:35:21 am »
You don't impose anything for sure. But to make the effect work fullscreen, any user would have to supply a fullscreen image. I'd suggest a stretch parameter, allowing any size of image as in the original version (could be used for watermark effect for instance), but also a small image stretched, as I was proposing above.

2
SFML wiki / Filter class
« on: January 05, 2010, 07:23:56 pm »
Well, it seems really overkill to use a 800x600 picture, which will need to be loaded from disk into RAM then into VRAM, just to display a fullscreen color. Not to mention it is not portable from a resolution to another (ie if you resize the window to 1024x768, part of your picture won't mask the window).

You could easily achieve the same effect with a 1 pixel picture (stretching your image) or without a picture with a simple quad (using OpenGL, or maybe a SFML Shape).

3
Graphics / performance drop linux vs. vista
« on: October 24, 2009, 09:25:55 pm »
Just my 2cts...
My own project is tile-based (using code found in old revisions of SFML, so it's made of display lists of quads, OpenGL code), runs with no perceivable differences on Vista vs XP. Haven't tried any Linux box though.

You say you're 'blitting', are you using OpenGL textures on quads or sf::Sprite or ...?

4
General / SFML game engine crashes on exit
« on: October 24, 2009, 09:22:51 pm »
First thing that comes to mind when I hear about a crash when deleting something is "double delete".
You could try to remove deletion of items until it doesn't crash.
Maybe you took a pointer to a local variable stored in some structure (array, list, etc).

Hope this helps :)

5
Graphics / [IMPORTANT!] Using floats for projection matrix sucks.
« on: June 22, 2009, 12:31:31 pm »
Just to push a bit this issue, I've got the same bugs using tilemaps. I hadn't given it much thought, but the rounding issue make sense.
So +1 on any fix, whether an opt-in feature or a default one.

6
Graphics / Move by Keypressing
« on: May 10, 2008, 05:05:46 pm »
Just wanted to mention:
Code: [Select]
Angle_Bogen = 2 * 3.1415 / 360 * (Angle + 90);

Personally, I'd rather not mix integers (2, 360, 90) with double precision (3.1415) in arithmetic operations, especially not if there are divisions involved.
Either this is meant to yield integer results, and I had explicit casting (like (int)(2*3.1415) for example, or static_cast<int>(2*3.1415)), or double, and I make all values double like this:
Code: [Select]
Angle_Bogen = 2.0 * 3.1415 / 360.0 * (Angle + 90.0);
Just to avoid some weird bugs when values get truncated in the middle of a computation.

7
Graphics / sf::RenderWindow::OptimizeForNonOpenGL(true) not in SVN?
« on: April 23, 2008, 03:43:22 pm »
Default (preserve = false, or optimize = true) is OK for you if you don't use OpenGL.

8
Graphics / View/RenderWindow API change [SVN] (issues + solution)
« on: April 22, 2008, 02:10:08 pm »
Regardless of thread safety, the correct implementation for my case is as follows:
Code: [Select]
void Game::SetupViewOnceAndForAll()
{
    sf::View &view = m_RenderWindow->GetDefaultView();
    const float halfWidth = m_ViewWidth / 2.0f;
    const float halfHeight = m_ViewHeight / 2.0f;
    view.SetCenter(halfWidth, halfHeight);
    view.SetHalfSize(halfWidth, halfHeight);
}

9
Graphics / View/RenderWindow API change [SVN] (issues + solution)
« on: April 21, 2008, 12:29:20 pm »
@Laurent: doh, didn't see that. Saves one View instance :)

@zarka: I am not doing this each frame! I didn't make it clear, but submitting the view each frame was an attempted workaround for my bug. This is an initial setup. Of course I wouldn't want to leak that memory. Using new was a quick fix to find that was a scope issue, but I was only 'leaking' one instance over the course of the program.


One thing I forgot to mention in my initial post: there was another reason for the second bug (SFML showing behind OpenGL), which is RenderWindow change in default behavior from keeping GL states to not keeping them, adding    m_RenderWindow->PreserveOpenGLStates(true) to my init function solved that.

10
Graphics / View/RenderWindow API change [SVN] (issues + solution)
« on: April 21, 2008, 11:07:10 am »
I just updated my SFML from SVN sources, I had a version from April 05th before (which is before the API change in sf::View).
I had to change my view setup from view.Rect = ... to view.SetCenter / view.SetHalfSize to make it compile. And then, all my SFML sprites and text are gone.

I was gonna scream in this forum, but after some trials, I found if I submitted my View each frame, instead of once, I saw the sprites behind my OpenGL stuff. So I was starting to blame RenderWindow for losing its view, and SFML for losing its Z.

Then, I found my mistake. The method RenderWindow::SetView was previously SetView(View *view), and now SetView(const View &view).

Previous (working) code:
Code: [Select]
void Game::SetupStuff()
{
    sf::View view;
    view.Rect = sf::FloatRect(0, 0, viewWidth, viewHeight);
    m_RenderWindow->SetView(&view);
}


New (working) code:
Code: [Select]
void Game::SetupStuff()
{
    const sf::FloatRect rect(0, 0, viewWidth, viewHeight);
    sf::View *view = new sf::View(rect);
    m_RenderWindow->SetView(*view);
}

I should change it to avoid allocation by having Game hold a sf::View member, but that's the idea: you have to keep the View instance somewhere, do not use a local variable.

Hope this helps someone :)

Oh, and is there a reason not to provide a View::SetRect(const FloatRect &newRect) method? That would be nice for me, as 1) I compute width and height and not halves 2) my view starts at 0, 0 and finish at width, height, 3) that would make the setup one single call, best readability ;).

11
General / Compatibility to other computers
« on: April 19, 2008, 01:26:05 pm »
If the other computers gets strange errors complaining about wrong side by side configuration or the like, it means you provided a Debug .exe without the debug version of VC runtime. Giving a Release .exe should solve this issue (as msvcrt.dll is probably installed on the target computer).

For the link issue, I'm ignoring libcmt.lib in all my SFML projects now. Not sure if it's a good idea or not, but this way I don't get error messages.

I've also had a strange issue where my project is compiling fine on my XP PC with Visual C++ 2005 Express and not on my Vista laptop with same Visual, found out I had to add gdi32.lib and user32.lib to the linker files.

12
General / Problems with 1.2
« on: April 10, 2008, 03:40:05 pm »
It's not even on my PC :(

Here is the log produced by Process Monitor http://j.villers.free.fr/projets/SiB/RV.7z.

From what I know, the PC has seen some years of use, including use of joypads and custom pad drivers (for XB360 pads). Plugging in and out a pad lead to some changes, but no improvement.

If you have no idea of something that might be causing this, I'll try to go debugging on this PC. Also, another person has the same kind of issues with builds I provided, but I have no confirmation yet it comes from the same source.

13
General / Still present
« on: April 10, 2008, 03:16:02 pm »
Well, after making a new build with latest SVN code, we still experience the same kind of issue, endless looping in initialization code. It seems the issue has changed, but is still present.

Trying to track it down with Process Monitor (I can provide the log if you wish, it's too big to paste here), it's looping on a block of queries to Registry related to joystick and DirectInput mainly.

14
General / Problems with 1.2
« on: April 08, 2008, 12:44:03 pm »
Do you mean it's fixed in 1.2, or it's fixed in SVN?

Build I recently supplied was built with 1.2 stock, but now I'm using the SVN version, so I could do a new build...

[Edit]
OK, found out in Roadmap. So I've made a new build using SVN version.

15
General / Problems with 1.2
« on: April 08, 2008, 09:53:28 am »
I'm not sure whether I've hit the same bug...

On some PCs (Windows XP) it seems, my program get stuck during init. There is an application shown in taskbar, but no window.

From a fellow developer that reported the issue (I cannot reproduce it here on both my PC and laptop):

It is looping on registry request on joystick (he hasn't got one attached to his PC at the moment).
The key : HKLM\System\CurrentControlSet\Control\MediaResources\Joystick\DINPUT.DLL\CurrentJoystickSettings
From what Process Monitor tells him.

I can provide exe and source code privately if needed, but my initialization looks like this (pseudo-code):

Code: [Select]
RenderWindow *app = new RenderWindow();
InitLotsOfStuff();
FindSuitableVideoMode();
app->Create(suitableParameters);


In InitLotsofStuff(), there is a call to app->GetInput() (in a constructor to be precise). Maybe that's causing the problem, requesting inputs before the actual window is setup, but it's working on several PCs including mine.

Pages: [1] 2
anything