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

Pages: [1]
1
Graphics / Graphics system and texture questions
« on: March 01, 2012, 12:14:25 am »
no, see.. my original texture is 320x240.

I want the sprite that is scaled 1x1 to be 320x240, and the sprite scaled widthXheight to be fullscreen.

This SHOULD have to do with the viewport. My best guess is that the RenderWindow doesn't update it's internally used viewport matrix when it's resized

2
Graphics / Graphics system and texture questions
« on: February 26, 2012, 08:27:30 pm »
I'm starting up with this, and I'm having a little 2D issue: how to draw a sprite on a
Code: [Select]
sf::RenderWindow so it has its texture's original size regardless of window resizing?

What about having it render over the whole screen, stretching as necessary?

here's my code:
Code: [Select]

void handleEvents(sf::Window &App) {
    // Process events
    sf::Event Event;
    while (App.GetEvent(Event))
    {
        // Close window : exit
        if (Event.Type == sf::Event::Closed)
            App.Close();

        // Escape key : exit
        if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
            App.Close();

        // Resize event : adjust viewport
        if (Event.Type == sf::Event::Resized)
            glViewport(0, 0, Event.Size.Width, Event.Size.Height);

    }

}

void glPerFrame() {
    // Clear color and depth buffer
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}

int main() {
    // Create the main window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML OpenGL");

    sf::Image depthBuffer;

    // Start game loop
    while (App.IsOpened())
    {
        handleEvents(App);

        // Set the active window before using OpenGL commands
        // It's useless here because active window is always the same,
        // but don't forget it if you use multiple windows or controls
        App.SetActive();

        glPerFrame();

        // Use the depth buffer as texture
        updateDepthBuffer(depthBuffer);    // This takes a Kinect depth image stream and unpacks it into the provided sf::Image
        sf::Sprite dbSprite(depthBuffer);
        float appW = App.GetWidth(), appH = App.GetHeight();
        dbSprite.Resize(appW, appH);
        App.Draw(dbSprite);
        dbSprite.SetScale(1,1);
        App.Draw(dbSprite);

        // Finally, display rendered frame on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}


This only looks right (this is, the first call to Draw draws over the whole window, and the second draws on the depthBuffer original size) when the window has the original size it was created with: if I make it bigger, both images get stretched, so the bigger one escapes the window, and the smaller one becomes bigger, and if I make it smaller I end up with black borders.

3
Audio / sf::Sound and sf::Event, Win32 Thread mass exit
« on: February 26, 2012, 01:05:05 am »
Great, if I'm able to link the official MS KinectSDK, I'll post a howto

4
Audio / sf::Sound and sf::Event, Win32 Thread mass exit
« on: February 25, 2012, 10:16:56 pm »
I'm having a similar problem, but this has nothing to do with the audio, I'm not even using it.

I'm kind of hazy on VC++ details, I really need to get SFML running under VC++2010, because of the Kinect SDK (VS2010 only available)

I'm using VisualStudio 2010 Express and VisualStudio 2008 Express.

I first tried to just set up the directories and run the sample code, and got a lot of link errors on std:: calls, so I opened the SFML 2008 solution with 2010, and recompiled the dll and lib files.

After replacing them, I was able to compile and link. The Window.cpp (openGL rotating cube) sample runs OK, but I get these errors just when I run the program, either in debug or release configurations, the two lines at the bottom, after the **** are printed on shutdown, but everything before just as the app loads.

The OpenGL.cpp sample, doesn't load, it fails with a very similar output, but it fails (says app closed with code 1) (EDIT: I realized I was missing the data resources for this):

Code: [Select]

'sfml-setup.exe': Loaded 'C:\Users\Lacrymology\workspace\artsy\kinect\C++\sfml-setup\Release\sfml-setup.exe', Symbols loaded.
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\msvcp100.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\msvcr100.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\nvinit.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\ig4icd32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Cannot find or open the PDB file
'sfml-setup.exe': Unloaded 'C:\Windows\SysWOW64\version.dll'
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\dinput.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\hid.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\wintrust.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\crypt32.dll', Cannot find or open the PDB file
'sfml-setup.exe': Loaded 'C:\Windows\SysWOW64\msasn1.dll', Cannot find or open the PDB file
****
The thread 'Win32 Thread' (0xe5c) has exited with code 0 (0x0).
The program '[5524] sfml-setup.exe: Native' has exited with code 0 (0x0).


I don't know what I've got to do to use the provided external dlls (openal and libsndfile-1), and if there's anythin else I need to be doing.

Pages: [1]