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

Pages: [1]
1
General / SFML does not show windows on x64
« on: March 29, 2011, 08:45:39 pm »
Solved the Problem.

And the Problem the OP was talking about seems to be fixed in the newest release of drivers which was a few minutes ago.
Installed 11.3 and SFML opens a Window now. At least in my slightly modified Version of the latest SFML2, would be interesting to hear reports from others too.

2
General / SFML does not show windows on x64
« on: March 29, 2011, 02:51:32 pm »
It is destroyed at global exit via the destructor of a class.

edit:
When I do a dirty "delete this" in the event-pump when I actually exit, the problem does not occur. Well, I need to find a solution for this.

3
General / SFML does not show windows on x64
« on: March 29, 2011, 02:09:57 pm »
Uhm, sure, while there is nothing too fancy about it:

Code: [Select]

class NLWindowGL
{
   __declspec(dllexport) bool create(/*...*/);
private:
   sf::RenderWindow m_window;
};


const long NLWindowGL::NIGHTLIGHT_VIDEO_FLAG = sf::Style::Default;

bool NLWindowGL::create(const NLWindowSettings& s)
{
// Copy settings
m_settings = s;

    // Prepare Flags
long flags = NLWindowGL::NIGHTLIGHT_VIDEO_FLAG;
    if (m_settings.fullscreen)
    {
        flags |= sf::Style::Fullscreen;
    }

    sf::ContextSettings context;
    context.AntialiasingLevel = m_settings.getFsaa();
    context.DepthBits           = m_settings.getDepth();
    context.MajorVersion      = 3;
    context.MinorVersion      = 3;
    context.StencilBits          = 24;

    m_window.Create(sf::VideoMode(static_cast<unsigned int>(m_settings.width), static_cast<unsigned int>(m_settings.height),
                    m_settings.getDepth()), m_settings.caption, flags, context);
   
    m_window.Show(true);

    if ( m_settings.vsync )
    {
        m_window.EnableVerticalSync(m_settings.vsync);
    }
    else
    {
        m_window.SetFramerateLimit(m_fps_limit);
    }    
   

if ( glGetError() != GL_NO_ERROR )
throw NLException("[NLWindowGL] Error after Context Creation");

// Init Glew
int glew_result = glewInit();
if ( glew_result != GLEW_NO_ERROR )
{
std::stringstream ss;
ss << std::string("[NLWindowGL] glewInit failed:") << (char*)glewGetErrorString(glew_result);
NLError(ss.str());
throw NLException(ss.str());
}

    // OpenGL Error Check
    {
   GLenum e = glGetError();
   if ( e != GL_NO_ERROR ){
   throw NLException("[NLWindowGL] GLerror after glewInit while glewInit returned OK");
   }
    }

    // Choose perspective
    if (m_settings.mode == NightLight::OpenGL)
    {
        this->initOpenGL(m_settings.width, m_settings.height);
    }

// Dump infos about renderDevice to the log.
    this->dumpInfos();

return true;
}


You find the whole code in a repository here:
http://code.google.com/p/nightlight2d/source/browse/trunk/NightLightDLL/NLWindowGL.cpp

I used SDL before and want to replace it with SFML to drop another library with a license I do not like too much.
edit:
I also tried to create the Window on the Heap, but that does not change anything.

edit2:
To be more complete:
NLWindowGL is capsulated by NLWindow, which is a impl-idiom. It just forwards all calls to NLWindowGL.
The impl is created on the heap and is deleted when the program exits.

4
System / timeGetTime() replacement?
« on: March 29, 2011, 02:03:04 pm »
Is there any function in SFML that returns the same values than timeGetTime()?
The miliseconds which have passed since application start?
sf::Clock() does not work very well with my existing code. I have borked animations. They are either damn slow or I have very sudden movement. With timeGetTime() everythings okay.
For explanation:
I used SDL_GetTicks() before. But I wanted to replace SDL with SFML since it comes with Network and better Audio.

5
General / SFML does not show windows on x64
« on: March 29, 2011, 01:55:54 pm »
I have changed your code to get a core profile instead of compability :twisted:  8).

Now I only need to resolve the crash when I exit my client app.
Any idea what causes this?
When I exit my App, I end up crashing here:

Code: [Select]

> msvcr90d.dll!_CrtIsValidHeapPointer(const void * pUserData=0x0315dd29)  Line 2103 C++


It happens when sf::RenderWindow is destroyed. I found that fix with TerminateProcess, but does not help in my case since sfml runs in a .dll.

6
General / SFML does not show windows on x64
« on: March 29, 2011, 02:51:07 am »
I have this issue too.
I also get these linker errors with the latest build from glew.
But I have set my own lib of glew as input in cmake, since my project is a .dll and relies on a fix I made inside glew. Since there is no preprocessor switch I know whch tells glew that it is used as .dll I am wondering what can cause this. Any Idea?

I also got the ATI Bug, but well, I will wait for a fix.
I really would like to integrate sfml into my (large) project and get rid of sdl since sfml has more to offer.

Unfortunately, I rely on SFML2 since I need to use an OpenGL 3.x core profile.

edit:
I reverted my Drivers to 11.1. It went slightly better, the Application actually entered my code. Before, it hung when loading the ati-dlls. But now window was shown either.
I made the window to be shown after calling sf::RenderWindow::SetFramelimit(100).

Here is the code:
Code: [Select]

    sf::ContextSettings context;
    context.AntialiasingLevel = m_settings.getFsaa();
    context.DepthBits         = m_settings.getDepth();
    context.MajorVersion      = 3;
    context.MinorVersion      = 3;
    context.StencilBits       = 24;

    m_window.Create(sf::VideoMode(static_cast<unsigned int>(m_settings.width), static_cast<unsigned int>(m_settings.height),
                    m_settings.getDepth()), m_settings.caption, flags, context);
    m_window.EnableVerticalSync(m_settings.vsync);
    m_window.Show(true);
    m_window.SetFramerateLimit(m_fps_limit);

Vertical Sync was false in this case. When Vertical Sync is true, it does also show without SetFrameLimit.
Hope this helps you debugging your code.

Next Problem:
My renderer is telling me this:
Quote

[NLWindowGL] OpenGL Vendor String: ATI Technologies Inc.
[NLWindowGL] OpenGL Version: 3.3.10428 Compatibility Profile Context
[NLWindowGL] OpenGL Renderer: ATI Radeon HD 4800 Series

Any chance to get a Core Profile?
I won't use any sfml function to render sprites or so, I have my own classes  in place.

7
Graphics / Probably Memory Leak with sf::RenderWindow
« on: March 26, 2009, 08:45:48 am »
Quote from: "Laurent"
Weird. The RenderWindow default constructor does nothing, and the constructors of its members (including the base classes ones) do nothing as well (there are only primitive types).

Is it happening with this minimal piece of code?
Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow w;
    return 0;
}


Yes, it is happening.

Quote from: "Debugger"

