OpenGL and C++ on RH Linux (how!?)

How does one get OpenGL to work with C++ on RH Linux (6.2)?

Problems experienced:

  1. Passing static methods as callback functions do result in the method being called, although garbage is received in parameters.

  2. The scene is not drawn properly. Initially I thought there was a bug in my code, yet once the code was downgraded to C, the scene displayed as expected.

Pretty much impossible to guess without seeing some code.

Originally posted by rlevitt:
[b]How does one get OpenGL to work with C++ on RH Linux (6.2)?

Problems experienced:

  1. Passing static methods as callback functions do result in the method being called, although garbage is received in parameters.[/b]

yes, i’ve seen this before. i tried my hand at opengl programming with c++, and doing exactly what you are doing: passing in methods as callbacks. this can’t be done. you must use plain functions as callbacks, you cannot use any methods from classes as callbacks.
the reason why garbage is being received as a parameter (and i’m suprised you even got it to compile) is because the class is also being passed as a parameter, even though you don’t see it.

the reason why garbage is being received as a parameter (and i’m suprised you even got it to compile) is because the class is also being passed as a parameter, even though you don’t see it.

That’s called the “this” pointer. And you don’t get it when you make methods static.

See Stroustrup, section 10.2.4

Originally posted by rts:
Pretty much impossible to guess without seeing some code.

Should it work? Has anyone done this?

Originally posted by rlevitt:
Should it work? Has anyone done this?

i stand corrected. yes, you can do this.

post your code so we can take a look…

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.