Problems with OGL visualization in some systems. Initializaion bug?

Hi everybody.

Recently, I have been developing a large project using OpenGL and Visual C++ 6.0. I tested it in my Windows 98 / GeForce2 TI, and worked perfectly, as also did in a WindowsXP / 3DFX Voodoo2.

However, When I ran it in a Windows 2000 PC without hardware acceleration, the program worked, but without showing the render results. I debugged the code, and all the functions returns OK values, but when it reaches the buffer swap line, nothing happens (keep showing the desktop, not even shows a black screen) and the program continues without errors. This behavior also happens in other W2000 machines and in a laptop with Windows XP and no hardware acceleration.

I don’t know if this has happened to others. A brief summary of the critical parts of the code (OpenGL context creation, pixel format config…) is here: http://www.yeray-muaddib.com/code_summary.txt

This project is very important to me, and I would thank a lot any help.

Bye.

I tried to run your code on Win2k after modifying it slightly (so it would actually run). It failed on the CreateWindowEx function. It didn’t like the fact that your wndclass string used in the call to CreateWindowEx was not a valid wndclass. That probably isn’t the problem with your code, but after changing it to match the string you defined in your wndclass I was able to get a simple image I created.

I also had to modify the following as I really did not feel like creating a test image using all of the following:

//glClearDepth(1.0f);
//glDepthFunc(GL_LEQUAL);
//glEnable(GL_CULL_FACE);
//glEnable(GL_LIGHTING);

It could be that home versions of Windows use a default wndclass if the requested wndclass is not found, and that pro versions of Windows require a valid wndclass. But, I’m really not certain.

But if that doesn’t work, try looking into the 4 items I commented out of my code, except for lighting, because lighting does work without any problems.

Anyway, change:

wnd = CreateWindowEx(dwExStyle, “mwnd”, name, dwStyle, 0, 0, 800, 600, 0, 0, inst, NULL);

to:

wnd = CreateWindowEx(dwExStyle, “GILibWC”, name, dwStyle, 0, 0, 800, 600, 0, 0, inst, NULL);

Hope it helps.

You are right, that was an error I made when I wrote the code summary. In the actual code I use the same string (“GILibWC”) in the wndclass definition and the window creation. But you have really helped me, because now I know that the code runs well in a Windows 2000 PC (correcting the wndclass string, of course).

I will try to test it again in a system that previously failed, without the 4 lines you commented. Maybe some video cards do not support changing the deph test func.

thank you.