"test.exe": "X:\Projects\test\Debug\test.exe" geladen, Symbole wurden geladen.
"test.exe": "C:\WINDOWS\system32\ntdll.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\kernel32.dll" wurde geladen
"test.exe": "X:\Projects\test\sfml-graphics-d.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\opengl32.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\msvcrt.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\advapi32.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\rpcrt4.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\secur32.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\gdi32.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\user32.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\glu32.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\ddraw.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\dciman32.dll" wurde geladen
"test.exe": "X:\Projects\test\sfml-window-d.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\winmm.dll" wurde geladen
"test.exe": "X:\Projects\test\sfml-system-d.dll" wurde geladen
"test.exe": "C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\msvcp90d.dll" wurde geladen
"test.exe": "C:\WINDOWS\WinSxS\x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_f863c71f\msvcr90d.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\imm32.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\dinput.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\hid.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\setupapi.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\wintrust.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\crypt32.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\msasn1.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\imagehlp.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\uxtheme.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\msctf.dll" wurde geladen
"test.exe": "C:\Programme\Logitech\SetPoint\GameHook.dll" wurde geladen
"test.exe": "C:\Programme\Logitech\SetPoint\lgscroll.dll" wurde geladen
"test.exe": "C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.3053_x-ww_b80fa8ca\msvcr80.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\ntmarta.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\ole32.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\samlib.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\wldap32.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\msctfime.ime" wurde geladen
"test.exe": "C:\WINDOWS\system32\nvoglnt.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\mcd32.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\mcd32.dll" entladen.
Der Thread 'Win32 Thread' (0xe34) hat mit Code 0 (0x0) geendet.
"test.exe": "C:\WINDOWS\system32\version.dll" wurde geladen
"test.exe": "C:\WINDOWS\system32\version.dll" entladen.
Der Thread 'Win32 Thread' (0x890) hat mit Code 0 (0x0) geendet.
Der Thread 'Win32 Thread' (0x1030) hat mit Code 0 (0x0) geendet.
Detected memory leaks!
Dumping objects ->
{122} normal block at 0x013365C8, 20 bytes long.
 Data: < e3  e3  e3     > C8 65 33 01 C8 65 33 01 C8 65 33 01 CD CD CD CD
{121} normal block at 0x013364B0, 216 bytes long.
 Data: < u8             > AC 75 38 00 01 00 00 00 01 00 00 00 00 00 00 00
{120} normal block at 0x01336470, 4 bytes long.
 Data: < d3 > B0 64 33 01
Object dump complete.


(Sorry, its the German version :D)
Code:
Code: [Select]


#include <sfml/Graphics.hpp>


int main()
{
#if defined (_DEBUG) && defined(_MSC_VER)
            long flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
            flag |= _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF;
            _CrtSetDbgFlag(flag);
#endif /* _MSC_VER && _DEBUG */
    sf::RenderWindow window;
return 0;
}



There are 2 Things which is remarkable:
* It is ALWAYS the same amount of memory which is leaking.
* With 216 Byte in the second chunk it is quite large... more than a "common" class needs normally. Much more.
What version of Visual Studio was this SDK linked against? Perhaps that is the problem. The binaries are marked with VC8, I am using VC9. Could this produce this problem?
Edit: I was wrong, the folder is called "VC2008". So this should be ok.
So long.
rya.

8
Window / Wrong Usage?
« on: March 26, 2009, 02:44:39 am »
Hi there.
Many People told me, that sfml is kicking Ass when it comes to handle OS-Specific stuff. So I gave it a shot and tried to integrate SFML into my existing Library and Application. Since my code is very modular, I can just replace the current window-class with sfml (pure virtual classes as front-end to be more detailed ).
So, I have put up a new Window and tried to get my pure OpenGL-Code running, but I failed... I can't get a context where I can render my stuff properly. I have tried to stick to the tutorials, but it doesn't work.
Any Hints you might have for me?
rya.

9
Graphics / Probably Memory Leak with sf::RenderWindow
« on: March 26, 2009, 02:31:14 am »
Adding this code to my program while using WindowsXP SP3 and Visual Studio 2008 Express results in a memory leak.
Code: [Select]

sf::RenderWindow m_window;


Code: [Select]

Detected memory leaks!
Dumping objects ->
{123} normal block at 0x016A6660, 20 bytes long.
 Data: <`fj `fj `fj     > 60 66 6A 01 60 66 6A 01 60 66 6A 01 CD CD CD CD
{122} normal block at 0x016A6548, 216 bytes long.
 Data: < u              > AC 75 86 00 01 00 00 00 01 00 00 00 00 00 00 00
{121} normal block at 0x016A6508, 4 bytes long.
 Data: <Hej > 48 65 6A 01
Object dump complete.


Memory report is achieved with:
Code: [Select]

#if defined (_DEBUG) && defined(_MSC_VER)
            long flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
            flag |= _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF;
            _CrtSetDbgFlag(flag);
#endif /* _MSC_VER && _DEBUG */

I have debugged my own application from begin() to end() and if I remove the sfml-code, there are no more leaks. So I can safely say, that it is coming from sfml.
regards.

Pages: [1]
anything