Hi good people,
I’m using a 32 bit executable of Code::Blocks ver. 12.11, glew, GLFW3 and OpenGL 3.3 with a core profile.
In “OpenGL Shading Language” ver.3 page 209 the author writes:
quote
A program object contains an executable that will run on the vertex-processor if it contains one or more shader objects of type GL_VERTEX_SHADER that has successfully compiled and linked.
unquote
This doesn’t make sense to me … except that, having two compiled programs to choose between through glUseProgram(…) actually implies that two v-shaders must have been compiled and linked successfully ;o/ it takes time to get all the details ;o/ But, what is the price to pay to swap programs? The SuperBible does not comment on how expensive it is, though he cannot get his arms down on the price of binding buffers.
There is another situation of the same sort: It’s possible to make different glfwWindows with each it’s own set of callbacks. That would be a real delight if the calls that involves the swap between them are cheep enough (say to separate a userInterface-area from a screen-area) - … but, that’s not how it works, right? Can I assume that it should be used for throwing a pop-up/message-box - or atleast redraws the whole window?
My current GLFW/GLEW-program is erroneous and unstable and I don’t want to touch it any further. For the passed year I’ve tried to learn about C/C++, and I’m much better prepared to start over again. It would be great to get your input on what’s expensive and what’s not, to have it reflect back on how I choose to structure the code.
I’ve written a tiny interface for draw-calls and inherited it as an abstract base for a small set of parameter-classes (drawArrays, drawElements … etc…) that thus can be filled with appropriate call-parameters. It’s virtue is, that I can stack all draw-calls into one vector<…> and hoot it off in one for(…).
All depending on what I can get back from you in this thread, I could extend it to take care of all the cheep bindings too! So far the compiler doesn’t complaint about the code.
look forward to your comments