Using OpenGL?

Posted By: TehV

Using OpenGL? - 04/13/16 09:43

Hello again,
I've run into an issue recently where the newer graphics drivers under Windows 10 can no longer force VSync on Gamestudio applications. I had a lead that said that the reason for this is that DirectX10 and newer no longer properly support VSync, and an attempt to install DirectX9.0c (which the engine prefers to use) is no longer supported in these newer versions of Windows.

This leads to a situation where a program I've made works properly on some computers but not on others (i.e. VSync is used on some but not others).

Contributing to this problem is the fact that the newer graphics drivers for both nVidia and AMD graphics devices seem to only support forcing these settings on OpenGL (according to several support forums I've asked on), so I'm trying to support both DirectX and OpenGL in order to increase the amount of systems on which my application works properly.

Now, GameStudio *does* have an OpenGL header, which I've included, but I'm not sure on a few things still. Please consider that I've never worked with OpenGL before and these questions may reflect my absolute ineptitude:

1) According to some research I've done, I can use wglSwapIntervalEXT(1) to enable VSync on my program (or at least make it prefer running with VSync). This function does not exist in that header. I believe I'd still be able to force it in the graphics driver, so this wouldn't be a huge issue, but I'd rather be sure and haven't been able to test this yet. Are there any substitutes for this function?
2) Again, according to some research, I'd need to use glFinish() to block the thread until all OpenGL execution has finished to properly sync to the screen refresh rate. Does this call substitute the GameStudio wait(n) function or does it not allow the renderer to update?
3) When starting up my program with opengl.h included, it complains that glaux.dll cannot be found. I've searched my entire computer for it and it doesn't exist. I've also searched online and found several sources saying it is obsolete. Is this true, does it still work reliably on newer Windows versions and where do I get it?
4) I've included opengl.h in my code but I'm not sure at all if the engine is using OpenGL instead of DirectX because of that. Are there any steps I need to take to make that happen?

The GameStudio documentation on this topic is very scarce and seems incomplete. Any help on this is very much appreciated. Thanks!
Posted By: SchokoKeks

Re: Using OpenGL? - 04/14/16 20:32

Unfortunately it's not that easy.
When you include the OpenGL Header, the engine will not automatically use OpenGL (correct me if I'm wrong). It's just there if you want to write your own renderer in lite-C, which you probably don't want to. Calls to wglSwapIntervalEXT(1) will end with an error or even a crash when there is no OpenGL Context defined. The function should not be able to change VSync for a DirectX renderer as Acknex.

Future engine version will need to use OpenGL, when they want to support publishing to android. I don't expect that will ever happen, at least not this decade grin.
© 2024 lite-C Forums