1

I was doubting: I'm writing a cross-platform engine OpenGL C++, I figured out Windows forces the developers to access OpenGL features above 1.1 through extensions.

Now the thing is, on Linux, I know that I can directly access functions if the version supports it through glext.h and opengl version. The problem is that if on Linux, the core doesn't support it, is it possible there is an extensions that supports the same functionality, in my case vertex buffer objects?

I'm doing something like this:

Windows:

#define glFunction functionpointer_to_the_extension

Linux:
Since glext already defined glFunction, I can write in client code glFunction, and compile it both on Windows AND Linux without changing a single line in my client code using the engine (my goal).

Now the thing is, I saw a tutorial use only the extension on Linux, and not checking for the opengl implementation version. If the functionality is available in the core, is it also available as extension (VBO's e.g.)? Or is an extension something you never know is available?

I want to write an engine that is capable of using all the hardware functionalities, so I need to check (on Linux) for extensions as well as core version for possible functionality implementation.

2

I was doubting: I'm writing a cross-platform engine OpenGL C++, I figured out windows forces the developers to access OpenGL features above 1.1 through extensions.

That sounds odd, because Windows have never forced me to use extensions, I always use core functions when possible, and while saying "when possible" I mean if my graphics card/driver supports the features. Because that plays the biggest part.

If the functionality is available in the core, is it also available as extension (VBO's e.g.)?

Not necessarily! But always favor the core functions when you can. Though when using extensions (EXT, ARB, etc) just always remember to check, if they are available.

If you're going to release a program using an NV Extension (Nvidia Extension), then again be sure to have something that checks whether the function is available, as if someone with a non-Nvidia graphics card uses your program it will most likely crash.

Or is an extension something you never know is available?

Yes, you never know for sure if an extension is available, it depends on various things such as.

  • The OpenGL version you're using
  • Your Graphics Card
  • Your Graphics Card version and model (GeForce, Cuda, Radeon, etc)
  • Your Graphics Card vendor (Nvidia, AMD, etc)

By using core functions the chances are that the majority of people will be able to run the program, as long as their graphics card can run the particular GL version.

  • EXT extensions usually only are supported by a few vendors.
  • ARB extensions are often supported by the majority but not necessarily all vendors.
  • Core functions are supported by every card which supports the particular GL version, which the program is using.

Remember

Always remember you can't mix-match and use GL_TEXTURE1 with glActiveTextureARB and you can't use GL_TEXTURE1_EXT with glActiveTexture. Even though mixing them sometimes produces the desired result, there is no guarantee for that.

  • OKay, clear explanation, but how do you use core functions in Windows? Through function pointers? Because I get linker errors if I do not use wglGetProcAddress, and is it true that on Linux, you don't need to use function pointers but directly the function declarations (if you have the version that supports them as core of course). – user209347 Oct 25 '13 at 19:10
  • This is unfortunately a potential source of confusion. You don't use extensions to access higher functionality on Windows, you use the extension loading mechanism, and these are not the same thing. wglGetProcAddress ("glBindBuffer") == not an extension. – Maximus Minimus Apr 22 '14 at 12:19
0

If the functionality is available in the core, is it also available as extension (VBO's e.g.)? Or is an extension something you never know is available?

First, you need to check if the hardware supports the extension (just type glxinfo in terminal, and you'll get list of supported extensions).

The second thing is the driver support. If the driver doesn't support it, it is not going to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.