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

Pages: 1 [2] 3 4 ... 6
16
Window / wglMakeCurrent fails
« on: September 05, 2013, 01:04:53 pm »
Sometimes, on various hardware platform we use, wglMakeCurrent fails and GetLastError returns 170 ("The requested resource is in use."). A quick hack to retry 100 times also fails.

I have 2, sometimes 3 windows, but our program is single threaded. Does anyone have any ideas why this might happen, and how I can check for what has control of this context?

Our program has 9 OpenGL contexts (that is, I can see 9 calls to createContext) which might be too many for this crappy hardware :(

Thanks

17
General / CMake fails: missing CMakeLists.txt
« on: August 06, 2013, 10:31:03 am »
Hi

I've done this a thousand times, so no idea what is going wrong. Latest SFML 2.1 from the Download page, I'm using Win 7, CMake 2.8.10.2, and I get this:

CMake Error: The source directory "C:/SFML_060813" does not appear to contain CMakeLists.txt.

...which is correct as it's not there.....has something changed?

Cheers
Ed

18
System / sf::Time getCurrentTime fails on certain systems
« on: August 02, 2013, 11:00:19 am »
I have a strange bug where every clock object goes negative, on certain systems, but not all the time.

I think the problem could be with QueryPerformanceCounter in ClockImpl.cpp. This function can fail on some systems, and because the variable used to store the time is declared locally to the function, it could be any number.

Latest version of SFML has this in ClockImpl.cpp:

    HANDLE currentThread = GetCurrentThread();
    DWORD_PTR previousMask = SetThreadAffinityMask(currentThread, 1);

    // Get the frequency of the performance counter
    // (it is constant across the program lifetime)
    static LARGE_INTEGER frequency = getFrequency();

    // Get the current time
    LARGE_INTEGER time;
    QueryPerformanceCounter(&time);

    // Restore the thread affinity
    SetThreadAffinityMask(currentThread, previousMask);

    // Return the current time as microseconds
    return sf::microseconds(1000000 * time.QuadPart / frequency.QuadPart);
 

Previous versions had this (in Platform.cpp - before it got moved around):
    static LARGE_INTEGER frequency;
    static BOOL          useHighPerformanceTimer = QueryPerformanceFrequency(&frequency);

    if (useHighPerformanceTimer)
    {
        // High performance counter available : use it
        LARGE_INTEGER currentTime;
        QueryPerformanceCounter(&currentTime);

        return currentTime.QuadPart * 1000 / frequency.QuadPart;
    }
    else
    {
        // High performance counter not available: use GetTickCount (less accurate)
        return GetTickCount();
    }
 

So at least if the QueryPerformanceFrequency failed, GetTickCount would be a backup in this case, and not return an unknown value as the current implementation will do.

Is this a bug, or have I misunderstood?

Regards
Ed

19
Window / Weird bug on AMD E6760 GPU
« on: July 29, 2013, 06:00:37 pm »
Hi

Here's a really strange bug on the AMD E6760 GPU, which supports up to 6 display devices. We only use 4 :)
I am trying to load & show a graphic the same resolution as the display:

Display 1, 1920x1080 xy =  0,0
Display 2, 1920x1080 xy =  0,1920
Display 3, 1920x1080 xy =  0,-1080
Display 4, 1920x1080 xy =  0,1080

When set to these positions, I see the message "Failed to share the OpenGL context" and display 1, 2 and 3 give a warning about a maximum texture size of 1024x1024. I can see only my graphic on display 4

So I re-configure the position of display 4 via Windows control panel to be, let's say, x 560 y 1080, and no OpenGL context error occurs, I see my graphics on displays 1,2 and 3. Display 4 is blank.

Why do I get these OpenGL context/max texture size errors? I've never seen them before using this system.

Sadly, this a multimedia kiosk type system, so we cannot re-configure displays (not that it would fix the problem, anyway).

#include <SFML\System.hpp>
#include <SFML\Window.hpp>
#include <SFML\Graphics.hpp>

int _tmain(int argc, _TCHAR* argv[])
{
        sf::Texture tx1,tx2,tx3,tx4;
        sf::Sprite  sp1,sp2,sp3,sp4;
        sf::View w4View;

    sf::RenderWindow window1(sf::VideoMode(   0,    0,1920,1080),"Test1",sf::Style::None);
    sf::RenderWindow window2(sf::VideoMode(1920,    0,1920,1080),"Test2",sf::Style::None);
    sf::RenderWindow window3(sf::VideoMode(   0,-1080,1920, 450),"Test3",sf::Style::None);
//    sf::RenderWindow window4(sf::VideoMode( 560, 1080,1360, 256),"Test4",sf::Style::None);
    sf::RenderWindow window4(sf::VideoMode(   0, 1080,1360, 256),"Test4",sf::Style::None);

        tx1.loadFromFile("tx1.png");
        tx2.loadFromFile("tx2.png");
        tx3.loadFromFile("tx3.png");
        tx4.loadFromFile("tx4.png");

        sp1.setTexture(tx1);
        sp2.setTexture(tx2);
        sp3.setTexture(tx3);
        sp4.setTexture(tx4);

        while (window4.isOpen())
    {
        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
                {
            window4.close();
                }
        sf::Event event;
        while (window4.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window4.close();
        }
        window1.clear(sf::Color::Blue);
        window2.clear(sf::Color::Blue);
        window3.clear(sf::Color::Blue);
        window4.clear(sf::Color::Blue);

                window1.draw(sp1);
                window2.draw(sp2);
                window3.draw(sp3);
                window4.draw(sp4);

                window1.display();
                window2.display();
                window3.display();
                window4.display();
        }
    return 0;

}
 

Thanks
Ed

20
Graphics / Delayed loading graphics gives strange behaviour
« on: July 18, 2013, 12:09:47 pm »
Hi

Normally we load all graphics when the game starts. Sadly we have had to make changes to speed up the initial loading time (customer requirements..) so now we load graphics during other stages in the game.

Our problem is, when we do this, we sometimes notice corruption/display of graphics on an incorrect window (we use two windows for our games).

I can't give a minimal example, as it's hard to reproduce, and I don't think its an SFML issue anyway. Does anyone have any ideas?

Does the window(s) have to be inactive (window.setActive(false)) before you load a graphic?

Thanks
Ed

21
Graphics / Bink video & SFML
« on: May 17, 2013, 04:49:07 pm »
Hi

Does anyone here have any experience with the Bink video API from RAD Game Tools?

I've done the code and when I play a video back directly to the window (getting the handle to the window) it works fine. When I try and send the pixel data to an sf::Texture, nothing happens - no garbage, just no data whatsoever.

Bink video fills a buffer with data in a format you can specify. I assumed, for OpenGL, this is GL_RGBA format.

Hope someone has some ideas...I have spent all day on this :(

Thanks
Ed

22
Window / WM_ERASEBKGND message
« on: May 02, 2013, 05:40:42 pm »
Hi

I don't think SFML has any support for this Windows message....what is the best way to handle unsupported messages?? If I add another poll event check, I guess my SFML app will miss events??

Thanks

23
General / Dynamic linking problem
« on: April 10, 2013, 12:26:15 pm »
Hi

I've recompiled the latest SFML to link dynamically (I normally use static linking, but I'm doing tests with sfe::Movie stuff) and I get a lot of linker errors. I have a game engine library (GRID.lib) which I have also recompiled, but this is the kind of stuff I get:

GRID.lib(XSymbol.obj) : warning LNK4049: locally defined symbol ?setColor@Sprite@sf@@QAEXABVColor@2@@Z (public: void __thiscall sf::Sprite::setColor(class sf::Color const &)) imported

Does anyone have any ideas why this occurs?

Thanks!

24
Graphics / sf::View zoom help
« on: March 13, 2013, 10:17:41 pm »
Hi

First off, I have read the tutorial on sf::View, and I can't figure out how to make it do what I want, though I know it can, and it's probably very simple.

My graphics are 1024x768. My window is 1280x1024.

I need to zoom the graphics to the size of the window. I cannot use a stretch (forbidden..) so I have to use a view somehow. Can anyone help? I won't even post the code I've tried to do....its quite bad.

25
SFML projects / dxSFML
« on: March 12, 2013, 11:42:36 am »
Hi All

Some of you might know that we use SFML to develop casino style games for touch-screen terminals.
We're having a problem with one terminal we use, where it doesn't support OpenGL correctly for various reasons, the main one being they use a "hook" to overlay their own graphics. The people who own the terminals can update them, but it will take them a very long time.

So, the only solution we have is to use DirectX. Given that our entire game engine is built around SFML, this is not good news :(

Do people think it's reasonable to "just" replace the window management/draw calls in SFML to use DirectX but keep all non-window/graphics code the same?

Is this actually possible? We are actually prepared to pay someone to do this project - and then we will release the modified source code to the SFML community. We need to resolve this problem, and if it costs money, then OK. Are there any people interested? ;)

Ed

26
Window / window creation for different resolutions
« on: February 04, 2013, 02:07:42 pm »
Hi

We prepare our graphics to one size (1024x768) and then create a window to that size. For systems that have a different resolution, we then resize the window to the necessary resolution. This all works fine.

The problem is, for a very specific system, they require that the window be created at the correct resolution first of all, and not resized. If we create a window to the correct resolution, then the graphics go crazy (very streched). So my question is, how do I create a window at the right size but stretch my 1024x768 graphics into the window correctly? The window may also be smaller than 1024x768....

Also, how do I get the window at the correct position initially, and not have to call myWindow.setPosition ? This is also a problem on this crazy system :(

Thanks
Ed

27
Graphics / OpenGL context for each RenderTexture?
« on: January 31, 2013, 05:11:41 pm »
Hi

We use an older version of SFML 2.0 (from 09/10/2011 - we will hopefully be updating soon!) and my question is about RenderTexture. Is a new OpenGL context created for each RenderTexture object?

We have offscreen textures, so I am right in saying each of these has a context? Is there any way to know which contexts are for offscreen textures, and which are the real screen??

I hope this makes sense. It is way over my knowledge of OpenGL.

Thanks
Ed


28
Window / Crash on window with no event handling
« on: November 13, 2012, 01:15:20 pm »
Hi

My game's 2nd window - which requires no event handling, it is just displaying statistics/information - "crashes" with "game.exe has stopped responding" when you click on the window. The thing is, the window keeps rendering even with Windows' semi-transparent white over the top for when it "crashes". So my guess is, its just an event handling issue.

Is this known, and if so, whats the fix? I guess just add a event handler to the other window?

Thanks
Ed

29
Window / Bring window to top/front
« on: August 10, 2012, 01:16:32 pm »
Hi

Is there an SFML way to bring a window to the top/front/whatever?

We have a bug where a menu launches the game, but still has focus - so when you click anywhere in the game window, you see a bit of what the menu had last (in this case, a black screen) - this lasts a frame or two, and then the game has focus.

I guess I can use Windows API's SetForegroundWindow(myWindowHandle) - but would prefer not to ;)

Thanks
Ed

30
General / Streaming video & SFML
« on: July 28, 2012, 08:05:26 pm »
Hi

Has anyone ever tried to integrate streaming video using SFML, maybe to view video from over the internet or something? If so, how did it go? Did it work? What library did you use?

I've been looking at how to do this to stream live video to an app...but it looks very complicated :S

Thanks
Ed

Pages: 1 [2] 3 4 ... 6
anything