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

Pages: [1]
1
Window / Display() is decreasing my FPS dramatically
« on: March 16, 2008, 01:42:04 pm »
Quote from: "TTK-Bandit"
laurent no im sure that vsync is off, besides I have a crt with 100hz, so it should be on 100 then, not  62.


Yes, I'm sure my vsync was turned off either and my tft refresh rate is 75, so it should be ~75 instead of ~64.

2
Window / Display() is decreasing my FPS dramatically
« on: March 16, 2008, 11:13:48 am »
Okay this is weird.

When I restarted my computer, it was suddenly much faster (perhaps I had some memory leaks with the testing before...?). Anyways, I have an FPS of 500 now ^^.

Also, the sleep improves FPS yes, but then I get a CPU of 100%. So I always sleep at least 1ms (even if that is ~16ms...can't help that) per display loop.

Thanks anyways...still I wonder why it was so slow yesterday...

3
Window / Display() is decreasing my FPS dramatically
« on: March 15, 2008, 09:33:42 pm »
Hi,

As the title says. I have a FPS of only 64 with some light-weight drawings with OpenGL. I did some experimenting, it seems that Display takes all time, when I remove that function I get a huge FPS. I turned VSync on and off, but didn't make any difference.

Do I HAVE to call Display if I only use OpenGL output? What else do I wrong?

Thanks

4
Feature requests / Some idea's reagarding to window handling
« on: March 15, 2008, 03:25:59 pm »
Still a slight problem:

Code: [Select]
bool splash_running;
void splash(void *);

int main()
{
    window.create(800, 600, 32, "Window");

    sf::Thread splash_thread(&splash);
    splash_thread.Launch();

    //load();

    splash_running = false;
    splash_thread.Wait();

    bool running = true;
    while (running)
    {
        window.event(&running);
        window.draw();
    }
    return 0;
}

void splash(void *)
{
    int width = 200;
    int height = 120;

    sf::Window *splash = new sf::Window(sf::VideoMode(width, height, 32), "Loading...");

    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
    glEnable(GL_TEXTURE_2D);
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    glViewport(0, 0, width, height);

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(0.0f, width, height, 0.0f, -1.0f, 1.0f);

    glMatrixMode(GL_MODELVIEW);

    splash_running = true;
    while (splash_running)
    {
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

        glBegin(GL_QUADS);
            glVertex2d(0, 0);
            glVertex2d(width, 0);
            glVertex2d(width, height);
            glVertex2d(0, height);
        glEnd();

        splash->Display();
        sf::Sleep(0.001);
    }
    delete splash;
}


This sometimes works and sometimes does not. The problem is that the splash thread opens up including the main window, but the thread never stops the display loop. It keeps going and I have to use Ctrl+Alt+Del to shut the program.

Perhaps I should use mutexes, but the tutorial says that that's not needed for boolean operations...

5
Feature requests / Some idea's reagarding to window handling
« on: March 15, 2008, 02:56:10 pm »
Quote from: "Laurent"
Quote
I had to click in the bar (the bar at the bottom in windows, don't know what its called) to make it visable.

Can you show us a minimal and complete code which reproduces this behaviour?


Hmm...couldn't reproduce...must've been me ^^. Sorry for the hassle.

6
Feature requests / Some idea's reagarding to window handling
« on: March 15, 2008, 12:09:01 pm »
Quote from: "Laurent"
Quote
The point is that you can only load textures into OpenGL when the window is already opened

That's not true. There's a dummy window created at program startup to provide a valid OpenGL context.
It's no more true with the latest sources (global initialization + DLL can cause some issues), but if you can still use SFML graphics classes without worrying about creating a window.
In case you just want to use custom OpenGL calls, you can call sf::Window::ForceContextInit() (static function) to force the creation of the OpenGL context before you create any window.


Hmm...I couldn't get it to work. I will play with it again and see what happens.

Quote from: "Laurent"
Quote
The second created window (my main window) starts minimalised

You really mean minimalized (ie. hidden in the process bar), or just "not maximized" ?


I had to click in the bar (the bar at the bottom in windows, don't know what its called) to make it visable.

Quote from: "Laurent"
Quote
It would be nice if we could hide a window from start, and unhide it when needed. This way the window is initialised and can be showed very quickly

Why would you need to create a hidden window ? Just create it when you need to show it.


Since creating windows takes time I thought it might be handy. What if you have an app where you can enable/disable tool windows for the program (small windows with some extra features/information). It looks better and faster if its instantly displayed when you enable it...okay I agree...it just takes 0.12 seconds...ah well...

Quote from: "Laurent"
Quote
Error handling. SFML automatically outputs to the console when an error occured. Thats nice, but what if I output printf() to a file and want to use my own error handling? It would be nice if we could use something like 'geterror' and it would return the latest generated error. And eventually 'geterrno' which would return a error code which can be identified and dealt with.

SFML doesn't output to the console. It outputs to the standard error stream, which you can easily redirect to whatever you want.
I think providing some error codes would be useless, SFML functions just need to tell if they succeed or fail.


Hmm yes, perhaps this is only with debugging and not when you release it. Nevermind then.

7
Audio / Linking to static library files instead of dynamic ones
« on: March 15, 2008, 10:52:41 am »
OpenAL's DLL's and libsndfile-1.dll. I rather prefer one .exe then a whole list of DLL's with it ;).

SFML does that well with static libs too :)

8
Feature requests / Some idea's reagarding to window handling
« on: March 15, 2008, 10:49:52 am »
Hi, I tried to build an application where I would make a loading window, then load everything (into OpenGL) (textures, audio etc etc), then I would create the main window and after that destroy the loading window. The point is that you can only load textures into OpenGL when the window is already opened. So I had to rewrite the window creation part a few times, these were some problems/things I ran into:

1. The second created window (my main window) starts minimalised. I didn't find any function to put maximalise it.

2. When I slightly modified the code, the second created window (my main window) started unfocused. It was behind the first created console in CodeBlocks (for debugging), though in release mode it would not occur, it would still be nice if we could make a window on focus.

3. After small changes, I wanted to load the main window and make it just not shown (loaded but not shown). When I made it not show after initialisation it, ofcourse, displayed for a few milliseconds and then disappeared. It would be nice if we could hide a window from start, and unhide it when needed. This way the window is initialised and can be showed very quickly.

4. After the loading was done, I wanted to destroy the loading window. I now use 'new' and 'delete' for that, but perhaps a function called 'destroy' in the class would be nice too. (I'm quite new to C++, can I call the deconstructor manually?)

5. Error handling. SFML automatically outputs to the console when an error occured. Thats nice, but what if I output printf() to a file and want to use my own error handling? It would be nice if we could use something like 'geterror' and it would return the latest generated error. And eventually 'geterrno' which would return a error code which can be identified and dealt with.

Just some idea's/suggestions, I really like SFML :), would be wonderfull to see it improved even more :).

Thanks,
Daevius

9
Audio / Linking to static library files instead of dynamic ones
« on: March 14, 2008, 07:22:59 pm »
Hi,

Can I somehow link to the static libraries instead of using .dll's?

It seems that I have to install OpenAL, or is this fixed with OpenAL soft?

Thanks,
Daevius

10
Window / Windows without borders
« on: March 14, 2008, 03:06:05 pm »
Ah thanks :), wonderful :)

11
Graphics / MingW compiler errors with sfml-graphics
« on: March 13, 2008, 10:21:10 pm »
E:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: BFD 2.17.50 20060824 assertion fail ../../src/bfd/cofflink.c:2266
E:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: E:\Packs\SFML\lib/libsfml-window.a(dukfs00021.o): illegal symbol index -1962934271 in relocs
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings


Thats what I get with my MingW compiler in CodeBlocks. I've rebuild the library myself, still got this problem, what can I do to fix this?

Thanks.

12
Window / Windows without borders
« on: March 13, 2008, 10:04:34 pm »
Hi,

First of all: great library! I love it :)

To the point: How can I create a window without the standard border? I'd like to make a splash-screen, and I rather do not want the borders (caption etc) for that. Is that possible in SFML like in SDL?

Thanks,
Daevius

Pages: [1]
anything