Unable to create display

Started by Kikketer, November 15, 2006, 15:02:11

Previous topic - Next topic


I followed the wiki tutorial:

My code is the same so I won't bore you with example code, but I'm getting an error:
"Unable to create display"

This is after failing the following code:
//Create the display
	try {
	  Display.setTitle("An Example Title");
	} catch (LWJGLException e) {
	  Sys.alert("Error", "Unable to create display");

Before getting here I System.out.println the chosenMode.toString(), and it prints 640 x 480 x 16 @70Hz so I know it's available.
Do I need to install OpenGL or some such thing to get this to work??


what is the exception?
do you have an OpenGL capable graphics card ?


Ok with:
Sys.alert("Error", e.getMessage());

It says "Could  not find a valid pixel format"

I checked with the desktop properties and found that I can only refresh at 60 or 75Hz, not 70.
How can I change this?


Most of us use something like:
for (int i = 0; i < d.length; i++) {
			System.err.println("Width " + d[i].getWidth() + " Height " + d[i].getHeight() + " Bits " + d[i].getBitsPerPixel() + " Freq " + d[i].getFrequency()); // DEBUG: display modes
			if ((d[i].getWidth() == WIDTH && d[i].getHeight() == HEIGHT && d[i].getBitsPerPixel() == BPP && d[i].getFrequency() == REFRESH)) {
				displayMode = d[i];
			} // if reasonable display mode detected
		} // for all display modes

For something thats not "production code". Maybe you can find a valid pixel format that way.


I just wanted to add that I had exactly this problem. I had previously managed to install LWJGL and run some simple stuff, when it suddenly stopped working, giving me the error "Could  not find a valid pixel format" even though I was clearly using a pixel format that should be ok. I should add that my graphics card and other OpenGL apps seemed to working fine.

Solution: I downloaded and installed new drivers for the graphics card anyway. Now it works.

I don't know if this is relevant, but the problem occurred after I used the TV-out thing on my graphics card for the first time.


Many of my users have this problem and I keep telling them to update their drivers but that seems to be a tricky thing to do sometimes. I just wonder if there is any good reference page for this problem. I found one page for the Tribal Trouble support page http://www.tribaltrouble.com/supportdriver?os=w that seems very good but I don't want to simply steal this information.

If this kind of resource doesn't exist, I would like to create one myself (or with your help) that every LWJGL developer can link to. Is the wiki a good place for this perhaps?