Mmm ctypes goodness and chocolate (Shane gave me dark-chocolate raspberries!)


So, after everyone left I went back to work on the ctypes version of PyOpenGL. Finished the pointer-setting functions, mostly just a matter of generalising the code so that it creates all of the various permutations for the Pythonic wrappers.

Then I started in on making the API look like the original, so importing everything into the GL.* namespace in load. Decided eventually to just have the __init__.py do the importing. Means you can't do a partial load, but it's so much cleaner looking that way.

Lastly implemented the glGetString function. Unfortunately, it's always returning a NULL pointer (None), which suggests I've done something wrong :( . Don't know what, I'm basically just loading the DLL and calling glGetString via ctypes. I don't think it should require an active context to display a value.

Which brings up the obvious need, making it possible to use current-PyOpenGL to generate contexts for use in testing OpenGL-ctypes, otherwise I could get the whole thing finished only to find I've missed some fundamental problem. Think about that tomorrow, I suppose... but Bryan sent me documents to review and revise before Monday, have to do that first.

Comments

  1. Michael K.

    Michael K. on 05/08/2005 2:03 p.m. #


    From http://www.mesa3d.org/faq.html#part3<br />
    <br />
    3.4 Why does glGetString() always return NULL?<br />
    <br />
    Be sure you have an active/current OpenGL rendering context before calling glGetString.

  2. Mike Fletcher

    Mike Fletcher on 05/09/2005 9:39 a.m. #


    Looking in the documentation, who would have thought of *that*. Thanks.

Comments are closed.

Pingbacks

Pingbacks are closed.