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

Author Topic: SFML.NET 2.0 (from github) Failed to set pixel format for device context  (Read 10264 times)

0 Members and 2 Guests are viewing this topic.

raycrasher

  • Newbie
  • *
  • Posts: 24
    • View Profile
Code: [Select]
Failed to set pixel format for device context -- cannot create OpenGL context
SFML.NET (latest version from GitHub) gives this error when creating a RenderWindow. Sample code not given, since the same error occurs with the OpenGL samples (be sure to enable the console window). I would be content to just ignore the error if SFML works regardless, but my program, which worked fine with SFML.NET RC downloaded from the main SFML site, doesn't display fonts/renders sprites as white rectangles with the Github version. I need the latest version in order to use the new Draw overloads for RenderWindow.


OS: Windows 8
Video: Nvidia GeForce GT 220 (driver version 306.14).

I'm currently updating my video card drivers just in case.

Help!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
I know it can be tedious, but if it works with the RC, then you should try to find the exact revision where it stopped working. And if you're really motivated, you could try SFML (C++) examples directly, and if you have the same problem, try to find the revision where the problem appeared in it.

;D
Laurent Gomila - SFML developer

raycrasher

  • Newbie
  • *
  • Posts: 24
    • View Profile
By the way, I'm using Visual Studio 2012.

I also tried recompiling sfml, csfml, and sfml.net from the latest sources, the error still persists. Weird though - all the samples work, though the error still shows up.

Also debugged the source last night, a WindowImplWin32 object was only created when the program quits. Is this correct behavior?

I'm going to try modifying the RC in order to get the features I want, nothing else. If this fails, then maybe its because of VS2012 and not SFML.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Quote
Also debugged the source last night, a WindowImplWin32 object was only created when the program quits. Is this correct behavior?
No. But if you see a window, then there's a WindowImplWin32 instance behind it.

Quote
If this fails, then maybe its because of VS2012 and not SFML.
This is very unlikely, but I'll try it at home.
Laurent Gomila - SFML developer

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
If this fails, then maybe its because of VS2012 and not SFML.

Not true at all, I have already used SFML with VS2012 on Windows 8. Sounds more like a driver issue to me. Would it be possibly for you to try another game/program that utilizes OpenGL to make sure that OpenGL works on your system?
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

raycrasher

  • Newbie
  • *
  • Posts: 24
    • View Profile
The 2.0 RC version of SFML downloaded from the main site works for me. I've circumvented the problem by using the 2.0 RC version and adding the required features as C# extensions to the library.

Its the latest commit (86897a8347) that doesn't work for me.

I would like to know what the commit hash for the source of SFML2.NET RC, so that I could try comparing the two versions and find out what went wrong.

Dominator

  • Newbie
  • *
  • Posts: 37
    • View Profile
I'm also experiencing this with SFML.NET from here: http://www.sfml-dev.org/download/sfml.net/

Windows 8 Pro
Visual Studio 2012
GeForce GTX 670 with driver 320.18

BumbleBirds

  • Newbie
  • *
  • Posts: 2
    • View Profile
Seems like I'm also having this same problem.

SFML.net 2.0, downloaded from the download page
Microsoft Visual Studio Express 2012
Windows 7
nVidia geforce 7600GT.

Have updated my drivers several times and this has been an issue every time.
Any suggestions? I'd really like to start making games using SFML, but I just don't know how to continue from here.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Ok guys, lets see if this is a binding issue or a problem in the C++ side of it.
Could it be possible for one of you guys with the problem to set up SFML directly in C++ and then check if the same problem happens?
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

BumbleBirds

  • Newbie
  • *
  • Posts: 2
    • View Profile
After a little fumbling around I got SFML in C++ drawing the green circle from the setup tutorial just fine.
Hope that helps!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Given the amount of SFML users (including me) that never reported such an error, I'm pretty confident that this bug doesn't happen in the C++ version ;)
Laurent Gomila - SFML developer

Dominator

  • Newbie
  • *
  • Posts: 37
    • View Profile
I can confirm that the C++ version works perfectly fine.

Dominator

  • Newbie
  • *
  • Posts: 37
    • View Profile
Finally had some time today to look further into this issue. :)

This commit fixes this problem:
https://github.com/SFML/SFML.Net/commit/0104063bdc873c4363a4b9f6109c965d4437050c

So the packages on the SFML.NET download page need to be updated.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Great, thanks for your help :)

Quote
So the packages on the SFML.NET download page need to be updated.
It's not that simple. I'd need to release a new patch version (2.0.1), which is annoying.
Laurent Gomila - SFML developer

eyeliner

  • Newbie
  • *
  • Posts: 19
    • View Profile
I got this issue as well...