Search Results

Search found 3 results on 1 pages for 'qba'.

Page 1/1 | 1 

  • Shaders with pygtkglext

    - by qba
    Do someone know how to get glsl shaders work in gtk-opengl window? With glut all glCreateProgram etc. functions works, but when I tried to put the same gl code into pygtkglext window, its complaining about NullReference: OpenGL.error.NullFunctionError: Attempt to call an undefined function glCreateProgram, check for bool(glCreateProgram) before calling So then I from OpenGL.GL.ARB.shader_objects import *, but the result is similar: OpenGL.error.NullFunctionError: Attempt to call an undefined function glCreateProgramObjectARB, check for bool(glCreateProgramObjectARB) before calling Any idea will be useful.

    Read the article

  • Python, lambda, find minimum

    - by qba
    I have foreach function which calls specified function on every element which it contains. I want to get minimum from thise elements but I have no idea how to write lambda or function or even a class that would manage that. Thanks for every help. I use my foreach function like this: o.foreach( lambda i: i.call() ) or o.foreach( I.call ) I don't like to make a lists or other objects. I want to iterate trough it and find min. I manage to write a class that do the think but there should be some better solution than that: class Min: def __init__(self,i): self.i = i def get_min(self): return self.i def set_val(self,o): if o.val < self.i: self.i = o.val m = Min( xmin ) self.foreach( m.set_val ) xmin = m.get_min() Ok, so I suppose that my .foreach method is non-python idea. I should do my Class iterable because all your solutions are based on lists and then everything will become easier. In C# there would be no problem with lambda function like that, so I though that python is also that powerful.

    Read the article

  • Python - copy by reference

    - by qba
    Is there any possibility to copy variable by reference no matter if its int or class instance? My goal is to have two lists of the same objects and when one changes, change is visible in second. In other words i need pointers:/

    Read the article

1