Skip to main content
GameDev.net gamedev.net
🔒 Locked

Load Custom OpenGl version at runtime

Started by Repixel Apr 4, 2020 at 8:35 AM 8 replies 7.4k views
Original Post
Repixel
Repixel

I am currently using Glad in my game engine. It works pretty well in my new laptop with GTX1050 in it. but when I try to run my game engine in my old laptop with Intel HD graphics 3000(really old); I should regenerate Glad with lower version. otherwise , the window goes to “not responding” mode and closes after a few seconds.

Is there any way to load OpenGL at run-time instead of generating Glad files for different versions?

What about Glew? Dose it load latest supported version by hardware?

Both laptops are 64bit

IDE and compiler : VisualSudio 2019

When I print glGetString(GL_VERSION) ; with any Glad generated, It prints 4.6.0 on new laptop and 3.1.x(I cant remember) on old one

OverEngine on Github : http://github.com/OverShifted/OverEngine

It is pretty much same as Hazel engine By TheCherno

SyncViews
SyncViews

Did you try debugging?

Glad definitely shouldn't hang, probably something in your code. I believe it loads upto the the specified version and any optional extensions, returning success, and it is up to you to check they are actually there/loaded before making use of them (checking GLAD_GL_VERSION_X_Y variables etc. after it loaded).

Repixel
Repixel

I will do that but every thing fixed by regenerating glad with lower version for my old laptop.

and when I ran that on my new laptop; It prints out “4.6.0 ….. “ ; so I dont think Glad “loads upto the the specified version”

Repixel
Repixel

My old computer supports OpenGL 3.1 (or 3.2) . Glad 4.6 and 3.3, both brings Not responding window.

Green_Baron
Green_Baron

Well, if you use functionality from a higher version than your old laptop supports it won't run on that machine. You will either have to check in the application if a certain funcionality is available and fork accordingly, or limit your game engine generally to the lowest version. Or forget about supporting old hardware.

I would forget about the old laptop. I too have one that's 7 years old and just won't break :-)

SyncViews
SyncViews

The debugger will show you where your code is stuck while the window is “not responding”. I don't believe it will be glad as it is mostly a sequence of GetProcAddress depending on your requested max version and extensions.

Show the specific piece where the problem is.

Repixel
Repixel

SyncViews said:

The debugger will show you where your code is stuck while the window is “not responding”. I don't believe it will be glad as it is mostly a sequence of GetProcAddress depending on your requested max version and extensions.

Show the specific piece where the problem is.

I dont have visual studio on old one but I think window hangs when glClearColor runs. because window's color stays white when I try to clear with dark green

Repixel
Repixel

Green_Baron said:

Well, if you use functionality from a higher version than your old laptop supports it won't run on that machine. You will either have to check in the application if a certain funcionality is available and fork accordingly, or limit your game engine generally to the lowest version. Or forget about supporting old hardware.

I would forget about the old laptop. I too have one that's 7 years old and just won't break :-)

Every thing fixed after regenerating Glad.

So I dont think It (I mean DearImgui; I dont have renderer) used “ functionality from a higher version”.

cgrant
cgrant

Another thing to add. GLAD is not OpenGL, all it does is generate the function entry points for the specified OpenGL version. With that said any robust OpenGL codes need to have validation checks for missing entry point, OpenGL extension, OpenGL limits etc. Without these in place, you will find that you've ‘fixed’ one issue to have another popup when you try to run your software on another machine.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.