OpenGL ofVbo Windows Help

Hey Friends,
Windows is not my specialty at all, soo sorry in advance. I am trying to build a plugin, for OF on the windows side (thats then end goal). Right now just build my code on the pc, run amazing on any mac :). I have been running into issues with OpenGL calls.
Has anyone successfully built a vbo or used ofVbo on a pc? I have found a lot of posts online about GLEW and vbo etc. I am getting this issue with just the simplest call of glGenBuffers();

Unhandled exception at 0x00000000 in emptyExample_vs2010_debug.exe: 0xC0000005: Access violation.

I will get the same crash when trying to call ofEnableAlphaBlending(). Is there something im now doing, or missing. I have tried this on windows 7 and vista.

http://stackoverflow.com/questions/4317062/opengl-how-to-check-if-the-user-supports-glgenbuffers
http://www.gamedev.net/topic/604630-unhandled-exception-at-0x00000000-glgenbuffer/
http://stackoverflow.com/questions/7862041/access-violation-using-vbo-with-glew

any guidance, help would be magical :slight_smile:

I think my problem is similar. I’ve been getting the same error trying to run a lot of the examples:

  
Unhandled exception at 0x00000000 in terrainExample_vs2010_debug.exe: 0xC0000005: Access violation reading location 0x00000000.  

These are some of the lines where the debug breaks on:

  
glBlendEquation(GL_FUNC_ADD);  
  
glActiveTexture(GL_TEXTURE0);  
  
if (WGL_EXT_swap_control) wglSwapIntervalEXT (1);  
  
glGenBuffers(1, &(vertId));  

So I notice they all are functions with “gl” in the name, so it may be a problem with OpenGL?

Is anybody familiar with this?

I’m not familiar with terrainExample, could you post some more of the code from it and also maybe some info about your graphics card and OS? That might help narrow some things down.

OS is Windows 7. Garphics card is a Radeon X1300 / X1550 Series

I’ve tried this in both Microsoft Visual C++ Express and in CodeBlocks, and the same examples break in both.

terrainExample was just one example. I’m getting the same error in a lot of the examples.

When running terrainExample, it breaks here:

  
void ofVbo::setVertexData(const float * vert0x, int numCoords, int total, int usage, int stride) {  
	if(vert0x == NULL) {  
		ofLog(OF_LOG_WARNING,"ofVbo: bad vertex data!\n");  
		return;	  
	}  
	if(!bUsingVerts) {  
		bAllocated  = true;  
		bUsingVerts = true;  
		glGenBuffers(1, &(vertId));  //RIGHT HERE  
		retain(vertId);  
	}  
  
	...  
}  

When running graphicsExample, it breaks here:

  
  
void ofGLRenderer::setBlendMode(ofBlendMode blendMode){  
	switch (blendMode){  
  
		case OF_BLENDMODE_ALPHA:{  
			glEnable(GL_BLEND);  
			#ifndef TARGET_OPENGLES  
				glBlendEquation(GL_FUNC_ADD);   //RIGHT HERE  
			#endif  
			glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);  
			break;  
		}  
  
		...  
	}  
}  

graphicsExample won’t break if I comment out a line in testApp::draw() that says “ofEnableAlphaBlending();” but that’s necessary for the transparency.

moviePlayerExample breaks here:

  
  
void ofTexture::draw(float x, float y, float z, float w, float h){  
	  
	// make sure we are on unit 0 - we may change this when setting shader samplers  
	// before glEnable or else the shader gets confused  
	/// ps: maybe if bUsingArbTex is enabled we should use glActiveTextureARB?  
	glActiveTexture(GL_TEXTURE0);  // RIGHT HERE  
  
	...  
}  
  

Has anyone found a solution to this? I am trying to setup a windows dev environment and can’t compile any examples with OpenGL. graphicsExample compiles fine. Things like moviePlayerExample and blendingExample get the Unhandled Exception error.

moviePlayerExample error:

  
void ofTexture::draw(float x, float y, float z, float w, float h){  
	  
	// make sure we are on unit 0 - we may change this when setting shader samplers  
	// before glEnable or else the shader gets confused  
	/// ps: maybe if bUsingArbTex is enabled we should use glActiveTextureARB?  
	glActiveTexture(GL_TEXTURE0);  //<-- breaks here  
	  
	// Enable texturing  
	glEnable(texData.textureTarget);  

oF 007
Windows 7
Visual C++ 2010 Express
NVIDIA Quatro FX 1700

when i’ve seen errors like this in linux, and what the links posted by vanderlin in the first post suggest is that your hardware doesn’t support some feature and it crashes. usuually the problem is not with the hardware but with the correct driver not being installed.

I second Arturo.

I was having similar issues with running the GL examples. I tried two different computers, one running XP with Intel integrated graphics and the other running Vista running Radeon HD 3650. Both using CodeBlocks

This thread is old, but I was having problems figuring this out and didn’t see any other posts. Hopefully this helps people.

OF 0071 and when you run GL examples they crash. To see what’s going on- run the example:
glInfoExample

Press space bar to see the full readout of your GL capabilities. In my instance, I did not have OpenGL 3 or 4 functionality, and those functions were listed as “MISSING”.

For this laptop I’m on now, I updated my graphics drivers at the AMD site. All the GL examples run fine, now.

So, while this might be a “hardware issue” for some people- it’s most likely not. Dig around for the latest drivers, and you should have GL4 functionality. I’m now moving onto my XP machine to see if I can replicate the magic.