Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML does not show windows on x64  (Read 13062 times)

0 Members and 1 Guest are viewing this topic.

Wurstinator

  • Newbie
  • *
  • Posts: 33
    • View Profile
SFML does not show windows on x64
« Reply #15 on: March 08, 2011, 01:11:02 am »
Hi,
it seems like my computer doesn't want me to uninstall Catalyst so I'll have to wait for your fix :)

Any plans already when it's going to be released? I wanted to continue my project next month, so, just asking.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML does not show windows on x64
« Reply #16 on: March 08, 2011, 07:29:25 am »
Quote
Any plans already when it's going to be released?

No, sorry.
Laurent Gomila - SFML developer

devlin

  • Full Member
  • ***
  • Posts: 128
    • View Profile
SFML does not show windows on x64
« Reply #17 on: March 08, 2011, 08:14:26 am »
Quote from: "Wurstinator"
I wanted to continue my project next month, so, just asking.

Have you tried to use static libs rather than shared (DLLs)?

Wurstinator

  • Newbie
  • *
  • Posts: 33
    • View Profile
SFML does not show windows on x64
« Reply #18 on: March 08, 2011, 12:50:51 pm »
@ devlin: No, since I didn't have time to work on my project in the last time.
To be honest, I don't even know how to use static libraries.

/edit:
It seems that someone has found a workaround: http://mars-game.sourceforge.net/?p=768#more-768

PhoeniXYZ

  • Newbie
  • *
  • Posts: 1
    • View Profile
SFML does not show windows on x64
« Reply #19 on: March 29, 2011, 12:58:37 am »
Being new to SFML I encountered this bug directly in the first example (create a RenderWindow), only an empty console window.
But I can confirm that the window appears when using the static libraries (HD4870 with Catalyst 11.2 on Win7 x64) so that might be a workaround.

scorcher24

  • Newbie
  • *
  • Posts: 9
    • ICQ Messenger - 78951707
    • View Profile
SFML does not show windows on x64
« Reply #20 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML does not show windows on x64
« Reply #21 on: March 29, 2011, 07:45:57 am »
Quote
Any chance to get a Core Profile?

Not yet.
Laurent Gomila - SFML developer

scorcher24

  • Newbie
  • *
  • Posts: 9
    • ICQ Messenger - 78951707
    • View Profile
SFML does not show windows on x64
« Reply #22 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML does not show windows on x64
« Reply #23 on: March 29, 2011, 02:00:06 pm »
Can you show a complete code that reproduces this problem?
Laurent Gomila - SFML developer

scorcher24

  • Newbie
  • *
  • Posts: 9
    • ICQ Messenger - 78951707
    • View Profile
SFML does not show windows on x64
« Reply #24 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML does not show windows on x64
« Reply #25 on: March 29, 2011, 02:32:33 pm »
Something complete and minimal would be really cool. I can't test this incomplete piece of code, nor your whole project.

First try to create a window and destroy it, nothing more. If it crashes then you have your minimal code -- 2 lines ;)
If it doesn't crash, there's something in your code that messes things up, and you need to find what.

I can only think about one thing that could make it crash: do you destroy your window during main() or at global exit?
Laurent Gomila - SFML developer

scorcher24

  • Newbie
  • *
  • Posts: 9
    • ICQ Messenger - 78951707
    • View Profile
SFML does not show windows on x64
« Reply #26 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML does not show windows on x64
« Reply #27 on: March 29, 2011, 03:13:14 pm »
That's the problem. ATI doesn't like destructions at global exit when you're inside a DLL. With a clean design you should never have to destroy this kind of object at global scope.
Laurent Gomila - SFML developer

scorcher24

  • Newbie
  • *
  • Posts: 9
    • ICQ Messenger - 78951707
    • View Profile
SFML does not show windows on x64
« Reply #28 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.

Floomi

  • Newbie
  • *
  • Posts: 16
    • View Profile
SFML does not show windows on x64
« Reply #29 on: March 29, 2011, 11:58:13 pm »
I have the OP's problem in an app that doesn't open any GL windows, only the default console. It uses sf::Image, dynamically linked.

I upgraded to the Catalyst drivers pushed out by Windows Update and it stopped working.
I upgraded to the latest Catalyst drivers - released today - on AMD's website and it still doesn't work.
The workaround posted above, using 10.4's atigktxx.dll, works for me.

SFML 1.7 on Win7 x64 here. I can try to get a minimal code sample if it helps.

edit:\ Minimal code sample follows:

Code: [Select]

#include <iostream>

#include <SFML/Graphics.hpp>

int main(int argc, char **argv)
{
std::cout << "Main entry." << std::endl;

sf::Image img;
img.LoadFromFile("test.bmp");

std::cout << "Image loaded." << std::endl;

int i;
std::cin >> i;
return 0;
}


This prints nothing (not even "Main entry.") and hangs. Linking against sfml-graphics only with SFML_DYNAMIC defined.