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

OpenGL 3.0 frameworks

Started by i_luv_cplusplus Apr 10, 2009 at 9:24 AM 12 replies 5k views
Original Post
i_luv_cplusplus
i_luv_cplusplus
Does anyone have a tested way of creating OpenGL 3.0 context both on ATI and NVIDIA? Using SDL and GLFW I have only managed to create 3.0 context on NVIDIA. Is it that ATI doesn't support OpenGL 3.0 yet? (apparently they do support it :/). I tried to use GLFW and it only created 2.1.2 on ati card (newest drivers, HD4850)
OpenGL fanboy.
samoth
samoth
After installing some newer drivers last week, I get OpenGL 3.0 contexts on nVidia(apparently backwards-compatible) without even explicitely asking.
bubu LV
bubu LV
Both ATI and Nvidia supports OpenGL 3.0 in their latest drivers for DX10 video cards.
But you probably want to wait few months for drivers to get stable. For example, latest ATI drivers for OGL 3.0 forward-compatible context are very buggy (full context works mostly fine - same as "old" 2.1 context).
_SergeyK_
_SergeyK_
Recent patch to Linderdaum Engine adds OpenGL 3.0 context creation. Initialization goes well with both nVidia and AMD, though AMD doesn't have OGL 3 on consumer hardware at the moment. Context creation itself it very simple.
bubu LV
bubu LV
Quote:
Original post by _SergeyK_though AMD doesn't have OGL 3 on consumer hardware at the moment.

What do you mean by that?
Starting from Catalyst driver v9.1 OpenGL 3.0 context can be created and used on any ATI HD card. Starting from HD2400 up to HD4870.
i_luv_cplusplus
i_luv_cplusplus
I am confused. ATI cards don't support OpenGL 3.0, yet their drivers do? Should I just continue developing on NVidia until ATI fixes their stuff?
OpenGL fanboy.
_SergeyK_
_SergeyK_
Quote:
Original post by bubu LV
What do you mean by that?
Starting from Catalyst driver v9.1 OpenGL 3.0 context can be created and used on any ATI HD card. Starting from HD2400 up to HD4870.


I meant AMD 1x00 series don't support OGL 3.
i_luv_cplusplus
i_luv_cplusplus
Quote:
Original post by _SergeyK_
Initialization goes well with both nVidia and AMD, though AMD doesn't have OGL 3 on consumer hardware at the moment. Context creation itself it very simple.

So, GL_VERSION on ATI would return 2.1.2?

OpenGL fanboy.
bubu LV
bubu LV
For 2.1 context - yes. But on OpenGL 3.0 capable card and proper driver you will get 3.0 version string.
i_luv_cplusplus
i_luv_cplusplus
I have the most basic OpenGL 3.0 setup imaginable and apparently it doesn't work on ATIs :/

[source lang=cpp]#include "glee.h"#include "glfw.h"#include <string>#include <iostream>#include <fstream>#include <sstream>using namespace std;ofstream log("log.txt");int main(int argc, char* argv[]){  bool done = false;  bool ok;  glfwInit();  glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);  glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 0);  glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE);  ok = glfwOpenWindow(      800, 600,      8, 8, 8,      8,           24,          0,           GLFW_WINDOW  );  const GLubyte* ver = glGetString(GL_VERSION);  const GLubyte* vend = glGetString(GL_VENDOR);  const GLubyte* ext = glGetString(GL_EXTENSIONS);  glfwSetWindowTitle((char*)ver);  log << (char*)vend << " " << (char*)ver << " " << (char*)ext << std::endl;  while (!done)  {    done = glfwGetKey( GLFW_KEY_ESC ) || !glfwGetWindowParam(GLFW_OPENED);    glfwSwapBuffers();  };  glfwTerminate();  return 0;};


binary is here: here

Could anyone with radeon test it?

[Edited by - i_luv_cplusplus on April 10, 2009 3:22:47 PM]
OpenGL fanboy.
kRogue
kRogue
okay, here is the beans on getting an OpenGL 3.x context:

For X-windows read up on new context creation at http://www.opengl.org/registry/specs/ARB/glx_create_context.txt

For MS-Windows read up on it at: http://www.opengl.org/registry/specs/ARB/wgl_create_context.txt

if you use another library to create your contexts for you, then be prepared to hack them some, there is also a thread at opengl.org's forum on creating 3.0 contexts, if you use SDL, SDL 1.3 in SVN does GL 3.x, and their is also a patch for SDL 1.2 on the mailing lists.

nVidia's driver creates a 3.0 context which includes the "ARB_compatibility" extension, which is basically backwards compatibility for deprecated GL calls, to get a GL context without that stuff, you need to create your context with the named extensions above. If you want a 3.1 context vie nVidia GL 3.1 drivers recently released you must use the above to get that kind ofcontext.
Close this Gamedev account, I have outgrown Gamedev.
i_luv_cplusplus
i_luv_cplusplus
uh... I know how to create OpenGL 3.0 context using SDL or GLFW. Problem is NVIDIA works flawlessly while ATI cards create OpenGL 2.1 context instead :/

OpenGL fanboy.
kRogue
kRogue
change:

glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE);


to

glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);


Also check GLFW's source on how it makes GL3 contexts, a while ago there was a post over at opengl.org that said how to make a GL3 context but it was initally wrong; the method would only work for NV hardware.
Close this Gamedev account, I have outgrown Gamedev.

Topic Locked

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

Sign in to reply to this topic.