Results 1 to 6 of 6

Thread: Will opengl-4 program run on a machine with opengl version 2.1?

  1. #1
    Member Newbie
    Join Date
    Jan 2010
    Posts
    34

    Will opengl-4 program run on a machine with opengl version 2.1?

    Hi,

    Suppose I've written a program with opengl-4, compiling it i got out.exe or out. Now will it run on a machine where the opengl version is 2.1?

    Vice versa:
    Suppose I've written a program with opengl-2.1, compiling it i got out.exe or out. Now will it run on a machine where the opengl version is 4?

    Any answer will be highly appreciated.

    Thanks in advance.

  2. #2
    Member Contributor
    Join Date
    Mar 2014
    Posts
    59
    Quote Originally Posted by colagl View Post
    Hi,

    Suppose I've written a program with opengl-4, compiling it i got out.exe or out. Now will it run on a machine where the opengl version is 2.1?

    Vice versa:
    Suppose I've written a program with opengl-2.1, compiling it i got out.exe or out. Now will it run on a machine where the opengl version is 4?

    Any answer will be highly appreciated.

    Thanks in advance.
    The aswer is in the question...
    2.1 OpenGL hardware cant run OpenGL 4 program...
    OpenGL 2.1 program will run on OpenGL 4.x hardware...

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    3,100
    Quote Originally Posted by colagl View Post
    Suppose I've written a program with opengl-4, compiling it i got out.exe or out. Now will it run on a machine where the opengl version is 2.1?
    No. If the program uses features which were added after 2.1, it won't work on a system which only supports 2.1. In many cases it will be possible to make a program compatible with 2.1 by querying extensions and using either the extension or the core feature depending upon which is supported. In many (but not all) cases, the only difference is that the extension requires a suffix such as ARB or EXT on the function name.

    Quote Originally Posted by colagl View Post
    Suppose I've written a program with opengl-2.1, compiling it i got out.exe or out. Now will it run on a machine where the opengl version is 4?
    Maybe. If the program uses any deprecated features, the system would need to support either 2.1 or the compatibility profile.

    Note that it's possible to support multiple OpenGL versions on the same system. E.g. Apple Mac systems typically support both OpenGL 2.1 and either OpenGL 3.3 or OpenGL 4.1 core profile.

    In practice, a program which uses OpenGL 2.1 will typically work on any system supporting 2.1 or later. Systems supporting higher versions typically either support 2.1 or the compatibility profile or both, and use either 2.1 or the compatibility profile unless the program specifically requests otherwise.

    Windows and Linux systems typically default to using the compatibility profile for the highest supported version, while Mac systems typically default to providing 2.1 (so if the program wants 3.3 or 4.1 it has to request it, and will be unable to use any deprecated features).

  4. #4
    Senior Member Regular Contributor
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    394
    Are you hoping that if you transfer 'out.exe' to another computer, it will run by simply double-clicking on it? Because that's a longshot. It definitely won't work if the operating systems are different. You may even have problems transferring between different versions of the same O.S. Be prepared to recompile when rehosting in different environments.

  5. #5
    Member Newbie
    Join Date
    Jan 2010
    Posts
    34
    Quote Originally Posted by __bob__ View Post
    The aswer is in the question...
    2.1 OpenGL hardware cant run OpenGL 4 program...
    OpenGL 2.1 program will run on OpenGL 4.x hardware...
    So writing program with opengl-2.1 api looks good as it will run on a machine where the opengl version is 4.x. Right? But the opposite will not work.

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    3,100
    Quote Originally Posted by colagl View Post
    So writing program with opengl-2.1 api looks good as it will run on a machine where the opengl version is 4.x. Right?
    Probably. Eventually you might start seeing systems which only support OpenGL 3/4 core profile, (or where support for legacy OpenGL is inferior in some regard), but that isn't an issue at the moment.

    Quote Originally Posted by colagl View Post
    But the opposite will not work.
    Correct.

Similar Threads

  1. GLSL version doesn't match OpenGL version
    By Susano2018 in forum OpenGL: Drivers
    Replies: 0
    Last Post: 11-13-2018, 06:35 PM
  2. How to check OpenGL version of currently running program?
    By MarioPL98 in forum OpenGL: User Software
    Replies: 0
    Last Post: 08-06-2016, 03:47 AM
  3. OpenGL on windows virtual machine, outdated version
    By Toast9 in forum OpenGL: Windows
    Replies: 3
    Last Post: 02-04-2016, 04:06 AM
  4. opengl problem on 64-bit machine
    By Efone in forum OpenGL: User Software
    Replies: 6
    Last Post: 03-14-2008, 03:32 PM
  5. How to run OpenGl Program in a Linux Machine
    By sumitbag in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-15-2004, 12:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean