Jump to content

  • Log In with Google      Sign In   
  • Create Account

Using pixel format '2' crashes SetPixelFormat, but other values don't?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Sock5   Members   -  Reputation: 162

Like
0Likes
Like

Posted 04 October 2013 - 05:46 PM

Using SetPixelFormat and passing 2 as a format crashes and GetLastError() gives me a code of 2000.I used the example code from Rastertek: http://www.rastertek.com/gl40tut03.html , but when I do it, it causes a crash.I have no idea how to proceed, I mean I can't even find what '2' means, it's probably  "RGBA 8 bits per channel", as it is described in the description array prior to the format creation, but why would it say it's invalid?


>removed<


Sponsor:

#2 Kaptein   Prime Members   -  Reputation: 2166

Like
0Likes
Like

Posted 05 October 2013 - 01:46 AM

result = wglChoosePixelFormatARB(m_deviceContext, attributeListInt, NULL, 1, pixelFormat, &formatCount);

 result = SetPixelFormat(m_deviceContext, pixelFormat[0], &pixelFormatDescriptor);

 

there is no '2' anywhere near the pixelformats, as i could find.. am i looking in the wrong place?



#3 Sock5   Members   -  Reputation: 162

Like
0Likes
Like

Posted 05 October 2013 - 03:13 AM

result = wglChoosePixelFormatARB(m_deviceContext, attributeListInt, NULL, 1, pixelFormat, &formatCount);

 result = SetPixelFormat(m_deviceContext, pixelFormat[0], &pixelFormatDescriptor);

 

there is no '2' anywhere near the pixelformats, as i could find.. am i looking in the wrong place?

 

Yeah the '2' is the value inside pixelFormat that I see when I hover over it when I put a breakpoint in the debug code.I tried using '1' and '2' directly and '1' works, however I have no idea what they mean.I couldn't find an online table of GL pixel formats and their related integers :/ .


>removed<


#4 wintertime   Members   -  Reputation: 1727

Like
0Likes
Like

Posted 05 October 2013 - 08:00 AM

There is no online table because that depends on your OS, your graphics card and your graphics driver. You could try http://www.realtech-vr.com/glview/index.html to show info about your system.
Maybe there is also some modern equivalent to DescribePixelFormat you could use, but the easiest way is to think in terms of the features you want from the context and feed those into ChoosePixelFormat (or the newer function wglChoosePixelFormatARB for modern OpenGL versions) do that work for you.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS