Error: GLBatch's vertexArrayObect symbol not found

Started by
5 comments, last by Zild 13 years, 2 months ago
Hi guys,

I come from a C# / .NET background so apologies if when I sound confused about this new C++ malarky...

I am working through OpenGL SuperBible and am suffering epic fail on the second chapter (the first that gets you writing code). The project compiles but when I run it I get an access violation on the following line:[font="Courier New"][font="Courier New"]triangleBatch.Begin(GL_TRIANGLES, 3);

(triangleBatch being a GLBatch)

Stepping through the code, I see that the problem occurs on a line within the GLBatch.Begin method that refers to vertexArrayObject, but the symbol vertexArrayObject is not recognised.

I am flumoxed...
-------------Hunted by allAided by noneUSS CarpathiaNCC-17499www.carpathia.tk - Starfleet renegades
Advertisement
Just as a curiosity, what the hell is a GLBatch? Some kind of wrapper OGL Superbible does or similar? Within standard OGL there are no classes (C API), and I don't remember any structure with such name.

As for your question, if the previous statement is true, maybe your drivers do not support VAO, as this is a pretty new extension (core in last OGL). Can't help much more without more knowledge on what GLBatch is exactly.

Cheers
Thanks, Kilah,

GLBatch is a GLTools wrapper class that contains a batch of triangles and basic drawing code for them. Sorry, I wrongly assumed this to be common knowledge amongst OpenGL users (my apologies, but I am only on chapter 2!)

You are probably right about it being a driver or GFX card limitation issue - my GFX card is five years old and I expected I might run into such issues sooner or later, but I was expecting it to be at least a little later...

Well, that has certainly put a crimp on my day... I suspect updating drivers will not be sufficient to fix this, but I was particularly keen on this book because of it's "just the core" approach.

I am a little surprised the error is not handled more nicely than this, either by GLTools or by my own code!

-------------Hunted by allAided by noneUSS CarpathiaNCC-17499www.carpathia.tk - Starfleet renegades
You might have to hack up the tutorial a little bit, but don't get too discouraged. Vertex Array Objects are not really required for anything, at best they just cache a few state calls together, you're not really missing out on anything. Do you have the source code to the library?

Actually looking at the source code, it seems you might be in luck.
http://code.google.com/p/oglsuperbible5/source/browse/trunk/Src/GLTools/src/GLBatch.cpp?r=93

The code is ifdef'd out for OpenGL_ES devices, which should be the same for just a PC. If you look through the file there is a bunch of sections like:

#ifndef OPENGL_ES
blah blah vertexArrayObject
#else
(equivalent non VAO code)
#

If you can recompile the library you can just take out these sections to only contain the non-vao code, and that should work for you.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game
I do have the source code, so I guess it is technically possible. I am not sure how to go about fixing it (did I mention: chapter two?! :blink: ) but I can but try. I may do so in the morning with a fresh head, however, rather than at 3am...

EDIT: Having just read your edit, I did notice those #ifdefs but had not joined the dots yet. I will give your suggestion a try and see what other errors it throws up. Thanks!
-------------Hunted by allAided by noneUSS CarpathiaNCC-17499www.carpathia.tk - Starfleet renegades
As Karwosts pointed, VAO are basically a OGL object that aim to store states (OGL is a state machine), main goal of this is reducing cost incurring an state change while rendering. Also as he noted, this is not something relevant while learning OGL, as it only serves a performance purpose.
The best suggestion I may offer you Zild is as you are learning the basic, use immediate mode (this mode is available for sure within your context). Which is by far(from my point of view) the best way to start learning 3D rendering.

Simple, clean and easy ( don't bother on performance until way later ).

Cheers and have fun while learning.

P.S: Hopefully this helps you, if you are using some really modern OGL Superbible edition which is trying to focus on standard 3.X or superior, ignore my previous comment as you wont see any information within the book on this matter.
Apologies for the thread resurrection, but I wanted to make sure this worked before posting again. Alas, that never happened.

Whilst I do have the source code, I am having difficulty editing it. As far as I can tell the code has been bodged into a Visual Studio solution outside of Visual Studio, with the layout of the files incorrect meaning they cannot be edited in Visual Studio. If I had either a little more experience with C++ or any experience with IDEs other than Visual Studio I might be able to fix this and move on to the next innevitable problem, but to be frank I should not be having this kind of problem in Chapter 2 so the book will be leaving my shopping list for the foreseeable future in favour of something a little more... friendly.

My thanks to those who helped. I really do think immediate mode would have worked if I could actually find a way to implement it!

-------------Hunted by allAided by noneUSS CarpathiaNCC-17499www.carpathia.tk - Starfleet renegades

This topic is closed to new replies.

Advertisement