Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


OpenGL core profile question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 riverreal   Members   -  Reputation: 616

Like
0Likes
Like

Posted 27 March 2013 - 09:50 AM

I'm trying to learn the modern opengl with the core profile (+3.x) but I don't know the best way to initialize the opengl extensions.

 

Glew was a headache for me. I initialized it (and enabled glew experimental) but for some reason I had problems generating vertex arrays. I think it's because I defined the opengl profile to core profile with glfw, but I'm not sure.

 

There is a good opengl core profile tutorial? 

 

By the way, I'm using windows 7 64bits with Visual C++ 2010 express. 

 

Thanks in advance.



Sponsor:

#2 powly k   Members   -  Reputation: 653

Like
1Likes
Like

Posted 27 March 2013 - 05:32 PM

The OpenGL wiki itself has a few tutorials on the subject, though they're not using glfw.

 

Though I'd guess that the way you use vertex arrays or something related is the problem itself - if you got the context without any errors, it was probably working correctly. The OpenGL vertex array object thing makes no sense anyways. I'd double check that you're actually getting an error of some sort from GLFW or GL related to context creation, not the rendering code itself, before jumping into conclusions. Checking for errors is usually a good idea anyway.

 

The way I like to use OpenGL extensions is with a small offline script that generates me a header with all the function pointers and a function to load all the extensions based on a core specification I give as a parameter. It took a couple of nights to code, but works like a charm and whenever the ARB releases a new header, I can just ask for the new core (when the drivers arrive, of course) without being tied to anyone elses code.



#3 Josh Vega   Crossbones+   -  Reputation: 1207

Like
1Likes
Like

Posted 27 March 2013 - 10:07 PM

The OpenGL wiki has a page on some of the common extension loading libraries as well as a page on loading extensions manually.

 

I know you already said that you dislike GLEW, but maybe you should post some code so we can find out why it isn't working. I've used both GLEW and GL3W with OpenGL 3.X before and have had no major problems. Try adding some error checking code:


GLenum err = glewInit();
if (GLEW_OK != err)
{
  /* Problem: glewInit failed, something is seriously wrong. */
  fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
}

 

You could also attempt to load a specific extension as described here.


Edited by Josh Vega, 27 March 2013 - 10:07 PM.

Some favourite quotes:
Spoiler

#4 riverreal   Members   -  Reputation: 616

Like
0Likes
Like

Posted 28 March 2013 - 12:03 AM

The OpenGL wiki has a page on some of the common extension loading libraries as well as a page on loading extensions manually.

 

I know you already said that you dislike GLEW, but maybe you should post some code so we can find out why it isn't working. I've used both GLEW and GL3W with OpenGL 3.X before and have had no major problems. Try adding some error checking code:


GLenum err = glewInit();
if (GLEW_OK != err)
{
  /* Problem: glewInit failed, something is seriously wrong. */
  fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
}

 

You could also attempt to load a specific extension as described here.

Thank you.

But I always get an access violation when trying to generate something. (glGenVertexArray, glGenBuffer, even glCreateShader).

 

Do you know why I get this kind of errors?



#5 japro   Members   -  Reputation: 887

Like
1Likes
Like

Posted 28 March 2013 - 04:15 AM

For core profiles glew is kinda hit miss afaik. It doesn't support them cleanly. So it is usullay preferable to use a loader like gl3w or glxw.

#6 irreversible   Crossbones+   -  Reputation: 1409

Like
0Likes
Like

Posted 28 March 2013 - 05:34 AM

But I always get an access violation when trying to generate something. (glGenVertexArray, glGenBuffer, even glCreateShader).

 

Do you know why I get this kind of errors?

 

 

Is your rendering context properly created and current?



#7 Josh Vega   Crossbones+   -  Reputation: 1207

Like
1Likes
Like

Posted 28 March 2013 - 06:48 AM

Is it possible to you can post the relevent information from the output window during a build (preferably debug)?

 

I did a quick search for GLEW with OpenGL 3.X tutorials and ran across this page. I'm know that you are using GLFW and this uses Win32/MFC, but maybe the GLEW parts can help you to check against your own code.

 

Another thought that just popped into my head is that maybe GLFW is interfering with GLEW (or vice versa). If its possible, try switching out GLFW for SDL or SFML (or even freeglut) and try testing it again.

 

If all else fails, it might just be easier to switch to GL3W.

 

EDIT: I was just browsing through the forums here and found this thread where the OP has a similar problem to the one you are describing. It may or may not help, but I'm just gonna put it out there for you. You can check the final post for his resolution to the problem.


Edited by Josh Vega, 28 March 2013 - 07:13 AM.

Some favourite quotes:
Spoiler




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS